telegram-desktop: port derivation improvements from kotatogram-desktop (#352359)
This commit is contained in:
@@ -1,49 +1,34 @@
|
|||||||
{ lib
|
{ lib
|
||||||
, stdenv
|
, stdenv
|
||||||
, fetchFromGitHub
|
, fetchFromGitHub
|
||||||
|
, fetchpatch
|
||||||
, callPackage
|
, callPackage
|
||||||
, pkg-config
|
, libsForQt5
|
||||||
, cmake
|
, yasm
|
||||||
, ninja
|
|
||||||
, clang
|
|
||||||
, lld
|
|
||||||
, python3
|
|
||||||
, wrapQtAppsHook
|
|
||||||
, removeReferencesTo
|
|
||||||
, qtbase
|
|
||||||
, qtimageformats
|
|
||||||
, qtsvg
|
|
||||||
, qtwayland
|
|
||||||
, kcoreaddons
|
|
||||||
, lz4
|
|
||||||
, xxHash
|
|
||||||
, ffmpeg
|
|
||||||
, openalSoft
|
|
||||||
, minizip
|
|
||||||
, libopus
|
|
||||||
, alsa-lib
|
|
||||||
, libpulseaudio
|
|
||||||
, range-v3
|
|
||||||
, tl-expected
|
|
||||||
, hunspell
|
|
||||||
, gobject-introspection
|
|
||||||
, jemalloc
|
|
||||||
, rnnoise
|
|
||||||
, microsoft-gsl
|
|
||||||
, boost
|
|
||||||
, libicns
|
|
||||||
, darwin
|
|
||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
(libsForQt5.callPackage ../telegram-desktop/default.nix {
|
||||||
tg_owt = callPackage ./tg_owt.nix {
|
inherit stdenv;
|
||||||
|
|
||||||
|
tg_owt = (callPackage ../telegram-desktop/tg_owt.nix {
|
||||||
# tg_owt should use the same compiler
|
# tg_owt should use the same compiler
|
||||||
inherit stdenv;
|
inherit stdenv;
|
||||||
};
|
}).overrideAttrs(oldAttrs: {
|
||||||
|
version = "0-unstable-2024-06-15";
|
||||||
|
|
||||||
mainProgram = if stdenv.hostPlatform.isLinux then "kotatogram-desktop" else "Kotatogram";
|
src = fetchFromGitHub {
|
||||||
in
|
owner = "desktop-app";
|
||||||
stdenv.mkDerivation rec {
|
repo = "tg_owt";
|
||||||
|
rev = "c9cc4390ab951f2cbc103ff783a11f398b27660b";
|
||||||
|
hash = "sha256-FfWmSYaeryTDbsGJT3R7YK1oiyJcrR7YKKBOF+9PmpY=";
|
||||||
|
fetchSubmodules = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
nativeBuildInputs = oldAttrs.nativeBuildInputs ++ [ yasm ];
|
||||||
|
});
|
||||||
|
|
||||||
|
withWebKitGTK = false;
|
||||||
|
}).overrideAttrs {
|
||||||
pname = "kotatogram-desktop";
|
pname = "kotatogram-desktop";
|
||||||
version = "1.4.9-unstable-2024-09-27";
|
version = "1.4.9-unstable-2024-09-27";
|
||||||
|
|
||||||
@@ -59,128 +44,15 @@ stdenv.mkDerivation rec {
|
|||||||
./macos.patch
|
./macos.patch
|
||||||
./macos-opengl.patch
|
./macos-opengl.patch
|
||||||
./macos-qt5.patch
|
./macos-qt5.patch
|
||||||
|
(fetchpatch {
|
||||||
|
url = "https://gitlab.com/mnauw/cppgir/-/commit/c8bb1c6017a6f7f2e47bd10543aea6b3ec69a966.patch";
|
||||||
|
stripLen = 1;
|
||||||
|
extraPrefix = "cmake/external/glib/cppgir/";
|
||||||
|
hash = "sha256-8B4h3BTG8dIlt3+uVgBI569E9eCebcor9uohtsrZpnI=";
|
||||||
|
})
|
||||||
];
|
];
|
||||||
|
|
||||||
postPatch = lib.optionalString stdenv.hostPlatform.isLinux ''
|
|
||||||
substituteInPlace Telegram/ThirdParty/libtgvoip/os/linux/AudioInputALSA.cpp \
|
|
||||||
--replace-fail '"libasound.so.2"' '"${alsa-lib}/lib/libasound.so.2"'
|
|
||||||
substituteInPlace Telegram/ThirdParty/libtgvoip/os/linux/AudioOutputALSA.cpp \
|
|
||||||
--replace-fail '"libasound.so.2"' '"${alsa-lib}/lib/libasound.so.2"'
|
|
||||||
substituteInPlace Telegram/ThirdParty/libtgvoip/os/linux/AudioPulse.cpp \
|
|
||||||
--replace-fail '"libpulse.so.0"' '"${libpulseaudio}/lib/libpulse.so.0"'
|
|
||||||
'' + lib.optionalString stdenv.hostPlatform.isDarwin ''
|
|
||||||
substituteInPlace Telegram/lib_webrtc/webrtc/platform/mac/webrtc_environment_mac.mm \
|
|
||||||
--replace-fail kAudioObjectPropertyElementMain kAudioObjectPropertyElementMaster
|
|
||||||
'';
|
|
||||||
|
|
||||||
# Wrapping the inside of the app bundles, avoiding double-wrapping
|
|
||||||
dontWrapQtApps = stdenv.hostPlatform.isDarwin;
|
|
||||||
|
|
||||||
nativeBuildInputs = [
|
|
||||||
pkg-config
|
|
||||||
cmake
|
|
||||||
ninja
|
|
||||||
python3
|
|
||||||
wrapQtAppsHook
|
|
||||||
removeReferencesTo
|
|
||||||
] ++ lib.optionals stdenv.hostPlatform.isLinux [
|
|
||||||
# to build bundled libdispatch
|
|
||||||
clang
|
|
||||||
gobject-introspection
|
|
||||||
] ++ lib.optionals stdenv.hostPlatform.isDarwin [
|
|
||||||
lld
|
|
||||||
];
|
|
||||||
|
|
||||||
buildInputs = [
|
|
||||||
qtbase
|
|
||||||
qtimageformats
|
|
||||||
qtsvg
|
|
||||||
lz4
|
|
||||||
xxHash
|
|
||||||
ffmpeg
|
|
||||||
openalSoft
|
|
||||||
minizip
|
|
||||||
libopus
|
|
||||||
range-v3
|
|
||||||
tl-expected
|
|
||||||
rnnoise
|
|
||||||
tg_owt
|
|
||||||
microsoft-gsl
|
|
||||||
boost
|
|
||||||
] ++ lib.optionals stdenv.hostPlatform.isLinux [
|
|
||||||
qtwayland
|
|
||||||
kcoreaddons
|
|
||||||
alsa-lib
|
|
||||||
libpulseaudio
|
|
||||||
hunspell
|
|
||||||
jemalloc
|
|
||||||
] ++ lib.optionals stdenv.hostPlatform.isDarwin (with darwin.apple_sdk_11_0.frameworks; [
|
|
||||||
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
|
|
||||||
NaturalLanguage
|
|
||||||
libicns
|
|
||||||
]);
|
|
||||||
|
|
||||||
enableParallelBuilding = true;
|
|
||||||
|
|
||||||
env = lib.optionalAttrs stdenv.hostPlatform.isDarwin {
|
|
||||||
NIX_CFLAGS_LINK = "-fuse-ld=lld";
|
|
||||||
};
|
|
||||||
|
|
||||||
cmakeFlags = [
|
|
||||||
"-DTDESKTOP_API_TEST=ON"
|
|
||||||
];
|
|
||||||
|
|
||||||
installPhase = lib.optionalString stdenv.hostPlatform.isDarwin ''
|
|
||||||
mkdir -p $out/Applications
|
|
||||||
cp -r ${mainProgram}.app $out/Applications
|
|
||||||
ln -s $out/{Applications/${mainProgram}.app/Contents/MacOS,bin}
|
|
||||||
'';
|
|
||||||
|
|
||||||
preFixup = ''
|
|
||||||
remove-references-to -t ${stdenv.cc.cc} $out/bin/${mainProgram}
|
|
||||||
remove-references-to -t ${microsoft-gsl} $out/bin/${mainProgram}
|
|
||||||
remove-references-to -t ${tg_owt.dev} $out/bin/${mainProgram}
|
|
||||||
'';
|
|
||||||
|
|
||||||
postFixup = lib.optionalString stdenv.hostPlatform.isDarwin ''
|
|
||||||
wrapQtApp $out/Applications/${mainProgram}.app/Contents/MacOS/${mainProgram}
|
|
||||||
'';
|
|
||||||
|
|
||||||
passthru = {
|
|
||||||
inherit tg_owt;
|
|
||||||
};
|
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
inherit mainProgram;
|
|
||||||
description = "Kotatogram – experimental Telegram Desktop fork";
|
description = "Kotatogram – experimental Telegram Desktop fork";
|
||||||
longDescription = ''
|
longDescription = ''
|
||||||
Unofficial desktop client for the Telegram messenger, based on Telegram Desktop.
|
Unofficial desktop client for the Telegram messenger, based on Telegram Desktop.
|
||||||
@@ -192,5 +64,6 @@ stdenv.mkDerivation rec {
|
|||||||
homepage = "https://kotatogram.github.io";
|
homepage = "https://kotatogram.github.io";
|
||||||
changelog = "https://github.com/kotatogram/kotatogram-desktop/releases/tag/k{version}";
|
changelog = "https://github.com/kotatogram/kotatogram-desktop/releases/tag/k{version}";
|
||||||
maintainers = with maintainers; [ ilya-fedin ];
|
maintainers = with maintainers; [ ilya-fedin ];
|
||||||
|
mainProgram = if stdenv.hostPlatform.isLinux then "kotatogram-desktop" else "Kotatogram";
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,115 +0,0 @@
|
|||||||
{ lib
|
|
||||||
, stdenv
|
|
||||||
, fetchFromGitHub
|
|
||||||
, fetchpatch2
|
|
||||||
, pkg-config
|
|
||||||
, cmake
|
|
||||||
, ninja
|
|
||||||
, yasm
|
|
||||||
, libjpeg
|
|
||||||
, openssl
|
|
||||||
, libopus
|
|
||||||
, ffmpeg
|
|
||||||
, protobuf
|
|
||||||
, openh264
|
|
||||||
, crc32c
|
|
||||||
, libvpx
|
|
||||||
, libX11
|
|
||||||
, libXtst
|
|
||||||
, libXcomposite
|
|
||||||
, libXdamage
|
|
||||||
, libXext
|
|
||||||
, libXrender
|
|
||||||
, libXrandr
|
|
||||||
, libXi
|
|
||||||
, glib
|
|
||||||
, abseil-cpp
|
|
||||||
, pipewire
|
|
||||||
, mesa
|
|
||||||
, libdrm
|
|
||||||
, libGL
|
|
||||||
, darwin
|
|
||||||
}:
|
|
||||||
|
|
||||||
stdenv.mkDerivation {
|
|
||||||
pname = "tg_owt";
|
|
||||||
version = "0-unstable-2024-06-15";
|
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
|
||||||
owner = "desktop-app";
|
|
||||||
repo = "tg_owt";
|
|
||||||
rev = "c9cc4390ab951f2cbc103ff783a11f398b27660b";
|
|
||||||
sha256 = "sha256-FfWmSYaeryTDbsGJT3R7YK1oiyJcrR7YKKBOF+9PmpY=";
|
|
||||||
fetchSubmodules = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
patches = [
|
|
||||||
# Remove usage of AVCodecContext::reordered_opaque
|
|
||||||
(fetchpatch2 {
|
|
||||||
name = "webrtc-ffmpeg-7.patch";
|
|
||||||
url = "https://webrtc.googlesource.com/src/+/e7d10047096880feb5e9846375f2da54aef91202%5E%21/?format=TEXT";
|
|
||||||
decode = "base64 -d";
|
|
||||||
stripLen = 1;
|
|
||||||
extraPrefix = "src/";
|
|
||||||
hash = "sha256-EdwHeVko8uDsP5GTw2ryWiQgRVCAdPc1me6hySdiwMU=";
|
|
||||||
})
|
|
||||||
];
|
|
||||||
|
|
||||||
postPatch = lib.optionalString stdenv.hostPlatform.isLinux ''
|
|
||||||
substituteInPlace src/modules/desktop_capture/linux/wayland/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 ];
|
|
||||||
|
|
||||||
propagatedBuildInputs = [
|
|
||||||
libjpeg
|
|
||||||
openssl
|
|
||||||
libopus
|
|
||||||
ffmpeg
|
|
||||||
protobuf
|
|
||||||
openh264
|
|
||||||
crc32c
|
|
||||||
libvpx
|
|
||||||
abseil-cpp
|
|
||||||
] ++ lib.optionals stdenv.hostPlatform.isLinux [
|
|
||||||
libX11
|
|
||||||
libXtst
|
|
||||||
libXcomposite
|
|
||||||
libXdamage
|
|
||||||
libXext
|
|
||||||
libXrender
|
|
||||||
libXrandr
|
|
||||||
libXi
|
|
||||||
glib
|
|
||||||
pipewire
|
|
||||||
mesa
|
|
||||||
libdrm
|
|
||||||
libGL
|
|
||||||
] ++ lib.optionals stdenv.hostPlatform.isDarwin (with darwin.apple_sdk.frameworks; [
|
|
||||||
Cocoa
|
|
||||||
AppKit
|
|
||||||
IOKit
|
|
||||||
IOSurface
|
|
||||||
Foundation
|
|
||||||
AVFoundation
|
|
||||||
CoreMedia
|
|
||||||
VideoToolbox
|
|
||||||
CoreGraphics
|
|
||||||
CoreVideo
|
|
||||||
OpenGL
|
|
||||||
Metal
|
|
||||||
MetalKit
|
|
||||||
CoreFoundation
|
|
||||||
ApplicationServices
|
|
||||||
]);
|
|
||||||
|
|
||||||
enableParallelBuilding = true;
|
|
||||||
|
|
||||||
meta.license = lib.licenses.bsd3;
|
|
||||||
}
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
{ stdenv, lib, kotatogram-desktop, glib-networking, webkitgtk_6_0, makeWrapper }:
|
{ stdenv, lib, kotatogram-desktop, glib-networking, webkitgtk_4_1, makeWrapper }:
|
||||||
|
|
||||||
stdenv.mkDerivation {
|
stdenv.mkDerivation {
|
||||||
pname = "${kotatogram-desktop.pname}-with-webkit";
|
pname = "${kotatogram-desktop.pname}-with-webkit";
|
||||||
@@ -8,12 +8,13 @@ stdenv.mkDerivation {
|
|||||||
installPhase = ''
|
installPhase = ''
|
||||||
mkdir -p $out
|
mkdir -p $out
|
||||||
cp -r ${kotatogram-desktop}/share $out
|
cp -r ${kotatogram-desktop}/share $out
|
||||||
|
substituteInPlace $out/share/dbus-1/services/* --replace-fail ${kotatogram-desktop} $out
|
||||||
'';
|
'';
|
||||||
postFixup = ''
|
postFixup = ''
|
||||||
mkdir -p $out/bin
|
mkdir -p $out/bin
|
||||||
makeWrapper ${kotatogram-desktop}/bin/kotatogram-desktop $out/bin/kotatogram-desktop \
|
makeWrapper ${kotatogram-desktop}/bin/kotatogram-desktop $out/bin/kotatogram-desktop \
|
||||||
--prefix GIO_EXTRA_MODULES : ${glib-networking}/lib/gio/modules \
|
--prefix GIO_EXTRA_MODULES : ${glib-networking}/lib/gio/modules \
|
||||||
--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ webkitgtk_6_0 ]}
|
--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ webkitgtk_4_1 ]}
|
||||||
'';
|
'';
|
||||||
meta = kotatogram-desktop.meta // {
|
meta = kotatogram-desktop.meta // {
|
||||||
platforms = lib.platforms.linux;
|
platforms = lib.platforms.linux;
|
||||||
|
|||||||
@@ -1,48 +1,44 @@
|
|||||||
{ lib
|
{ lib
|
||||||
|
, stdenv
|
||||||
, fetchFromGitHub
|
, fetchFromGitHub
|
||||||
, callPackage
|
, callPackage
|
||||||
, pkg-config
|
, pkg-config
|
||||||
, cmake
|
, cmake
|
||||||
, ninja
|
, ninja
|
||||||
|
, clang
|
||||||
|
, lld
|
||||||
, python3
|
, python3
|
||||||
, gobject-introspection
|
|
||||||
, wrapGAppsHook3
|
|
||||||
, wrapQtAppsHook
|
, wrapQtAppsHook
|
||||||
, extra-cmake-modules
|
, tg_owt ? callPackage ./tg_owt.nix { inherit stdenv; }
|
||||||
, qtbase
|
, qtbase
|
||||||
, qtwayland
|
|
||||||
, qtsvg
|
|
||||||
, qtimageformats
|
, qtimageformats
|
||||||
, gtk3
|
, qtsvg
|
||||||
, glib-networking
|
, qtwayland
|
||||||
, boost
|
, kcoreaddons
|
||||||
, fmt
|
|
||||||
, libdbusmenu
|
|
||||||
, lz4
|
, lz4
|
||||||
, xxHash
|
, xxHash
|
||||||
, ffmpeg
|
, ffmpeg
|
||||||
|
, protobuf
|
||||||
, openalSoft
|
, openalSoft
|
||||||
, minizip
|
, minizip
|
||||||
, libopus
|
, libopus
|
||||||
, alsa-lib
|
, alsa-lib
|
||||||
, libpulseaudio
|
, libpulseaudio
|
||||||
, pipewire
|
|
||||||
, range-v3
|
, range-v3
|
||||||
, tl-expected
|
, tl-expected
|
||||||
, hunspell
|
, hunspell
|
||||||
, webkitgtk_6_0
|
, gobject-introspection
|
||||||
, jemalloc
|
, jemalloc
|
||||||
, rnnoise
|
, rnnoise
|
||||||
, protobuf
|
|
||||||
, abseil-cpp
|
|
||||||
, xdg-utils
|
|
||||||
, microsoft-gsl
|
, microsoft-gsl
|
||||||
, rlottie
|
, boost
|
||||||
, ada
|
, ada
|
||||||
, stdenv
|
, withWebKitGTK ? true
|
||||||
, darwin
|
, wrapGAppsHook3
|
||||||
, lld
|
, glib-networking
|
||||||
|
, webkitgtk_4_1
|
||||||
, libicns
|
, libicns
|
||||||
|
, darwin
|
||||||
, nix-update-script
|
, nix-update-script
|
||||||
}:
|
}:
|
||||||
|
|
||||||
@@ -53,14 +49,6 @@
|
|||||||
# - https://git.alpinelinux.org/aports/tree/testing/telegram-desktop/APKBUILD
|
# - https://git.alpinelinux.org/aports/tree/testing/telegram-desktop/APKBUILD
|
||||||
# - https://github.com/void-linux/void-packages/blob/master/srcpkgs/telegram-desktop/template
|
# - https://github.com/void-linux/void-packages/blob/master/srcpkgs/telegram-desktop/template
|
||||||
|
|
||||||
let
|
|
||||||
tg_owt = callPackage ./tg_owt.nix {
|
|
||||||
inherit stdenv;
|
|
||||||
abseil-cpp = abseil-cpp.override {
|
|
||||||
cxxStandard = "20";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
in
|
|
||||||
stdenv.mkDerivation (finalAttrs: {
|
stdenv.mkDerivation (finalAttrs: {
|
||||||
pname = "telegram-desktop";
|
pname = "telegram-desktop";
|
||||||
version = "5.6.3";
|
version = "5.6.3";
|
||||||
@@ -75,10 +63,6 @@ stdenv.mkDerivation (finalAttrs: {
|
|||||||
|
|
||||||
patches = [
|
patches = [
|
||||||
./macos.patch
|
./macos.patch
|
||||||
# the generated .desktop files contains references to unwrapped tdesktop, breaking scheme handling
|
|
||||||
# and the scheme handler is already registered in the packaged .desktop file, rendering this unnecessary
|
|
||||||
# see https://github.com/NixOS/nixpkgs/issues/218370
|
|
||||||
./scheme.patch
|
|
||||||
];
|
];
|
||||||
|
|
||||||
postPatch = lib.optionalString stdenv.hostPlatform.isLinux ''
|
postPatch = lib.optionalString stdenv.hostPlatform.isLinux ''
|
||||||
@@ -88,16 +72,19 @@ stdenv.mkDerivation (finalAttrs: {
|
|||||||
--replace-fail '"libasound.so.2"' '"${alsa-lib}/lib/libasound.so.2"'
|
--replace-fail '"libasound.so.2"' '"${alsa-lib}/lib/libasound.so.2"'
|
||||||
substituteInPlace Telegram/ThirdParty/libtgvoip/os/linux/AudioPulse.cpp \
|
substituteInPlace Telegram/ThirdParty/libtgvoip/os/linux/AudioPulse.cpp \
|
||||||
--replace-fail '"libpulse.so.0"' '"${libpulseaudio}/lib/libpulse.so.0"'
|
--replace-fail '"libpulse.so.0"' '"${libpulseaudio}/lib/libpulse.so.0"'
|
||||||
|
'' + lib.optionalString (stdenv.hostPlatform.isLinux && withWebKitGTK) ''
|
||||||
substituteInPlace Telegram/lib_webview/webview/platform/linux/webview_linux_webkitgtk_library.cpp \
|
substituteInPlace Telegram/lib_webview/webview/platform/linux/webview_linux_webkitgtk_library.cpp \
|
||||||
--replace-fail '"libwebkitgtk-6.0.so.4"' '"${webkitgtk_6_0}/lib/libwebkitgtk-6.0.so.4"'
|
--replace-fail '"libwebkit2gtk-4.1.so.0"' '"${webkitgtk_4_1}/lib/libwebkit2gtk-4.1.so.0"'
|
||||||
'' + lib.optionalString stdenv.hostPlatform.isDarwin ''
|
'' + lib.optionalString stdenv.hostPlatform.isDarwin ''
|
||||||
substituteInPlace Telegram/lib_webrtc/webrtc/platform/mac/webrtc_environment_mac.mm \
|
substituteInPlace Telegram/lib_webrtc/webrtc/platform/mac/webrtc_environment_mac.mm \
|
||||||
--replace-fail kAudioObjectPropertyElementMain kAudioObjectPropertyElementMaster
|
--replace-fail kAudioObjectPropertyElementMain kAudioObjectPropertyElementMaster
|
||||||
'';
|
'';
|
||||||
|
|
||||||
# We want to run wrapProgram manually (with additional parameters)
|
# Avoid double-wrapping
|
||||||
dontWrapGApps = true;
|
dontWrapGApps = true;
|
||||||
dontWrapQtApps = true;
|
|
||||||
|
# Wrapping the inside of the app bundles, avoiding double-wrapping
|
||||||
|
dontWrapQtApps = stdenv.hostPlatform.isDarwin;
|
||||||
|
|
||||||
nativeBuildInputs = [
|
nativeBuildInputs = [
|
||||||
pkg-config
|
pkg-config
|
||||||
@@ -106,18 +93,19 @@ stdenv.mkDerivation (finalAttrs: {
|
|||||||
python3
|
python3
|
||||||
wrapQtAppsHook
|
wrapQtAppsHook
|
||||||
] ++ lib.optionals stdenv.hostPlatform.isLinux [
|
] ++ lib.optionals stdenv.hostPlatform.isLinux [
|
||||||
|
# to build bundled libdispatch
|
||||||
|
clang
|
||||||
gobject-introspection
|
gobject-introspection
|
||||||
|
] ++ lib.optionals (stdenv.hostPlatform.isLinux && withWebKitGTK) [
|
||||||
wrapGAppsHook3
|
wrapGAppsHook3
|
||||||
extra-cmake-modules
|
|
||||||
] ++ lib.optionals stdenv.hostPlatform.isDarwin [
|
] ++ lib.optionals stdenv.hostPlatform.isDarwin [
|
||||||
lld
|
lld
|
||||||
];
|
];
|
||||||
|
|
||||||
buildInputs = [
|
buildInputs = [
|
||||||
qtbase
|
qtbase
|
||||||
qtsvg
|
|
||||||
qtimageformats
|
qtimageformats
|
||||||
boost
|
qtsvg
|
||||||
lz4
|
lz4
|
||||||
xxHash
|
xxHash
|
||||||
ffmpeg
|
ffmpeg
|
||||||
@@ -127,23 +115,21 @@ stdenv.mkDerivation (finalAttrs: {
|
|||||||
range-v3
|
range-v3
|
||||||
tl-expected
|
tl-expected
|
||||||
rnnoise
|
rnnoise
|
||||||
protobuf
|
|
||||||
tg_owt
|
tg_owt
|
||||||
microsoft-gsl
|
microsoft-gsl
|
||||||
rlottie
|
boost
|
||||||
ada
|
ada
|
||||||
] ++ lib.optionals stdenv.hostPlatform.isLinux [
|
] ++ lib.optionals stdenv.hostPlatform.isLinux [
|
||||||
|
protobuf
|
||||||
qtwayland
|
qtwayland
|
||||||
gtk3
|
kcoreaddons
|
||||||
glib-networking
|
|
||||||
fmt
|
|
||||||
libdbusmenu
|
|
||||||
alsa-lib
|
alsa-lib
|
||||||
libpulseaudio
|
libpulseaudio
|
||||||
pipewire
|
|
||||||
hunspell
|
hunspell
|
||||||
webkitgtk_6_0
|
|
||||||
jemalloc
|
jemalloc
|
||||||
|
] ++ lib.optionals (stdenv.hostPlatform.isLinux && withWebKitGTK) [
|
||||||
|
glib-networking
|
||||||
|
webkitgtk_4_1
|
||||||
] ++ lib.optionals stdenv.hostPlatform.isDarwin (with darwin.apple_sdk_11_0.frameworks; [
|
] ++ lib.optionals stdenv.hostPlatform.isDarwin (with darwin.apple_sdk_11_0.frameworks; [
|
||||||
Cocoa
|
Cocoa
|
||||||
CoreFoundation
|
CoreFoundation
|
||||||
@@ -185,33 +171,22 @@ stdenv.mkDerivation (finalAttrs: {
|
|||||||
};
|
};
|
||||||
|
|
||||||
cmakeFlags = [
|
cmakeFlags = [
|
||||||
(lib.cmakeBool "DESKTOP_APP_DISABLE_AUTOUPDATE" true)
|
|
||||||
# We're allowed to used the API ID of the Snap package:
|
# We're allowed to used the API ID of the Snap package:
|
||||||
(lib.cmakeFeature "TDESKTOP_API_ID" "611335")
|
(lib.cmakeFeature "TDESKTOP_API_ID" "611335")
|
||||||
(lib.cmakeFeature "TDESKTOP_API_HASH" "d524b414d21f4d37f08684c1df41ac9c")
|
(lib.cmakeFeature "TDESKTOP_API_HASH" "d524b414d21f4d37f08684c1df41ac9c")
|
||||||
# See: https://github.com/NixOS/nixpkgs/pull/130827#issuecomment-885212649
|
|
||||||
(lib.cmakeBool "DESKTOP_APP_USE_PACKAGED_FONTS" false)
|
|
||||||
];
|
];
|
||||||
|
|
||||||
preBuild = ''
|
|
||||||
# for cppgir to locate gir files
|
|
||||||
export GI_GIR_PATH="$XDG_DATA_DIRS"
|
|
||||||
'';
|
|
||||||
|
|
||||||
installPhase = lib.optionalString stdenv.hostPlatform.isDarwin ''
|
installPhase = lib.optionalString stdenv.hostPlatform.isDarwin ''
|
||||||
mkdir -p $out/Applications
|
mkdir -p $out/Applications
|
||||||
cp -r ${finalAttrs.meta.mainProgram}.app $out/Applications
|
cp -r ${finalAttrs.meta.mainProgram}.app $out/Applications
|
||||||
ln -s $out/{Applications/${finalAttrs.meta.mainProgram}.app/Contents/MacOS,bin}
|
ln -s $out/{Applications/${finalAttrs.meta.mainProgram}.app/Contents/MacOS,bin}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
postFixup = lib.optionalString stdenv.hostPlatform.isLinux ''
|
preFixup = lib.optionalString (stdenv.hostPlatform.isLinux && withWebKitGTK) ''
|
||||||
# This is necessary to run Telegram in a pure environment.
|
qtWrapperArgs+=("''${gappsWrapperArgs[@]}")
|
||||||
# We also use gappsWrapperArgs from wrapGAppsHook.
|
'';
|
||||||
wrapProgram $out/bin/${finalAttrs.meta.mainProgram} \
|
|
||||||
"''${gappsWrapperArgs[@]}" \
|
postFixup = lib.optionalString stdenv.hostPlatform.isDarwin ''
|
||||||
"''${qtWrapperArgs[@]}" \
|
|
||||||
--suffix PATH : ${lib.makeBinPath [ xdg-utils ]}
|
|
||||||
'' + lib.optionalString stdenv.hostPlatform.isDarwin ''
|
|
||||||
wrapQtApp $out/Applications/${finalAttrs.meta.mainProgram}.app/Contents/MacOS/${finalAttrs.meta.mainProgram}
|
wrapQtApp $out/Applications/${finalAttrs.meta.mainProgram}.app/Contents/MacOS/${finalAttrs.meta.mainProgram}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
|||||||
@@ -1,12 +0,0 @@
|
|||||||
diff --git a/Telegram/SourceFiles/core/application.cpp b/Telegram/SourceFiles/core/application.cpp
|
|
||||||
index e3e0de6c6..d5851bd6e 100644
|
|
||||||
--- a/Telegram/SourceFiles/core/application.cpp
|
|
||||||
+++ b/Telegram/SourceFiles/core/application.cpp
|
|
||||||
@@ -421,7 +421,6 @@ void Application::run() {
|
|
||||||
|
|
||||||
void Application::autoRegisterUrlScheme() {
|
|
||||||
if (!OptionSkipUrlSchemeRegister.value()) {
|
|
||||||
- InvokeQueued(this, [] { RegisterUrlScheme(); });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -5,29 +5,31 @@
|
|||||||
fetchpatch2,
|
fetchpatch2,
|
||||||
pkg-config,
|
pkg-config,
|
||||||
cmake,
|
cmake,
|
||||||
crc32c,
|
ninja,
|
||||||
python3,
|
python3,
|
||||||
libjpeg,
|
libjpeg,
|
||||||
openssl,
|
openssl,
|
||||||
libopus,
|
libopus,
|
||||||
ffmpeg,
|
ffmpeg,
|
||||||
openh264,
|
openh264,
|
||||||
|
crc32c,
|
||||||
libvpx,
|
libvpx,
|
||||||
libXi,
|
libX11,
|
||||||
libXfixes,
|
|
||||||
libXtst,
|
libXtst,
|
||||||
libXcomposite,
|
libXcomposite,
|
||||||
libXdamage,
|
libXdamage,
|
||||||
libXext,
|
libXext,
|
||||||
libXrender,
|
libXrender,
|
||||||
libXrandr,
|
libXrandr,
|
||||||
|
libXi,
|
||||||
glib,
|
glib,
|
||||||
abseil-cpp,
|
abseil-cpp,
|
||||||
pipewire,
|
pipewire,
|
||||||
mesa,
|
mesa,
|
||||||
|
libdrm,
|
||||||
libGL,
|
libGL,
|
||||||
unstableGitUpdater,
|
|
||||||
darwin,
|
darwin,
|
||||||
|
unstableGitUpdater,
|
||||||
}:
|
}:
|
||||||
|
|
||||||
stdenv.mkDerivation {
|
stdenv.mkDerivation {
|
||||||
@@ -38,7 +40,7 @@ stdenv.mkDerivation {
|
|||||||
owner = "desktop-app";
|
owner = "desktop-app";
|
||||||
repo = "tg_owt";
|
repo = "tg_owt";
|
||||||
rev = "dc17143230b5519f3c1a8da0079e00566bd4c5a8";
|
rev = "dc17143230b5519f3c1a8da0079e00566bd4c5a8";
|
||||||
sha256 = "sha256-7j7hBIOXEdNJDnDSVUqy234nkTCaeZ9tDAzqvcuaq0o=";
|
hash = "sha256-7j7hBIOXEdNJDnDSVUqy234nkTCaeZ9tDAzqvcuaq0o=";
|
||||||
fetchSubmodules = true;
|
fetchSubmodules = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -54,36 +56,50 @@ stdenv.mkDerivation {
|
|||||||
})
|
})
|
||||||
];
|
];
|
||||||
|
|
||||||
|
postPatch = lib.optionalString stdenv.hostPlatform.isLinux ''
|
||||||
|
substituteInPlace src/modules/desktop_capture/linux/wayland/egl_dmabuf.cc \
|
||||||
|
--replace-fail '"libEGL.so.1"' '"${lib.getLib libGL}/lib/libEGL.so.1"' \
|
||||||
|
--replace-fail '"libGL.so.1"' '"${lib.getLib libGL}/lib/libGL.so.1"' \
|
||||||
|
--replace-fail '"libgbm.so.1"' '"${lib.getLib mesa}/lib/libgbm.so.1"' \
|
||||||
|
--replace-fail '"libdrm.so.2"' '"${lib.getLib libdrm}/lib/libdrm.so.2"'
|
||||||
|
'';
|
||||||
|
|
||||||
outputs = [
|
outputs = [
|
||||||
"out"
|
"out"
|
||||||
"dev"
|
"dev"
|
||||||
];
|
];
|
||||||
|
|
||||||
nativeBuildInputs = [
|
nativeBuildInputs = [
|
||||||
cmake
|
|
||||||
pkg-config
|
pkg-config
|
||||||
|
cmake
|
||||||
|
ninja
|
||||||
python3
|
python3
|
||||||
];
|
];
|
||||||
|
|
||||||
buildInputs =
|
propagatedBuildInputs =
|
||||||
[
|
[
|
||||||
openssl
|
|
||||||
libjpeg
|
libjpeg
|
||||||
|
openssl
|
||||||
libopus
|
libopus
|
||||||
ffmpeg
|
ffmpeg
|
||||||
|
openh264
|
||||||
|
crc32c
|
||||||
|
libvpx
|
||||||
|
abseil-cpp
|
||||||
]
|
]
|
||||||
++ lib.optionals stdenv.hostPlatform.isLinux [
|
++ lib.optionals stdenv.hostPlatform.isLinux [
|
||||||
glib
|
libX11
|
||||||
libXi
|
libXtst
|
||||||
libXcomposite
|
libXcomposite
|
||||||
libXdamage
|
libXdamage
|
||||||
libXext
|
libXext
|
||||||
libXfixes
|
|
||||||
libXrender
|
libXrender
|
||||||
libXrandr
|
libXrandr
|
||||||
libXtst
|
libXi
|
||||||
|
glib
|
||||||
pipewire
|
pipewire
|
||||||
mesa
|
mesa
|
||||||
|
libdrm
|
||||||
libGL
|
libGL
|
||||||
]
|
]
|
||||||
++ lib.optionals stdenv.hostPlatform.isDarwin (
|
++ lib.optionals stdenv.hostPlatform.isDarwin (
|
||||||
@@ -99,6 +115,7 @@ stdenv.mkDerivation {
|
|||||||
VideoToolbox
|
VideoToolbox
|
||||||
CoreGraphics
|
CoreGraphics
|
||||||
CoreVideo
|
CoreVideo
|
||||||
|
OpenGL
|
||||||
Metal
|
Metal
|
||||||
MetalKit
|
MetalKit
|
||||||
CoreFoundation
|
CoreFoundation
|
||||||
@@ -106,18 +123,6 @@ stdenv.mkDerivation {
|
|||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
|
||||||
propagatedBuildInputs = [
|
|
||||||
abseil-cpp
|
|
||||||
crc32c
|
|
||||||
openh264
|
|
||||||
libvpx
|
|
||||||
];
|
|
||||||
|
|
||||||
cmakeFlags = [
|
|
||||||
# Building as a shared library isn't officially supported and may break at any time.
|
|
||||||
(lib.cmakeBool "BUILD_SHARED_LIBS" false)
|
|
||||||
];
|
|
||||||
|
|
||||||
passthru.updateScript = unstableGitUpdater { };
|
passthru.updateScript = unstableGitUpdater { };
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ telegram-desktop.overrideAttrs (old: rec {
|
|||||||
];
|
];
|
||||||
|
|
||||||
cmakeFlags = (old.cmakeFlags or []) ++ [
|
cmakeFlags = (old.cmakeFlags or []) ++ [
|
||||||
|
(lib.cmakeBool "DESKTOP_APP_DISABLE_AUTOUPDATE" true)
|
||||||
(lib.cmakeBool "disable_autoupdate" true)
|
(lib.cmakeBool "disable_autoupdate" true)
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
@@ -30264,7 +30264,7 @@ with pkgs;
|
|||||||
|
|
||||||
kondo = callPackage ../applications/misc/kondo { };
|
kondo = callPackage ../applications/misc/kondo { };
|
||||||
|
|
||||||
kotatogram-desktop = libsForQt5.callPackage ../applications/networking/instant-messengers/telegram/kotatogram-desktop {
|
kotatogram-desktop = callPackage ../applications/networking/instant-messengers/telegram/kotatogram-desktop {
|
||||||
stdenv = if stdenv.hostPlatform.isDarwin
|
stdenv = if stdenv.hostPlatform.isDarwin
|
||||||
then overrideSDK stdenv "11.0"
|
then overrideSDK stdenv "11.0"
|
||||||
else stdenv;
|
else stdenv;
|
||||||
@@ -32577,7 +32577,7 @@ with pkgs;
|
|||||||
|
|
||||||
taskopen = callPackage ../applications/misc/taskopen { };
|
taskopen = callPackage ../applications/misc/taskopen { };
|
||||||
|
|
||||||
telegram-desktop = qt6Packages.callPackage ../applications/networking/instant-messengers/telegram/telegram-desktop {
|
telegram-desktop = kdePackages.callPackage ../applications/networking/instant-messengers/telegram/telegram-desktop {
|
||||||
stdenv = if stdenv.hostPlatform.isDarwin
|
stdenv = if stdenv.hostPlatform.isDarwin
|
||||||
then overrideSDK stdenv "11.0"
|
then overrideSDK stdenv "11.0"
|
||||||
else stdenv;
|
else stdenv;
|
||||||
|
|||||||
Reference in New Issue
Block a user