diff --git a/pkgs/applications/networking/instant-messengers/telegram/kotatogram-desktop/default.nix b/pkgs/applications/networking/instant-messengers/telegram/kotatogram-desktop/default.nix index 1ee0f49ca0d19e..97ca8ca90e9cf1 100644 --- a/pkgs/applications/networking/instant-messengers/telegram/kotatogram-desktop/default.nix +++ b/pkgs/applications/networking/instant-messengers/telegram/kotatogram-desktop/default.nix @@ -10,7 +10,7 @@ let version = "1.4.9"; in -(libsForQt5.callPackage ../telegram-desktop/default.nix { +((libsForQt5.callPackage ../telegram-desktop/default.nix { inherit stdenv; tg_owt = (callPackage ../telegram-desktop/tg_owt.nix { @@ -29,9 +29,7 @@ in nativeBuildInputs = oldAttrs.nativeBuildInputs ++ [ yasm ]; }); - - withWebKitGTK = false; -}).overrideAttrs { +}).without-webkit.overrideAttrs { pname = "kotatogram-desktop"; version = "${version}-unstable-2024-09-27"; @@ -69,4 +67,4 @@ in maintainers = with maintainers; [ ilya-fedin ]; mainProgram = if stdenv.hostPlatform.isLinux then "kotatogram-desktop" else "Kotatogram"; }; -} +}).with-webkit diff --git a/pkgs/applications/networking/instant-messengers/telegram/kotatogram-desktop/with-webkit.nix b/pkgs/applications/networking/instant-messengers/telegram/kotatogram-desktop/with-webkit.nix deleted file mode 100644 index f708b8a6246ea6..00000000000000 --- a/pkgs/applications/networking/instant-messengers/telegram/kotatogram-desktop/with-webkit.nix +++ /dev/null @@ -1,23 +0,0 @@ -{ stdenv, lib, kotatogram-desktop, glib-networking, webkitgtk_4_1, makeBinaryWrapper }: - -stdenv.mkDerivation { - pname = "${kotatogram-desktop.pname}-with-webkit"; - version = kotatogram-desktop.version; - nativeBuildInputs = [ makeBinaryWrapper ]; - dontUnpack = true; - installPhase = '' - mkdir -p $out - cp -r ${kotatogram-desktop}/share $out - substituteInPlace $out/share/dbus-1/services/* --replace-fail ${kotatogram-desktop} $out - ''; - postFixup = '' - mkdir -p $out/bin - makeBinaryWrapper {${kotatogram-desktop},$out}/bin/${kotatogram-desktop.meta.mainProgram} \ - --inherit-argv0 \ - --prefix GIO_EXTRA_MODULES : ${glib-networking}/lib/gio/modules \ - --prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ webkitgtk_4_1 ]} - ''; - meta = kotatogram-desktop.meta // { - platforms = lib.platforms.linux; - }; -} diff --git a/pkgs/applications/networking/instant-messengers/telegram/telegram-desktop/default.nix b/pkgs/applications/networking/instant-messengers/telegram/telegram-desktop/default.nix index c4de1b9791951c..391ef2cfb9d966 100644 --- a/pkgs/applications/networking/instant-messengers/telegram/telegram-desktop/default.nix +++ b/pkgs/applications/networking/instant-messengers/telegram/telegram-desktop/default.nix @@ -33,10 +33,6 @@ , microsoft-gsl , boost , ada -, withWebKitGTK ? true -, wrapGAppsHook3 -, glib-networking -, webkitgtk_4_1 , libicns , darwin , nix-update-script @@ -49,7 +45,7 @@ # - https://git.alpinelinux.org/aports/tree/testing/telegram-desktop/APKBUILD # - https://github.com/void-linux/void-packages/blob/master/srcpkgs/telegram-desktop/template -stdenv.mkDerivation (finalAttrs: { +(stdenv.mkDerivation (finalAttrs: { pname = "telegram-desktop"; version = "5.6.3"; @@ -72,17 +68,11 @@ stdenv.mkDerivation (finalAttrs: { --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.isLinux && withWebKitGTK) '' - substituteInPlace Telegram/lib_webview/webview/platform/linux/webview_linux_webkitgtk_library.cpp \ - --replace-fail '"libwebkit2gtk-4.1.so.0"' '"${webkitgtk_4_1}/lib/libwebkit2gtk-4.1.so.0"' '' + lib.optionalString stdenv.hostPlatform.isDarwin '' substituteInPlace Telegram/lib_webrtc/webrtc/platform/mac/webrtc_environment_mac.mm \ --replace-fail kAudioObjectPropertyElementMain kAudioObjectPropertyElementMaster ''; - # Avoid double-wrapping - dontWrapGApps = true; - # Wrapping the inside of the app bundles, avoiding double-wrapping dontWrapQtApps = stdenv.hostPlatform.isDarwin; @@ -96,8 +86,6 @@ stdenv.mkDerivation (finalAttrs: { # to build bundled libdispatch clang gobject-introspection - ] ++ lib.optionals (stdenv.hostPlatform.isLinux && withWebKitGTK) [ - wrapGAppsHook3 ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ lld ]; @@ -127,9 +115,6 @@ stdenv.mkDerivation (finalAttrs: { libpulseaudio hunspell jemalloc - ] ++ lib.optionals (stdenv.hostPlatform.isLinux && withWebKitGTK) [ - glib-networking - webkitgtk_4_1 ] ++ lib.optionals stdenv.hostPlatform.isDarwin (with darwin.apple_sdk_11_0.frameworks; [ Cocoa CoreFoundation @@ -182,15 +167,15 @@ stdenv.mkDerivation (finalAttrs: { ln -s $out/{Applications/${finalAttrs.meta.mainProgram}.app/Contents/MacOS,bin} ''; - preFixup = lib.optionalString (stdenv.hostPlatform.isLinux && withWebKitGTK) '' - qtWrapperArgs+=("''${gappsWrapperArgs[@]}") - ''; - postFixup = lib.optionalString stdenv.hostPlatform.isDarwin '' wrapQtApp $out/Applications/${finalAttrs.meta.mainProgram}.app/Contents/MacOS/${finalAttrs.meta.mainProgram} ''; passthru = { + with-webkit = callPackage ./with-webkit.nix { + telegram-desktop = finalAttrs.finalPackage; + }; + without-webkit = finalAttrs.finalPackage; inherit tg_owt; updateScript = nix-update-script { }; }; @@ -208,4 +193,4 @@ stdenv.mkDerivation (finalAttrs: { maintainers = with lib.maintainers; [ nickcao ]; mainProgram = if stdenv.hostPlatform.isLinux then "telegram-desktop" else "Telegram"; }; -}) +})).with-webkit diff --git a/pkgs/applications/networking/instant-messengers/telegram/telegram-desktop/with-webkit.nix b/pkgs/applications/networking/instant-messengers/telegram/telegram-desktop/with-webkit.nix new file mode 100644 index 00000000000000..c9bf3031a2a1ce --- /dev/null +++ b/pkgs/applications/networking/instant-messengers/telegram/telegram-desktop/with-webkit.nix @@ -0,0 +1,34 @@ +{ + stdenv, + lib, + telegram-desktop, + glib-networking, + webkitgtk_4_1, + makeBinaryWrapper, +}: + +if stdenv.hostPlatform.isLinux then + stdenv.mkDerivation { + pname = "${telegram-desktop.pname}-with-webkit"; + version = telegram-desktop.version; + nativeBuildInputs = [ makeBinaryWrapper ]; + dontUnpack = true; + installPhase = '' + mkdir -p $out + cp -r ${telegram-desktop}/share $out + substituteInPlace $out/share/dbus-1/services/* --replace-fail ${telegram-desktop} $out + ''; + postFixup = '' + mkdir -p $out/bin + makeBinaryWrapper {${telegram-desktop},$out}/bin/${telegram-desktop.meta.mainProgram} \ + --inherit-argv0 \ + --prefix GIO_EXTRA_MODULES : ${glib-networking}/lib/gio/modules \ + --prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ webkitgtk_4_1 ]} + ''; + passthru = telegram-desktop.passthru; + meta = telegram-desktop.meta // { + platforms = lib.platforms.linux; + }; + } +else + telegram-desktop diff --git a/pkgs/by-name/_6/_64gram/package.nix b/pkgs/by-name/_6/_64gram/package.nix index b921efbf2dbcd7..ee94c728ddd557 100644 --- a/pkgs/by-name/_6/_64gram/package.nix +++ b/pkgs/by-name/_6/_64gram/package.nix @@ -6,7 +6,7 @@ , nix-update-script }: -telegram-desktop.overrideAttrs (old: rec { +(telegram-desktop.without-webkit.overrideAttrs (old: rec { pname = "64gram"; version = "1.1.43"; @@ -32,7 +32,7 @@ telegram-desktop.overrideAttrs (old: rec { (lib.cmakeBool "disable_autoupdate" true) ]; - passthru.updateScript = nix-update-script {}; + passthru = (old.passthru or {}) // { updateScript = nix-update-script {}; }; meta = with lib; { description = "Unofficial Telegram Desktop providing Windows 64bit build and extra features"; @@ -44,4 +44,4 @@ telegram-desktop.overrideAttrs (old: rec { mainProgram = "telegram-desktop"; broken = stdenv.hostPlatform.isDarwin; }; -}) +})).with-webkit diff --git a/pkgs/by-name/ma/materialgram/package.nix b/pkgs/by-name/ma/materialgram/package.nix index 3ab41652a09c87..6adfd5e2404c89 100644 --- a/pkgs/by-name/ma/materialgram/package.nix +++ b/pkgs/by-name/ma/materialgram/package.nix @@ -3,7 +3,7 @@ lib, fetchFromGitHub, }: -telegram-desktop.overrideAttrs ( +(telegram-desktop.without-webkit.overrideAttrs ( finalAttrs: previousAttrs: { pname = "materialgram"; version = "5.6.1.1"; @@ -31,4 +31,4 @@ telegram-desktop.overrideAttrs ( mainProgram = "materialgram"; }; } -) +)).with-webkit diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 0f17b22d30239d..04bfeb447d7e9b 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -30232,8 +30232,6 @@ with pkgs; else stdenv; }; - kotatogram-desktop-with-webkit = callPackage ../applications/networking/instant-messengers/telegram/kotatogram-desktop/with-webkit.nix { }; - kpt = callPackage ../applications/networking/cluster/kpt { }; krabby = callPackage ../applications/misc/krabby { };