uboot: (firmwareOdroidC2/C4) don't invoke patch tool, use patches = [] instead
https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/setup.sh#L948 this can do it nicely. Signed-off-by: Anton Arapov <anton@deadbeef.mx>
This commit is contained in:
commit
56de2bcd43
30691 changed files with 3076956 additions and 0 deletions
|
|
@ -0,0 +1,233 @@
|
|||
{ lib
|
||||
, stdenv
|
||||
, fetchFromGitHub
|
||||
, callPackage
|
||||
, pkg-config
|
||||
, cmake
|
||||
, ninja
|
||||
, clang
|
||||
, python3
|
||||
, wrapQtAppsHook
|
||||
, removeReferencesTo
|
||||
, extra-cmake-modules
|
||||
, qtbase
|
||||
, qtimageformats
|
||||
, qtsvg
|
||||
, kwayland
|
||||
, lz4
|
||||
, xxHash
|
||||
, ffmpeg
|
||||
, openalSoft
|
||||
, minizip
|
||||
, libopus
|
||||
, alsa-lib
|
||||
, libpulseaudio
|
||||
, range-v3
|
||||
, tl-expected
|
||||
, hunspell
|
||||
, glibmm
|
||||
, jemalloc
|
||||
, rnnoise
|
||||
, abseil-cpp
|
||||
, microsoft_gsl
|
||||
, wayland
|
||||
, libicns
|
||||
, Cocoa
|
||||
, CoreFoundation
|
||||
, CoreServices
|
||||
, CoreText
|
||||
, CoreGraphics
|
||||
, CoreMedia
|
||||
, OpenGL
|
||||
, AudioUnit
|
||||
, ApplicationServices
|
||||
, Foundation
|
||||
, AGL
|
||||
, Security
|
||||
, SystemConfiguration
|
||||
, Carbon
|
||||
, AudioToolbox
|
||||
, VideoToolbox
|
||||
, VideoDecodeAcceleration
|
||||
, AVFoundation
|
||||
, CoreAudio
|
||||
, CoreVideo
|
||||
, CoreMediaIO
|
||||
, QuartzCore
|
||||
, AppKit
|
||||
, CoreWLAN
|
||||
, WebKit
|
||||
, IOKit
|
||||
, GSS
|
||||
, MediaPlayer
|
||||
, IOSurface
|
||||
, Metal
|
||||
, MetalKit
|
||||
}:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
tg_owt = callPackage ./tg_owt.nix {
|
||||
abseil-cpp = (abseil-cpp.override {
|
||||
# abseil-cpp should use the same compiler
|
||||
inherit stdenv;
|
||||
cxxStandard = "20";
|
||||
}).overrideAttrs (_: {
|
||||
# https://github.com/NixOS/nixpkgs/issues/130963
|
||||
NIX_LDFLAGS = optionalString stdenv.isDarwin "-lc++abi";
|
||||
});
|
||||
|
||||
# tg_owt should use the same compiler
|
||||
inherit stdenv;
|
||||
|
||||
inherit Cocoa AppKit IOKit IOSurface Foundation AVFoundation CoreMedia VideoToolbox
|
||||
CoreGraphics CoreVideo OpenGL Metal MetalKit CoreFoundation ApplicationServices;
|
||||
};
|
||||
in
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "kotatogram-desktop";
|
||||
version = "1.4.9";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "kotatogram";
|
||||
repo = "kotatogram-desktop";
|
||||
rev = "k${version}";
|
||||
sha256 = "sha256-6bF/6fr8mJyyVg53qUykysL7chuewtJB8E22kVyxjHw=";
|
||||
fetchSubmodules = true;
|
||||
};
|
||||
|
||||
patches = [
|
||||
./kf594.patch
|
||||
./shortcuts-binary-path.patch
|
||||
# let it build with nixpkgs 10.12 sdk
|
||||
./kotato-10.12-sdk.patch
|
||||
];
|
||||
|
||||
postPatch = optionalString stdenv.isLinux ''
|
||||
substituteInPlace Telegram/ThirdParty/libtgvoip/os/linux/AudioInputALSA.cpp \
|
||||
--replace '"libasound.so.2"' '"${alsa-lib}/lib/libasound.so.2"'
|
||||
substituteInPlace Telegram/ThirdParty/libtgvoip/os/linux/AudioOutputALSA.cpp \
|
||||
--replace '"libasound.so.2"' '"${alsa-lib}/lib/libasound.so.2"'
|
||||
substituteInPlace Telegram/ThirdParty/libtgvoip/os/linux/AudioPulse.cpp \
|
||||
--replace '"libpulse.so.0"' '"${libpulseaudio}/lib/libpulse.so.0"'
|
||||
'' + optionalString stdenv.isDarwin ''
|
||||
substituteInPlace Telegram/CMakeLists.txt \
|
||||
--replace 'COMMAND iconutil' 'COMMAND png2icns' \
|
||||
--replace '--convert icns' "" \
|
||||
--replace '--output AppIcon.icns' 'AppIcon.icns' \
|
||||
--replace "\''${appicon_path}" "\''${appicon_path}/icon_16x16.png \''${appicon_path}/icon_32x32.png \''${appicon_path}/icon_128x128.png \''${appicon_path}/icon_256x256.png \''${appicon_path}/icon_512x512.png"
|
||||
'';
|
||||
|
||||
nativeBuildInputs = [
|
||||
pkg-config
|
||||
cmake
|
||||
ninja
|
||||
python3
|
||||
wrapQtAppsHook
|
||||
removeReferencesTo
|
||||
] ++ optionals stdenv.isLinux [
|
||||
# to build bundled libdispatch
|
||||
clang
|
||||
extra-cmake-modules
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
qtbase
|
||||
qtimageformats
|
||||
qtsvg
|
||||
lz4
|
||||
xxHash
|
||||
ffmpeg
|
||||
openalSoft
|
||||
minizip
|
||||
libopus
|
||||
range-v3
|
||||
tl-expected
|
||||
rnnoise
|
||||
tg_owt
|
||||
microsoft_gsl
|
||||
] ++ optionals stdenv.isLinux [
|
||||
kwayland
|
||||
alsa-lib
|
||||
libpulseaudio
|
||||
hunspell
|
||||
glibmm
|
||||
jemalloc
|
||||
wayland
|
||||
] ++ optionals stdenv.isDarwin [
|
||||
Cocoa
|
||||
CoreFoundation
|
||||
CoreServices
|
||||
CoreText
|
||||
CoreGraphics
|
||||
CoreMedia
|
||||
OpenGL
|
||||
AudioUnit
|
||||
ApplicationServices
|
||||
Foundation
|
||||
AGL
|
||||
Security
|
||||
SystemConfiguration
|
||||
Carbon
|
||||
AudioToolbox
|
||||
VideoToolbox
|
||||
VideoDecodeAcceleration
|
||||
AVFoundation
|
||||
CoreAudio
|
||||
CoreVideo
|
||||
CoreMediaIO
|
||||
QuartzCore
|
||||
AppKit
|
||||
CoreWLAN
|
||||
WebKit
|
||||
IOKit
|
||||
GSS
|
||||
MediaPlayer
|
||||
IOSurface
|
||||
Metal
|
||||
libicns
|
||||
];
|
||||
|
||||
# https://github.com/NixOS/nixpkgs/issues/130963
|
||||
NIX_LDFLAGS = optionalString stdenv.isDarwin "-lc++abi";
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
cmakeFlags = [
|
||||
"-DTDESKTOP_API_TEST=ON"
|
||||
"-DDESKTOP_APP_QT6=OFF"
|
||||
];
|
||||
|
||||
installPhase = optionalString stdenv.isDarwin ''
|
||||
mkdir -p $out/Applications
|
||||
cp -r Kotatogram.app $out/Applications
|
||||
ln -s $out/Applications/Kotatogram.app/Contents/MacOS $out/bin
|
||||
'';
|
||||
|
||||
preFixup = ''
|
||||
binName=${if stdenv.isLinux then "kotatogram-desktop" else "Kotatogram"}
|
||||
remove-references-to -t ${stdenv.cc.cc} $out/bin/$binName
|
||||
remove-references-to -t ${microsoft_gsl} $out/bin/$binName
|
||||
remove-references-to -t ${tg_owt.dev} $out/bin/$binName
|
||||
'';
|
||||
|
||||
passthru = {
|
||||
inherit tg_owt;
|
||||
};
|
||||
|
||||
meta = {
|
||||
broken = (stdenv.isLinux && stdenv.isAarch64);
|
||||
description = "Kotatogram – experimental Telegram Desktop fork";
|
||||
longDescription = ''
|
||||
Unofficial desktop client for the Telegram messenger, based on Telegram Desktop.
|
||||
|
||||
It contains some useful (or purely cosmetic) features, but they could be unstable. A detailed list is available here: https://kotatogram.github.io/changes
|
||||
'';
|
||||
license = licenses.gpl3;
|
||||
platforms = platforms.all;
|
||||
homepage = "https://kotatogram.github.io";
|
||||
changelog = "https://github.com/kotatogram/kotatogram-desktop/releases/tag/k{version}";
|
||||
maintainers = with maintainers; [ ilya-fedin ];
|
||||
};
|
||||
}
|
||||
|
|
@ -0,0 +1,57 @@
|
|||
diff --git a/Telegram/SourceFiles/platform/linux/linux_wayland_integration.cpp b/Telegram/SourceFiles/platform/linux/linux_wayland_integration.cpp
|
||||
index 7641579aa..3c195e397 100644
|
||||
--- a/Telegram/SourceFiles/platform/linux/linux_wayland_integration.cpp
|
||||
+++ b/Telegram/SourceFiles/platform/linux/linux_wayland_integration.cpp
|
||||
@@ -9,10 +9,10 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
|
||||
#include "base/platform/base_platform_info.h"
|
||||
|
||||
-#include <connection_thread.h>
|
||||
-#include <registry.h>
|
||||
-#include <surface.h>
|
||||
-#include <plasmashell.h>
|
||||
+#include <KWayland/Client/connection_thread.h>
|
||||
+#include <KWayland/Client/registry.h>
|
||||
+#include <KWayland/Client/surface.h>
|
||||
+#include <KWayland/Client/plasmashell.h>
|
||||
|
||||
using namespace KWayland::Client;
|
||||
|
||||
Submodule Telegram/lib_base contains modified content
|
||||
diff --git a/Telegram/lib_base/base/platform/linux/base_linux_wayland_integration.cpp b/Telegram/lib_base/base/platform/linux/base_linux_wayland_integration.cpp
|
||||
index 32f0de6..30a087f 100644
|
||||
--- a/Telegram/lib_base/base/platform/linux/base_linux_wayland_integration.cpp
|
||||
+++ b/Telegram/lib_base/base/platform/linux/base_linux_wayland_integration.cpp
|
||||
@@ -13,11 +13,11 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#include <QtCore/QPointer>
|
||||
#include <QtGui/QWindow>
|
||||
|
||||
-#include <connection_thread.h>
|
||||
-#include <registry.h>
|
||||
-#include <surface.h>
|
||||
-#include <xdgforeign.h>
|
||||
-#include <idleinhibit.h>
|
||||
+#include <KWayland/Client/connection_thread.h>
|
||||
+#include <KWayland/Client/registry.h>
|
||||
+#include <KWayland/Client/surface.h>
|
||||
+#include <KWayland/Client/xdgforeign.h>
|
||||
+#include <KWayland/Client/idleinhibit.h>
|
||||
|
||||
using namespace KWayland::Client;
|
||||
|
||||
Submodule Telegram/lib_ui contains modified content
|
||||
diff --git a/Telegram/lib_ui/ui/platform/linux/ui_linux_wayland_integration.cpp b/Telegram/lib_ui/ui/platform/linux/ui_linux_wayland_integration.cpp
|
||||
index 01f1e80..163cb6a 100644
|
||||
--- a/Telegram/lib_ui/ui/platform/linux/ui_linux_wayland_integration.cpp
|
||||
+++ b/Telegram/lib_ui/ui/platform/linux/ui_linux_wayland_integration.cpp
|
||||
@@ -24,8 +24,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#include <private/qwaylandwindow_p.h>
|
||||
#include <private/qwaylandshellsurface_p.h>
|
||||
|
||||
-#include <connection_thread.h>
|
||||
-#include <registry.h>
|
||||
+#include <KWayland/Client/connection_thread.h>
|
||||
+#include <KWayland/Client/registry.h>
|
||||
|
||||
Q_DECLARE_METATYPE(QMargins);
|
||||
|
||||
|
|
@ -0,0 +1,424 @@
|
|||
diff --git a/Telegram/SourceFiles/platform/mac/file_bookmark_mac.mm b/Telegram/SourceFiles/platform/mac/file_bookmark_mac.mm
|
||||
index 9e9a1744b..ae55f873f 100644
|
||||
--- a/Telegram/SourceFiles/platform/mac/file_bookmark_mac.mm
|
||||
+++ b/Telegram/SourceFiles/platform/mac/file_bookmark_mac.mm
|
||||
@@ -14,6 +14,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
|
||||
#include <Cocoa/Cocoa.h>
|
||||
#include <CoreFoundation/CFURL.h>
|
||||
+#undef check
|
||||
|
||||
namespace Platform {
|
||||
namespace {
|
||||
diff --git a/Telegram/SourceFiles/platform/mac/specific_mac.mm b/Telegram/SourceFiles/platform/mac/specific_mac.mm
|
||||
index 1d68457bb..ac8c4e0ab 100644
|
||||
--- a/Telegram/SourceFiles/platform/mac/specific_mac.mm
|
||||
+++ b/Telegram/SourceFiles/platform/mac/specific_mac.mm
|
||||
@@ -118,6 +118,7 @@ PermissionStatus GetPermissionStatus(PermissionType type) {
|
||||
switch (type) {
|
||||
case PermissionType::Microphone:
|
||||
case PermissionType::Camera:
|
||||
+#if 0
|
||||
const auto nativeType = (type == PermissionType::Microphone)
|
||||
? AVMediaTypeAudio
|
||||
: AVMediaTypeVideo;
|
||||
@@ -132,6 +133,7 @@ PermissionStatus GetPermissionStatus(PermissionType type) {
|
||||
return PermissionStatus::Denied;
|
||||
}
|
||||
}
|
||||
+#endif
|
||||
break;
|
||||
}
|
||||
return PermissionStatus::Granted;
|
||||
@@ -141,6 +143,7 @@ void RequestPermission(PermissionType type, Fn<void(PermissionStatus)> resultCal
|
||||
switch (type) {
|
||||
case PermissionType::Microphone:
|
||||
case PermissionType::Camera:
|
||||
+#if 0
|
||||
const auto nativeType = (type == PermissionType::Microphone)
|
||||
? AVMediaTypeAudio
|
||||
: AVMediaTypeVideo;
|
||||
@@ -151,6 +154,7 @@ void RequestPermission(PermissionType type, Fn<void(PermissionStatus)> resultCal
|
||||
});
|
||||
}];
|
||||
}
|
||||
+#endif
|
||||
break;
|
||||
}
|
||||
resultCallback(PermissionStatus::Granted);
|
||||
diff --git a/Telegram/SourceFiles/platform/mac/touchbar/items/mac_formatter_item.h b/Telegram/SourceFiles/platform/mac/touchbar/items/mac_formatter_item.h
|
||||
index a537929c8..82ef2b837 100644
|
||||
--- a/Telegram/SourceFiles/platform/mac/touchbar/items/mac_formatter_item.h
|
||||
+++ b/Telegram/SourceFiles/platform/mac/touchbar/items/mac_formatter_item.h
|
||||
@@ -9,8 +9,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
|
||||
#import <AppKit/NSPopoverTouchBarItem.h>
|
||||
#import <AppKit/NSTouchBar.h>
|
||||
+#undef check
|
||||
|
||||
-API_AVAILABLE(macos(10.12.2))
|
||||
@interface TextFormatPopover : NSPopoverTouchBarItem
|
||||
- (id)init:(NSTouchBarItemIdentifier)identifier;
|
||||
@end
|
||||
diff --git a/Telegram/SourceFiles/platform/mac/touchbar/items/mac_pinned_chats_item.h b/Telegram/SourceFiles/platform/mac/touchbar/items/mac_pinned_chats_item.h
|
||||
index c6a4b886f..d2e0936c0 100644
|
||||
--- a/Telegram/SourceFiles/platform/mac/touchbar/items/mac_pinned_chats_item.h
|
||||
+++ b/Telegram/SourceFiles/platform/mac/touchbar/items/mac_pinned_chats_item.h
|
||||
@@ -8,12 +8,12 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#pragma once
|
||||
|
||||
#include <AppKit/NSImageView.h>
|
||||
+#undef check
|
||||
|
||||
namespace Main {
|
||||
class Session;
|
||||
} // namespace Main
|
||||
|
||||
-API_AVAILABLE(macos(10.12.2))
|
||||
@interface PinnedDialogsPanel : NSImageView
|
||||
- (id)init:(not_null<Main::Session*>)session
|
||||
destroyEvent:(rpl::producer<>)touchBarSwitches;
|
||||
diff --git a/Telegram/SourceFiles/platform/mac/touchbar/items/mac_scrubber_item.h b/Telegram/SourceFiles/platform/mac/touchbar/items/mac_scrubber_item.h
|
||||
index 27b04467c..b1a7dfbd9 100644
|
||||
--- a/Telegram/SourceFiles/platform/mac/touchbar/items/mac_scrubber_item.h
|
||||
+++ b/Telegram/SourceFiles/platform/mac/touchbar/items/mac_scrubber_item.h
|
||||
@@ -9,12 +9,12 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
|
||||
#import <AppKit/NSPopoverTouchBarItem.h>
|
||||
#import <AppKit/NSTouchBar.h>
|
||||
+#undef check
|
||||
|
||||
namespace Window {
|
||||
class Controller;
|
||||
} // namespace Window
|
||||
|
||||
-API_AVAILABLE(macos(10.12.2))
|
||||
@interface StickerEmojiPopover : NSPopoverTouchBarItem<NSTouchBarDelegate>
|
||||
- (id)init:(not_null<Window::Controller*>)controller
|
||||
identifier:(NSTouchBarItemIdentifier)identifier;
|
||||
diff --git a/Telegram/SourceFiles/platform/mac/touchbar/mac_touchbar_audio.h b/Telegram/SourceFiles/platform/mac/touchbar/mac_touchbar_audio.h
|
||||
index ec4596c67..972461aef 100644
|
||||
--- a/Telegram/SourceFiles/platform/mac/touchbar/mac_touchbar_audio.h
|
||||
+++ b/Telegram/SourceFiles/platform/mac/touchbar/mac_touchbar_audio.h
|
||||
@@ -8,8 +8,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#pragma once
|
||||
|
||||
#import <AppKit/NSTouchBar.h>
|
||||
+#undef check
|
||||
|
||||
-API_AVAILABLE(macos(10.12.2))
|
||||
@interface TouchBarAudioPlayer : NSTouchBar<NSTouchBarDelegate>
|
||||
- (rpl::producer<>)closeRequests;
|
||||
@end
|
||||
diff --git a/Telegram/SourceFiles/platform/mac/touchbar/mac_touchbar_common.h b/Telegram/SourceFiles/platform/mac/touchbar/mac_touchbar_common.h
|
||||
index 52b54de12..ac3857f9b 100644
|
||||
--- a/Telegram/SourceFiles/platform/mac/touchbar/mac_touchbar_common.h
|
||||
+++ b/Telegram/SourceFiles/platform/mac/touchbar/mac_touchbar_common.h
|
||||
@@ -9,6 +9,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
|
||||
#import <AppKit/NSImage.h>
|
||||
#import <Foundation/Foundation.h>
|
||||
+#undef check
|
||||
|
||||
namespace TouchBar {
|
||||
|
||||
diff --git a/Telegram/SourceFiles/platform/mac/touchbar/mac_touchbar_controls.h b/Telegram/SourceFiles/platform/mac/touchbar/mac_touchbar_controls.h
|
||||
index 1cc8c832f..c2178c975 100644
|
||||
--- a/Telegram/SourceFiles/platform/mac/touchbar/mac_touchbar_controls.h
|
||||
+++ b/Telegram/SourceFiles/platform/mac/touchbar/mac_touchbar_controls.h
|
||||
@@ -20,19 +20,19 @@ struct TrackState;
|
||||
|
||||
namespace TouchBar {
|
||||
|
||||
-[[nodiscard]] API_AVAILABLE(macos(10.12.2))
|
||||
+[[nodiscard]]
|
||||
NSButton *CreateTouchBarButton(
|
||||
NSImage *image,
|
||||
rpl::lifetime &lifetime,
|
||||
Fn<void()> callback);
|
||||
|
||||
-[[nodiscard]] API_AVAILABLE(macos(10.12.2))
|
||||
+[[nodiscard]]
|
||||
NSButton *CreateTouchBarButton(
|
||||
const style::icon &icon,
|
||||
rpl::lifetime &lifetime,
|
||||
Fn<void()> callback);
|
||||
|
||||
-[[nodiscard]] API_AVAILABLE(macos(10.12.2))
|
||||
+[[nodiscard]]
|
||||
NSButton *CreateTouchBarButtonWithTwoStates(
|
||||
NSImage *icon1,
|
||||
NSImage *icon2,
|
||||
@@ -41,7 +41,7 @@ NSButton *CreateTouchBarButtonWithTwoStates(
|
||||
bool firstState,
|
||||
rpl::producer<bool> stateChanged = rpl::never<bool>());
|
||||
|
||||
-[[nodiscard]] API_AVAILABLE(macos(10.12.2))
|
||||
+[[nodiscard]]
|
||||
NSButton *CreateTouchBarButtonWithTwoStates(
|
||||
const style::icon &icon1,
|
||||
const style::icon &icon2,
|
||||
@@ -50,14 +50,14 @@ NSButton *CreateTouchBarButtonWithTwoStates(
|
||||
bool firstState,
|
||||
rpl::producer<bool> stateChanged = rpl::never<bool>());
|
||||
|
||||
-[[nodiscard]] API_AVAILABLE(macos(10.12.2))
|
||||
+[[nodiscard]]
|
||||
NSSliderTouchBarItem *CreateTouchBarSlider(
|
||||
NSString *itemId,
|
||||
rpl::lifetime &lifetime,
|
||||
Fn<void(bool, double, double)> callback,
|
||||
rpl::producer<Media::Player::TrackState> stateChanged);
|
||||
|
||||
-[[nodiscard]] API_AVAILABLE(macos(10.12.2))
|
||||
+[[nodiscard]]
|
||||
NSCustomTouchBarItem *CreateTouchBarTrackPosition(
|
||||
NSString *itemId,
|
||||
rpl::producer<Media::Player::TrackState> stateChanged);
|
||||
diff --git a/Telegram/SourceFiles/platform/mac/touchbar/mac_touchbar_main.h b/Telegram/SourceFiles/platform/mac/touchbar/mac_touchbar_main.h
|
||||
index f03546eaf..bc8c63678 100644
|
||||
--- a/Telegram/SourceFiles/platform/mac/touchbar/mac_touchbar_main.h
|
||||
+++ b/Telegram/SourceFiles/platform/mac/touchbar/mac_touchbar_main.h
|
||||
@@ -8,6 +8,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#pragma once
|
||||
|
||||
#import <AppKit/NSTouchBar.h>
|
||||
+#undef check
|
||||
|
||||
namespace Window {
|
||||
class Controller;
|
||||
@@ -21,7 +22,6 @@ const auto kPopoverPickerItemIdentifier = @"pickerButtons";
|
||||
|
||||
} // namespace TouchBar::Main
|
||||
|
||||
-API_AVAILABLE(macos(10.12.2))
|
||||
@interface TouchBarMain : NSTouchBar
|
||||
- (id)init:(not_null<Window::Controller*>)controller
|
||||
touchBarSwitches:(rpl::producer<>)touchBarSwitches;
|
||||
diff --git a/Telegram/SourceFiles/platform/mac/touchbar/mac_touchbar_manager.h b/Telegram/SourceFiles/platform/mac/touchbar/mac_touchbar_manager.h
|
||||
index 464f87c9c..9a008c75e 100644
|
||||
--- a/Telegram/SourceFiles/platform/mac/touchbar/mac_touchbar_manager.h
|
||||
+++ b/Telegram/SourceFiles/platform/mac/touchbar/mac_touchbar_manager.h
|
||||
@@ -8,6 +8,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#pragma once
|
||||
|
||||
#import <AppKit/NSTouchBar.h>
|
||||
+#undef check
|
||||
|
||||
namespace Main {
|
||||
class Domain;
|
||||
@@ -17,7 +18,6 @@ namespace Window {
|
||||
class Controller;
|
||||
} // namespace Window
|
||||
|
||||
-API_AVAILABLE(macos(10.12.2))
|
||||
@interface RootTouchBar : NSTouchBar<NSTouchBarDelegate>
|
||||
- (id)init:(rpl::producer<bool>)canApplyMarkdown
|
||||
controller:(not_null<Window::Controller*>)controller
|
||||
Submodule Telegram/ThirdParty/tgcalls contains modified content
|
||||
diff --git a/Telegram/ThirdParty/tgcalls/tgcalls/platform/darwin/TGRTCDefaultVideoDecoderFactory.mm b/Telegram/ThirdParty/tgcalls/tgcalls/platform/darwin/TGRTCDefaultVideoDecoderFactory.mm
|
||||
index b280c1b..a1ed0d2 100644
|
||||
--- a/Telegram/ThirdParty/tgcalls/tgcalls/platform/darwin/TGRTCDefaultVideoDecoderFactory.mm
|
||||
+++ b/Telegram/ThirdParty/tgcalls/tgcalls/platform/darwin/TGRTCDefaultVideoDecoderFactory.mm
|
||||
@@ -71,7 +71,7 @@
|
||||
if (@available(iOS 11.0, *)) {
|
||||
[result addObject:h265Info];
|
||||
}
|
||||
-#else // WEBRTC_IOS
|
||||
+#elif 0 // WEBRTC_IOS
|
||||
if (@available(macOS 10.13, *)) {
|
||||
[result addObject:h265Info];
|
||||
}
|
||||
@@ -101,7 +101,7 @@
|
||||
return [[TGRTCVideoDecoderH265 alloc] init];
|
||||
}
|
||||
}
|
||||
-#else // WEBRTC_IOS
|
||||
+#elif 0 // WEBRTC_IOS
|
||||
if (@available(macOS 10.13, *)) {
|
||||
if ([info.name isEqualToString:kRTCVideoCodecH265Name]) {
|
||||
return [[TGRTCVideoDecoderH265 alloc] init];
|
||||
diff --git a/Telegram/ThirdParty/tgcalls/tgcalls/platform/darwin/TGRTCDefaultVideoEncoderFactory.mm b/Telegram/ThirdParty/tgcalls/tgcalls/platform/darwin/TGRTCDefaultVideoEncoderFactory.mm
|
||||
index 9960607..f3659b3 100644
|
||||
--- a/Telegram/ThirdParty/tgcalls/tgcalls/platform/darwin/TGRTCDefaultVideoEncoderFactory.mm
|
||||
+++ b/Telegram/ThirdParty/tgcalls/tgcalls/platform/darwin/TGRTCDefaultVideoEncoderFactory.mm
|
||||
@@ -89,7 +89,7 @@
|
||||
[result addObject:h265Info];
|
||||
}
|
||||
}
|
||||
-#else // WEBRTC_IOS
|
||||
+#elif 0 // WEBRTC_IOS
|
||||
if (@available(macOS 10.13, *)) {
|
||||
if ([[AVAssetExportSession allExportPresets] containsObject:AVAssetExportPresetHEVCHighestQuality]) {
|
||||
[result addObject:h265Info];
|
||||
@@ -129,7 +129,7 @@
|
||||
return [[TGRTCVideoEncoderH265 alloc] initWithCodecInfo:info];
|
||||
}
|
||||
}
|
||||
-#else // WEBRTC_IOS
|
||||
+#elif 0 // WEBRTC_IOS
|
||||
if (@available(macOS 10.13, *)) {
|
||||
if ([info.name isEqualToString:kRTCVideoCodecH265Name]) {
|
||||
return [[TGRTCVideoEncoderH265 alloc] initWithCodecInfo:info];
|
||||
diff --git a/Telegram/ThirdParty/tgcalls/tgcalls/platform/darwin/VideoCameraCapturerMac.mm b/Telegram/ThirdParty/tgcalls/tgcalls/platform/darwin/VideoCameraCapturerMac.mm
|
||||
index bf99063..b717645 100644
|
||||
--- a/Telegram/ThirdParty/tgcalls/tgcalls/platform/darwin/VideoCameraCapturerMac.mm
|
||||
+++ b/Telegram/ThirdParty/tgcalls/tgcalls/platform/darwin/VideoCameraCapturerMac.mm
|
||||
@@ -507,8 +507,7 @@ static tgcalls::DarwinVideoTrackSource *getObjCVideoSource(const rtc::scoped_ref
|
||||
- (void)captureOutput:(AVCaptureOutput *)captureOutput
|
||||
didDropSampleBuffer:(CMSampleBufferRef)sampleBuffer
|
||||
fromConnection:(AVCaptureConnection *)connection {
|
||||
- NSString *droppedReason =
|
||||
- (__bridge NSString *)CMGetAttachment(sampleBuffer, kCMSampleBufferAttachmentKey_DroppedFrameReason, nil);
|
||||
+ NSString *droppedReason = nil;
|
||||
RTCLogError(@"Dropped sample buffer. Reason: %@", droppedReason);
|
||||
}
|
||||
|
||||
@@ -682,7 +681,7 @@ static tgcalls::DarwinVideoTrackSource *getObjCVideoSource(const rtc::scoped_ref
|
||||
int closest = -1;
|
||||
CMTime result;
|
||||
for (int i = 0; i < format.videoSupportedFrameRateRanges.count; i++) {
|
||||
- const auto rateRange = format.videoSupportedFrameRateRanges[i];
|
||||
+ const AVFrameRateRange *rateRange = format.videoSupportedFrameRateRanges[i];
|
||||
int gap = abs(rateRange.minFrameRate - target);
|
||||
if (gap <= closest || closest == -1) {
|
||||
closest = gap;
|
||||
diff --git a/Telegram/ThirdParty/tgcalls/tgcalls/platform/darwin/VideoMetalViewMac.mm b/Telegram/ThirdParty/tgcalls/tgcalls/platform/darwin/VideoMetalViewMac.mm
|
||||
index 4ef8630..3fc753c 100644
|
||||
--- a/Telegram/ThirdParty/tgcalls/tgcalls/platform/darwin/VideoMetalViewMac.mm
|
||||
+++ b/Telegram/ThirdParty/tgcalls/tgcalls/platform/darwin/VideoMetalViewMac.mm
|
||||
@@ -243,9 +243,11 @@ private:
|
||||
layer.framebufferOnly = true;
|
||||
layer.opaque = false;
|
||||
// layer.cornerRadius = 4;
|
||||
+#if 0
|
||||
if (@available(macOS 10.13, *)) {
|
||||
layer.displaySyncEnabled = NO;
|
||||
}
|
||||
+#endif
|
||||
// layer.presentsWithTransaction = YES;
|
||||
layer.backgroundColor = [NSColor clearColor].CGColor;
|
||||
layer.contentsGravity = kCAGravityResizeAspectFill;
|
||||
@@ -332,9 +334,7 @@ private:
|
||||
- (RTCVideoRotation)rtcFrameRotation {
|
||||
if (_rotationOverride) {
|
||||
RTCVideoRotation rotation;
|
||||
- if (@available(macOS 10.13, *)) {
|
||||
- [_rotationOverride getValue:&rotation size:sizeof(rotation)];
|
||||
- } else {
|
||||
+ {
|
||||
[_rotationOverride getValue:&rotation];
|
||||
}
|
||||
return rotation;
|
||||
Submodule Telegram/lib_base contains modified content
|
||||
diff --git a/Telegram/lib_base/base/platform/mac/base_global_shortcuts_mac.mm b/Telegram/lib_base/base/platform/mac/base_global_shortcuts_mac.mm
|
||||
index 5491702..32befc6 100644
|
||||
--- a/Telegram/lib_base/base/platform/mac/base_global_shortcuts_mac.mm
|
||||
+++ b/Telegram/lib_base/base/platform/mac/base_global_shortcuts_mac.mm
|
||||
@@ -128,6 +128,7 @@ bool Available() {
|
||||
}
|
||||
|
||||
bool Allowed() {
|
||||
+#if 0
|
||||
if (@available(macOS 10.15, *)) {
|
||||
// Input Monitoring is required on macOS 10.15 an later.
|
||||
// Even if user grants access, restart is required.
|
||||
@@ -141,6 +142,7 @@ bool Allowed() {
|
||||
return AXIsProcessTrustedWithOptions(
|
||||
(__bridge CFDictionaryRef)options);
|
||||
}
|
||||
+#endif
|
||||
return true;
|
||||
}
|
||||
|
||||
diff --git a/Telegram/lib_base/base/platform/mac/base_info_mac.mm b/Telegram/lib_base/base/platform/mac/base_info_mac.mm
|
||||
index f1f259a..6629eb6 100644
|
||||
--- a/Telegram/lib_base/base/platform/mac/base_info_mac.mm
|
||||
+++ b/Telegram/lib_base/base/platform/mac/base_info_mac.mm
|
||||
@@ -226,16 +226,20 @@ void Finish() {
|
||||
}
|
||||
|
||||
void OpenInputMonitoringPrivacySettings() {
|
||||
+#if 0
|
||||
if (@available(macOS 10.15, *)) {
|
||||
IOHIDRequestAccess(kIOHIDRequestTypeListenEvent);
|
||||
}
|
||||
+#endif
|
||||
[[NSWorkspace sharedWorkspace] openURL:PrivacySettingsUrl("Privacy_ListenEvent")];
|
||||
}
|
||||
|
||||
void OpenDesktopCapturePrivacySettings() {
|
||||
+#if 0
|
||||
if (@available(macOS 11.0, *)) {
|
||||
CGRequestScreenCaptureAccess();
|
||||
}
|
||||
+#endif
|
||||
[[NSWorkspace sharedWorkspace] openURL:PrivacySettingsUrl("Privacy_ScreenCapture")];
|
||||
}
|
||||
|
||||
diff --git a/Telegram/lib_base/base/platform/mac/base_system_media_controls_mac.mm b/Telegram/lib_base/base/platform/mac/base_system_media_controls_mac.mm
|
||||
index 6102705..8981239 100644
|
||||
--- a/Telegram/lib_base/base/platform/mac/base_system_media_controls_mac.mm
|
||||
+++ b/Telegram/lib_base/base/platform/mac/base_system_media_controls_mac.mm
|
||||
@@ -277,6 +277,7 @@ void SystemMediaControls::setThumbnail(const QImage &thumbnail) {
|
||||
if (thumbnail.isNull()) {
|
||||
return;
|
||||
}
|
||||
+#if 0
|
||||
if (@available(macOS 10.13.2, *)) {
|
||||
const auto copy = thumbnail;
|
||||
[_private->info
|
||||
@@ -290,6 +291,7 @@ void SystemMediaControls::setThumbnail(const QImage &thumbnail) {
|
||||
forKey:MPMediaItemPropertyArtwork];
|
||||
updateDisplay();
|
||||
}
|
||||
+#endif
|
||||
}
|
||||
|
||||
void SystemMediaControls::setDuration(int duration) {
|
||||
@@ -308,10 +310,12 @@ void SystemMediaControls::setVolume(float64 volume) {
|
||||
}
|
||||
|
||||
void SystemMediaControls::clearThumbnail() {
|
||||
+#if 0
|
||||
if (@available(macOS 10.13.2, *)) {
|
||||
[_private->info removeObjectForKey:MPMediaItemPropertyArtwork];
|
||||
updateDisplay();
|
||||
}
|
||||
+#endif
|
||||
}
|
||||
|
||||
void SystemMediaControls::clearMetadata() {
|
||||
@@ -373,9 +377,11 @@ bool SystemMediaControls::volumeSupported() const {
|
||||
}
|
||||
|
||||
bool SystemMediaControls::Supported() {
|
||||
+#if 0
|
||||
if (@available(macOS 10.12.2, *)) {
|
||||
return true;
|
||||
}
|
||||
+#endif
|
||||
return false;
|
||||
}
|
||||
|
||||
Submodule Telegram/lib_webrtc contains modified content
|
||||
diff --git a/Telegram/lib_webrtc/webrtc/mac/webrtc_media_devices_mac.mm b/Telegram/lib_webrtc/webrtc/mac/webrtc_media_devices_mac.mm
|
||||
index 21e93f7..10a3890 100644
|
||||
--- a/Telegram/lib_webrtc/webrtc/mac/webrtc_media_devices_mac.mm
|
||||
+++ b/Telegram/lib_webrtc/webrtc/mac/webrtc_media_devices_mac.mm
|
||||
@@ -397,6 +397,7 @@ void MacMediaDevices::videoInputRefreshed() {
|
||||
}
|
||||
|
||||
bool MacDesktopCaptureAllowed() {
|
||||
+#if 0
|
||||
if (@available(macOS 11.0, *)) {
|
||||
// Screen Recording is required on macOS 10.15 an later.
|
||||
// Even if user grants access, restart is required.
|
||||
@@ -421,6 +422,7 @@ bool MacDesktopCaptureAllowed() {
|
||||
CFRelease(stream);
|
||||
return true;
|
||||
}
|
||||
+#endif
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
diff --git a/Telegram/SourceFiles/core/application.cpp b/Telegram/SourceFiles/core/application.cpp
|
||||
index 2a092c6ea..de46dd269 100644
|
||||
--- a/Telegram/SourceFiles/core/application.cpp
|
||||
+++ b/Telegram/SourceFiles/core/application.cpp
|
||||
@@ -1173,7 +1173,7 @@ void Application::startShortcuts() {
|
||||
|
||||
void Application::RegisterUrlScheme() {
|
||||
base::Platform::RegisterUrlScheme(base::Platform::UrlSchemeDescriptor{
|
||||
- .executable = cExeDir() + cExeName(),
|
||||
+ .executable = qsl("kotatogram-desktop"),
|
||||
.arguments = qsl("-workdir \"%1\"").arg(cWorkingDir()),
|
||||
.protocol = qsl("tg"),
|
||||
.protocolName = qsl("Telegram Link"),
|
||||
diff --git a/Telegram/SourceFiles/platform/linux/specific_linux.cpp b/Telegram/SourceFiles/platform/linux/specific_linux.cpp
|
||||
index 26168baa7..00d2525a0 100644
|
||||
--- a/Telegram/SourceFiles/platform/linux/specific_linux.cpp
|
||||
+++ b/Telegram/SourceFiles/platform/linux/specific_linux.cpp
|
||||
@@ -303,19 +303,11 @@ bool GenerateDesktopFile(
|
||||
|
||||
QFile target(targetFile);
|
||||
if (target.open(QIODevice::WriteOnly)) {
|
||||
- fileText = fileText.replace(
|
||||
- QRegularExpression(
|
||||
- qsl("^TryExec=.*$"),
|
||||
- QRegularExpression::MultilineOption),
|
||||
- qsl("TryExec=%1").arg(
|
||||
- QString(cExeDir() + cExeName()).replace('\\', "\\\\")));
|
||||
-
|
||||
fileText = fileText.replace(
|
||||
QRegularExpression(
|
||||
qsl("^Exec=kotatogram-desktop(.*)$"),
|
||||
QRegularExpression::MultilineOption),
|
||||
- qsl("Exec=%1 -workdir %2\\1").arg(
|
||||
- EscapeShellInLauncher(cExeDir() + cExeName()),
|
||||
+ qsl("Exec=kotatogram-desktop -workdir %1\\1").arg(
|
||||
EscapeShellInLauncher(cWorkingDir())));
|
||||
|
||||
fileText = fileText.replace(
|
||||
|
|
@ -0,0 +1,68 @@
|
|||
diff --git a/src/rtc_base/async_resolver.cc b/src/rtc_base/async_resolver.cc
|
||||
index ad1598f2..fe9c3832 100644
|
||||
--- a/src/rtc_base/async_resolver.cc
|
||||
+++ b/src/rtc_base/async_resolver.cc
|
||||
@@ -57,7 +57,7 @@ void GlobalGcdRunTask(void* context) {
|
||||
|
||||
// Post a task into the system-defined global concurrent queue.
|
||||
void PostTaskToGlobalQueue(std::unique_ptr<webrtc::QueuedTask> task) {
|
||||
- dispatch_queue_global_t global_queue =
|
||||
+ dispatch_queue_t global_queue =
|
||||
dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0);
|
||||
webrtc::QueuedTask* context = task.release();
|
||||
dispatch_async_f(global_queue, context, &GlobalGcdRunTask);
|
||||
diff --git a/src/rtc_base/system/gcd_helpers.m b/src/rtc_base/system/gcd_helpers.m
|
||||
index fd9a361f..3a63be6d 100644
|
||||
--- a/src/rtc_base/system/gcd_helpers.m
|
||||
+++ b/src/rtc_base/system/gcd_helpers.m
|
||||
@@ -13,9 +13,6 @@
|
||||
dispatch_queue_t RTCDispatchQueueCreateWithTarget(const char *label,
|
||||
dispatch_queue_attr_t attr,
|
||||
dispatch_queue_t target) {
|
||||
- if (@available(iOS 10, macOS 10.12, tvOS 10, watchOS 3, *)) {
|
||||
- return dispatch_queue_create_with_target(label, attr, target);
|
||||
- }
|
||||
dispatch_queue_t queue = dispatch_queue_create(label, attr);
|
||||
dispatch_set_target_queue(queue, target);
|
||||
return queue;
|
||||
diff --git a/src/sdk/objc/components/video_codec/nalu_rewriter.cc b/src/sdk/objc/components/video_codec/nalu_rewriter.cc
|
||||
index 1121c921..f21926b0 100644
|
||||
--- a/src/sdk/objc/components/video_codec/nalu_rewriter.cc
|
||||
+++ b/src/sdk/objc/components/video_codec/nalu_rewriter.cc
|
||||
@@ -242,10 +242,7 @@ bool H265CMSampleBufferToAnnexBBuffer(
|
||||
int nalu_header_size = 0;
|
||||
size_t param_set_count = 0;
|
||||
OSStatus status = noErr;
|
||||
- if (__builtin_available(macOS 10.13, *)) {
|
||||
- status = CMVideoFormatDescriptionGetHEVCParameterSetAtIndex(
|
||||
- description, 0, nullptr, nullptr, ¶m_set_count, &nalu_header_size);
|
||||
- } else {
|
||||
+ {
|
||||
RTC_LOG(LS_ERROR) << "Not supported.";
|
||||
return false;
|
||||
}
|
||||
@@ -268,10 +265,7 @@ bool H265CMSampleBufferToAnnexBBuffer(
|
||||
size_t param_set_size = 0;
|
||||
const uint8_t* param_set = nullptr;
|
||||
for (size_t i = 0; i < param_set_count; ++i) {
|
||||
- if (__builtin_available(macOS 10.13, *)) {
|
||||
- status = CMVideoFormatDescriptionGetHEVCParameterSetAtIndex(
|
||||
- description, i, ¶m_set, ¶m_set_size, nullptr, nullptr);
|
||||
- } else {
|
||||
+ {
|
||||
RTC_LOG(LS_ERROR) << "Not supported.";
|
||||
return false;
|
||||
}
|
||||
@@ -501,11 +495,7 @@ CMVideoFormatDescriptionRef CreateH265VideoFormatDescription(
|
||||
// Parse the SPS and PPS into a CMVideoFormatDescription.
|
||||
CMVideoFormatDescriptionRef description = nullptr;
|
||||
OSStatus status = noErr;
|
||||
- if (__builtin_available(macOS 10.13, *)) {
|
||||
- status = CMVideoFormatDescriptionCreateFromHEVCParameterSets(
|
||||
- kCFAllocatorDefault, 3, param_set_ptrs, param_set_sizes, 4, nullptr,
|
||||
- &description);
|
||||
- } else {
|
||||
+ {
|
||||
RTC_LOG(LS_ERROR) << "Not supported.";
|
||||
return nullptr;
|
||||
}
|
||||
|
|
@ -0,0 +1,132 @@
|
|||
{ lib
|
||||
, stdenv
|
||||
, fetchFromGitHub
|
||||
, pkg-config
|
||||
, cmake
|
||||
, ninja
|
||||
, yasm
|
||||
, libjpeg
|
||||
, openssl
|
||||
, libopus
|
||||
, ffmpeg_4
|
||||
, protobuf
|
||||
, openh264
|
||||
, usrsctp
|
||||
, libvpx
|
||||
, libX11
|
||||
, libXtst
|
||||
, libXcomposite
|
||||
, libXdamage
|
||||
, libXext
|
||||
, libXrender
|
||||
, libXrandr
|
||||
, libXi
|
||||
, glib
|
||||
, abseil-cpp
|
||||
, pipewire
|
||||
, mesa
|
||||
, libdrm
|
||||
, libGL
|
||||
, Cocoa
|
||||
, AppKit
|
||||
, IOKit
|
||||
, IOSurface
|
||||
, Foundation
|
||||
, AVFoundation
|
||||
, CoreMedia
|
||||
, VideoToolbox
|
||||
, CoreGraphics
|
||||
, CoreVideo
|
||||
, OpenGL
|
||||
, Metal
|
||||
, MetalKit
|
||||
, CoreFoundation
|
||||
, ApplicationServices
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation {
|
||||
pname = "tg_owt";
|
||||
version = "unstable-2022-04-13";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "desktop-app";
|
||||
repo = "tg_owt";
|
||||
rev = "63a934db1ed212ebf8aaaa20f0010dd7b0d7b396";
|
||||
sha256 = "sha256-WddSsQ9KW1zYyYckzdUOvfFZArYAbyvXmABQNMtK6cM=";
|
||||
fetchSubmodules = true;
|
||||
};
|
||||
|
||||
patches = [
|
||||
# let it build with nixpkgs 10.12 sdk
|
||||
./tg_owt-10.12-sdk.patch
|
||||
];
|
||||
|
||||
postPatch = lib.optionalString stdenv.isLinux ''
|
||||
substituteInPlace src/modules/desktop_capture/linux/egl_dmabuf.cc \
|
||||
--replace '"libEGL.so.1"' '"${libGL}/lib/libEGL.so.1"' \
|
||||
--replace '"libGL.so.1"' '"${libGL}/lib/libGL.so.1"' \
|
||||
--replace '"libgbm.so.1"' '"${mesa}/lib/libgbm.so.1"' \
|
||||
--replace '"libdrm.so.2"' '"${libdrm}/lib/libdrm.so.2"'
|
||||
'';
|
||||
|
||||
outputs = [ "out" "dev" ];
|
||||
|
||||
nativeBuildInputs = [ pkg-config cmake ninja yasm ];
|
||||
|
||||
buildInputs = [
|
||||
libjpeg
|
||||
openssl
|
||||
libopus
|
||||
ffmpeg_4
|
||||
protobuf
|
||||
openh264
|
||||
usrsctp
|
||||
libvpx
|
||||
abseil-cpp
|
||||
] ++ lib.optionals stdenv.isLinux [
|
||||
libX11
|
||||
libXtst
|
||||
libXcomposite
|
||||
libXdamage
|
||||
libXext
|
||||
libXrender
|
||||
libXrandr
|
||||
libXi
|
||||
glib
|
||||
pipewire
|
||||
mesa
|
||||
libdrm
|
||||
libGL
|
||||
] ++ lib.optionals stdenv.isDarwin [
|
||||
Cocoa
|
||||
AppKit
|
||||
IOKit
|
||||
IOSurface
|
||||
Foundation
|
||||
AVFoundation
|
||||
CoreMedia
|
||||
VideoToolbox
|
||||
CoreGraphics
|
||||
CoreVideo
|
||||
OpenGL
|
||||
Metal
|
||||
MetalKit
|
||||
CoreFoundation
|
||||
ApplicationServices
|
||||
];
|
||||
|
||||
# https://github.com/NixOS/nixpkgs/issues/130963
|
||||
NIX_LDFLAGS = lib.optionalString stdenv.isDarwin "-lc++abi";
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
propagatedBuildInputs = [
|
||||
# Required for linking downstream binaries.
|
||||
abseil-cpp
|
||||
openh264
|
||||
usrsctp
|
||||
libvpx
|
||||
];
|
||||
|
||||
meta.license = lib.licenses.bsd3;
|
||||
}
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
{ stdenv, lib, kotatogram-desktop, glib-networking, webkitgtk, makeWrapper }:
|
||||
|
||||
with lib;
|
||||
|
||||
stdenv.mkDerivation {
|
||||
pname = "${kotatogram-desktop.pname}-with-webkit";
|
||||
version = kotatogram-desktop.version;
|
||||
nativeBuildInputs = [ makeWrapper ];
|
||||
dontUnpack = true;
|
||||
installPhase = ''
|
||||
mkdir -p $out
|
||||
cp -r ${kotatogram-desktop}/share $out
|
||||
'';
|
||||
postFixup = ''
|
||||
mkdir -p $out/bin
|
||||
makeWrapper ${kotatogram-desktop}/bin/kotatogram-desktop $out/bin/kotatogram-desktop \
|
||||
--prefix GIO_EXTRA_MODULES : ${glib-networking}/lib/gio/modules \
|
||||
--prefix LD_LIBRARY_PATH : ${makeLibraryPath [ webkitgtk ]}
|
||||
'';
|
||||
meta = kotatogram-desktop.meta // {
|
||||
platforms = platforms.linux;
|
||||
};
|
||||
}
|
||||
|
|
@ -0,0 +1,195 @@
|
|||
{ lib
|
||||
, fetchFromGitHub
|
||||
, callPackage
|
||||
, pkg-config
|
||||
, cmake
|
||||
, ninja
|
||||
, python3
|
||||
, wrapGAppsHook
|
||||
, wrapQtAppsHook
|
||||
, extra-cmake-modules
|
||||
, qtbase
|
||||
, qtwayland
|
||||
, qtsvg
|
||||
, qtimageformats
|
||||
, qt5compat
|
||||
, gtk3
|
||||
, libdbusmenu
|
||||
, lz4
|
||||
, xxHash
|
||||
, ffmpeg
|
||||
, openalSoft
|
||||
, minizip
|
||||
, libopus
|
||||
, alsa-lib
|
||||
, libpulseaudio
|
||||
, range-v3
|
||||
, tl-expected
|
||||
, hunspell
|
||||
, glibmm
|
||||
, webkitgtk
|
||||
, jemalloc
|
||||
, rnnoise
|
||||
, abseil-cpp
|
||||
# Transitive dependencies:
|
||||
, util-linuxMinimal
|
||||
, pcre
|
||||
, libpthreadstubs
|
||||
, libXdmcp
|
||||
, libselinux
|
||||
, libsepol
|
||||
, libepoxy
|
||||
, at-spi2-core
|
||||
, libXtst
|
||||
, libthai
|
||||
, libdatrie
|
||||
, xdg-utils
|
||||
, libsysprof-capture
|
||||
, libpsl
|
||||
, brotli
|
||||
, microsoft_gsl
|
||||
, rlottie
|
||||
, stdenv
|
||||
, gcc10Stdenv
|
||||
}:
|
||||
|
||||
# Main reference:
|
||||
# - This package was originally based on the Arch package but all patches are now upstreamed:
|
||||
# https://git.archlinux.org/svntogit/community.git/tree/trunk/PKGBUILD?h=packages/telegram-desktop
|
||||
# Other references that could be useful:
|
||||
# - https://git.alpinelinux.org/aports/tree/testing/telegram-desktop/APKBUILD
|
||||
# - https://github.com/void-linux/void-packages/blob/master/srcpkgs/telegram-desktop/template
|
||||
|
||||
let
|
||||
tg_owt = callPackage ./tg_owt.nix {
|
||||
abseil-cpp = abseil-cpp.override {
|
||||
cxxStandard = "17";
|
||||
};
|
||||
};
|
||||
# Aarch64 default gcc9 will cause ICE. For reference #108305
|
||||
env = if stdenv.isAarch64 then gcc10Stdenv else stdenv;
|
||||
in
|
||||
env.mkDerivation rec {
|
||||
pname = "telegram-desktop";
|
||||
version = "3.7.3";
|
||||
# Note: Update via pkgs/applications/networking/instant-messengers/telegram/tdesktop/update.py
|
||||
|
||||
# Telegram-Desktop with submodules
|
||||
src = fetchFromGitHub {
|
||||
owner = "telegramdesktop";
|
||||
repo = "tdesktop";
|
||||
rev = "v${version}";
|
||||
fetchSubmodules = true;
|
||||
sha256 = "01b3nrhfbxhq4w63nsjnrhyfsdq3fm4l7sfkasbh8ib4qk3c9vwz";
|
||||
};
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace Telegram/CMakeLists.txt \
|
||||
--replace '"''${TDESKTOP_LAUNCHER_BASENAME}.appdata.xml"' '"''${TDESKTOP_LAUNCHER_BASENAME}.metainfo.xml"'
|
||||
|
||||
substituteInPlace Telegram/ThirdParty/libtgvoip/os/linux/AudioInputALSA.cpp \
|
||||
--replace '"libasound.so.2"' '"${alsa-lib}/lib/libasound.so.2"'
|
||||
substituteInPlace Telegram/ThirdParty/libtgvoip/os/linux/AudioOutputALSA.cpp \
|
||||
--replace '"libasound.so.2"' '"${alsa-lib}/lib/libasound.so.2"'
|
||||
substituteInPlace Telegram/ThirdParty/libtgvoip/os/linux/AudioPulse.cpp \
|
||||
--replace '"libpulse.so.0"' '"${libpulseaudio}/lib/libpulse.so.0"'
|
||||
substituteInPlace Telegram/lib_webview/webview/platform/linux/webview_linux_webkit_gtk.cpp \
|
||||
--replace '"libwebkit2gtk-4.0.so.37"' '"${webkitgtk}/lib/libwebkit2gtk-4.0.so.37"'
|
||||
'';
|
||||
|
||||
# We want to run wrapProgram manually (with additional parameters)
|
||||
dontWrapGApps = true;
|
||||
dontWrapQtApps = true;
|
||||
|
||||
nativeBuildInputs = [
|
||||
pkg-config
|
||||
cmake
|
||||
ninja
|
||||
python3
|
||||
wrapGAppsHook
|
||||
wrapQtAppsHook
|
||||
extra-cmake-modules
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
qtbase
|
||||
qtwayland
|
||||
qtsvg
|
||||
qtimageformats
|
||||
qt5compat
|
||||
gtk3
|
||||
libdbusmenu
|
||||
lz4
|
||||
xxHash
|
||||
ffmpeg
|
||||
openalSoft
|
||||
minizip
|
||||
libopus
|
||||
alsa-lib
|
||||
libpulseaudio
|
||||
range-v3
|
||||
tl-expected
|
||||
hunspell
|
||||
glibmm
|
||||
webkitgtk
|
||||
jemalloc
|
||||
rnnoise
|
||||
tg_owt
|
||||
# Transitive dependencies:
|
||||
util-linuxMinimal # Required for libmount thus not nativeBuildInputs.
|
||||
pcre
|
||||
libpthreadstubs
|
||||
libXdmcp
|
||||
libselinux
|
||||
libsepol
|
||||
libepoxy
|
||||
at-spi2-core
|
||||
libXtst
|
||||
libthai
|
||||
libdatrie
|
||||
libsysprof-capture
|
||||
libpsl
|
||||
brotli
|
||||
microsoft_gsl
|
||||
rlottie
|
||||
];
|
||||
|
||||
cmakeFlags = [
|
||||
"-Ddisable_autoupdate=ON"
|
||||
# We're allowed to used the API ID of the Snap package:
|
||||
"-DTDESKTOP_API_ID=611335"
|
||||
"-DTDESKTOP_API_HASH=d524b414d21f4d37f08684c1df41ac9c"
|
||||
# See: https://github.com/NixOS/nixpkgs/pull/130827#issuecomment-885212649
|
||||
"-DDESKTOP_APP_USE_PACKAGED_FONTS=OFF"
|
||||
];
|
||||
|
||||
postFixup = ''
|
||||
# This is necessary to run Telegram in a pure environment.
|
||||
# We also use gappsWrapperArgs from wrapGAppsHook.
|
||||
wrapProgram $out/bin/telegram-desktop \
|
||||
"''${gappsWrapperArgs[@]}" \
|
||||
"''${qtWrapperArgs[@]}" \
|
||||
--prefix PATH : ${lib.makeBinPath [ xdg-utils]} \
|
||||
--set XDG_RUNTIME_DIR "XDG-RUNTIME-DIR"
|
||||
sed -i $out/bin/telegram-desktop \
|
||||
-e "s,'XDG-RUNTIME-DIR',\"\''${XDG_RUNTIME_DIR:-/run/user/\$(id --user)}\","
|
||||
'';
|
||||
|
||||
passthru = {
|
||||
inherit tg_owt;
|
||||
updateScript = ./update.py;
|
||||
};
|
||||
|
||||
meta = with lib; {
|
||||
description = "Telegram Desktop messaging app";
|
||||
longDescription = ''
|
||||
Desktop client for the Telegram messenger, based on the Telegram API and
|
||||
the MTProto secure protocol.
|
||||
'';
|
||||
license = licenses.gpl3Only;
|
||||
platforms = platforms.linux;
|
||||
homepage = "https://desktop.telegram.org/";
|
||||
changelog = "https://github.com/telegramdesktop/tdesktop/releases/tag/v${version}";
|
||||
maintainers = with maintainers; [ oxalica ];
|
||||
};
|
||||
}
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
{ lib, stdenv, fetchFromGitHub
|
||||
, pkg-config, cmake, ninja, yasm
|
||||
, libjpeg, openssl, libopus, ffmpeg, alsa-lib, libpulseaudio, protobuf
|
||||
, openh264, usrsctp, libevent, libvpx
|
||||
, libX11, libXtst, libXcomposite, libXdamage, libXext, libXrender, libXrandr, libXi
|
||||
, glib, abseil-cpp, pcre, util-linuxMinimal, libselinux, libsepol, pipewire
|
||||
, mesa, valgrind, libepoxy, libglvnd
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation {
|
||||
pname = "tg_owt";
|
||||
version = "unstable-2022-04-14";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "desktop-app";
|
||||
repo = "tg_owt";
|
||||
rev = "63a934db1ed212ebf8aaaa20f0010dd7b0d7b396";
|
||||
sha256 = "sha256-WddSsQ9KW1zYyYckzdUOvfFZArYAbyvXmABQNMtK6cM=";
|
||||
fetchSubmodules = true;
|
||||
};
|
||||
|
||||
outputs = [ "out" "dev" ];
|
||||
|
||||
nativeBuildInputs = [ pkg-config cmake ninja yasm ];
|
||||
|
||||
buildInputs = [
|
||||
libjpeg openssl libopus ffmpeg alsa-lib libpulseaudio protobuf
|
||||
openh264 usrsctp libevent libvpx
|
||||
libX11 libXtst libXcomposite libXdamage libXext libXrender libXrandr libXi
|
||||
glib abseil-cpp pcre util-linuxMinimal libselinux libsepol pipewire
|
||||
mesa libepoxy libglvnd
|
||||
];
|
||||
|
||||
cmakeFlags = [
|
||||
# Building as a shared library isn't officially supported and may break at any time.
|
||||
"-DBUILD_SHARED_LIBS=OFF"
|
||||
];
|
||||
|
||||
propagatedBuildInputs = [
|
||||
# Required for linking downstream binaries.
|
||||
abseil-cpp openh264 usrsctp libevent libvpx
|
||||
];
|
||||
|
||||
meta = with lib; {
|
||||
license = licenses.bsd3;
|
||||
maintainers = with maintainers; [ oxalica ];
|
||||
};
|
||||
}
|
||||
73
pkgs/applications/networking/instant-messengers/telegram/tdesktop/update.py
Executable file
73
pkgs/applications/networking/instant-messengers/telegram/tdesktop/update.py
Executable file
|
|
@ -0,0 +1,73 @@
|
|||
#! /usr/bin/env nix-shell
|
||||
#! nix-shell -i python3 -p python3 nix nix-prefetch-git
|
||||
|
||||
import fileinput
|
||||
import json
|
||||
import os
|
||||
import re
|
||||
import subprocess
|
||||
|
||||
from datetime import datetime
|
||||
from urllib.request import urlopen, Request
|
||||
|
||||
|
||||
DIR = os.path.dirname(os.path.abspath(__file__))
|
||||
HEADERS = {'Accept': 'application/vnd.github.v3+json'}
|
||||
|
||||
|
||||
def github_api_request(endpoint):
|
||||
base_url = 'https://api.github.com/'
|
||||
request = Request(base_url + endpoint, headers=HEADERS)
|
||||
with urlopen(request) as http_response:
|
||||
return json.loads(http_response.read().decode('utf-8'))
|
||||
|
||||
|
||||
def get_commit_date(repo, sha):
|
||||
url = f'https://api.github.com/repos/{repo}/commits/{sha}'
|
||||
request = Request(url, headers=HEADERS)
|
||||
with urlopen(request) as http_response:
|
||||
commit = json.loads(http_response.read().decode())
|
||||
date = commit['commit']['committer']['date'].rstrip('Z')
|
||||
date = datetime.fromisoformat(date).date().isoformat()
|
||||
return 'unstable-' + date
|
||||
|
||||
|
||||
def nix_prefetch_git(url, rev):
|
||||
"""Prefetches the requested Git revision (incl. submodules) of the given repository URL."""
|
||||
print(f'nix-prefetch-git {url} {rev}')
|
||||
out = subprocess.check_output(['nix-prefetch-git', '--quiet', '--url', url, '--rev', rev, '--fetch-submodules'])
|
||||
return json.loads(out)['sha256']
|
||||
|
||||
|
||||
def nix_prefetch_url(url, unpack=False):
|
||||
"""Prefetches the content of the given URL."""
|
||||
print(f'nix-prefetch-url {url}')
|
||||
options = ['--type', 'sha256']
|
||||
if unpack:
|
||||
options += ['--unpack']
|
||||
out = subprocess.check_output(['nix-prefetch-url'] + options + [url])
|
||||
return out.decode('utf-8').rstrip()
|
||||
|
||||
|
||||
def update_file(relpath, version, sha256, rev=None):
|
||||
file_path = os.path.join(DIR, relpath)
|
||||
with fileinput.FileInput(file_path, inplace=True) as f:
|
||||
for line in f:
|
||||
result = line
|
||||
result = re.sub(r'^ version = ".+";', f' version = "{version}";', result)
|
||||
result = re.sub(r'^ sha256 = ".+";', f' sha256 = "{sha256}";', result)
|
||||
if rev:
|
||||
result = re.sub(r'^ rev = ".*";', f' rev = "{rev}";', result)
|
||||
print(result, end='')
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
tdesktop_tag = github_api_request('repos/telegramdesktop/tdesktop/releases/latest')['tag_name']
|
||||
tdesktop_version = tdesktop_tag.lstrip('v')
|
||||
tdesktop_hash = nix_prefetch_git('https://github.com/telegramdesktop/tdesktop.git', tdesktop_tag)
|
||||
update_file('default.nix', tdesktop_version, tdesktop_hash)
|
||||
tg_owt_ref = github_api_request('repos/desktop-app/tg_owt/commits/master')['sha']
|
||||
tg_owt_version = get_commit_date('desktop-app/tg_owt', tg_owt_ref)
|
||||
tg_owt_hash = nix_prefetch_git('https://github.com/desktop-app/tg_owt.git', tg_owt_ref)
|
||||
update_file('tg_owt.nix', tg_owt_version, tg_owt_hash, tg_owt_ref)
|
||||
tg_owt_ref = github_api_request('repos/desktop-app/tg_owt/commits/master')['sha']
|
||||
|
|
@ -0,0 +1,59 @@
|
|||
{ stdenv, fetchFromGitHub, fetchpatch, jansson, lib, libconfig, libevent, libgcrypt, lua, lua53Packages
|
||||
, makeWrapper, openssl, pkg-config, python3, readline, zlib
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "telegram-cli";
|
||||
version = "20200106";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "kenorb-contrib";
|
||||
repo = "tg";
|
||||
rev = "refs/tags/${version}";
|
||||
sha256 = "sha256-wYBPr2b8IOycO9y/CNyGjnRsyGyYl3oiXYtTzwTurVA=";
|
||||
fetchSubmodules = true;
|
||||
};
|
||||
|
||||
patches = [
|
||||
# Pull patch pending upstream upstream inclusion for -fno-common toolchains:
|
||||
# https://github.com/kenorb-contrib/tg/pull/61
|
||||
(fetchpatch {
|
||||
name = "fno-common.patch";
|
||||
url = "https://github.com/kenorb-contrib/tg/commit/aad2e644fffa16066b227741d54de31bddb04ff8.patch";
|
||||
sha256 = "sha256-LAa5J4BVj3QCiDSs+p2bynDroMSIqCeexQvrgaDl6OE=";
|
||||
})
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
jansson
|
||||
libconfig
|
||||
libevent
|
||||
libgcrypt
|
||||
lua
|
||||
lua53Packages.lgi
|
||||
openssl
|
||||
python3
|
||||
readline
|
||||
zlib
|
||||
];
|
||||
nativeBuildInputs = [
|
||||
pkg-config
|
||||
makeWrapper
|
||||
];
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
install -Dm755 ./bin/telegram-cli $out/bin/telegram-cli-keyless
|
||||
install -Dm644 ./tg-server.pub -t $out/share/telegram-cli
|
||||
makeWrapper $out/bin/telegram-cli-keyless $out/bin/telegram-cli \
|
||||
--add-flags "-k $out/share/telegram-cli/tg-server.pub"
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "Command-line interface for Telegram, that uses readline interface, it's a client implementation of TGL library";
|
||||
downloadPage = "https://github.com/kenorb-contrib/tg";
|
||||
license = licenses.gpl2Only;
|
||||
maintainers = with maintainers; [ ];
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue