diff options
author | Ilya Fedin <fedin-ilja2010@ya.ru> | 2022-04-10 01:35:55 +0400 |
---|---|---|
committer | Ilya Fedin <fedin-ilja2010@ya.ru> | 2022-04-10 01:51:13 +0400 |
commit | dc508e7f5af09a01abdb41cdf580cd151ade72f2 (patch) | |
tree | 1d8667cc6a72d7387c39fa0da46c3aee962c981d /pkgs/applications/networking/instant-messengers/telegram | |
parent | 54d5bb01bf4502545e847fe3f49f1c28bd824f59 (diff) |
kotatogram-desktop-with-webkit: init
This allows to get maximum from the dlopen-based code and install webkit dependency only when needed and without rebuilds
Tested with https://t.me/ShopBot
Diffstat (limited to 'pkgs/applications/networking/instant-messengers/telegram')
2 files changed, 23 insertions, 21 deletions
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 ce5dc0e266e6..f46a918d3c61 100644 --- a/pkgs/applications/networking/instant-messengers/telegram/kotatogram-desktop/default.nix +++ b/pkgs/applications/networking/instant-messengers/telegram/kotatogram-desktop/default.nix @@ -7,7 +7,6 @@ , ninja , clang , python3 -, wrapGAppsHook , wrapQtAppsHook , removeReferencesTo , extra-cmake-modules @@ -27,7 +26,6 @@ , tl-expected , hunspell , glibmm -, webkitgtk , jemalloc , rnnoise , abseil-cpp @@ -65,7 +63,6 @@ , IOSurface , Metal , MetalKit -, withWebKit ? false }: with lib; @@ -113,9 +110,6 @@ stdenv.mkDerivation rec { --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.isLinux && withWebKit) '' - 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"' '' + optionalString stdenv.isDarwin '' substituteInPlace Telegram/CMakeLists.txt \ --replace 'COMMAND iconutil' 'COMMAND png2icns' \ @@ -124,10 +118,6 @@ stdenv.mkDerivation rec { --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" ''; - # We want to run wrapProgram manually (with additional parameters) - dontWrapGApps = stdenv.isLinux; - dontWrapQtApps = stdenv.isLinux && withWebKit; - nativeBuildInputs = [ pkg-config cmake @@ -139,8 +129,6 @@ stdenv.mkDerivation rec { # to build bundled libdispatch clang extra-cmake-modules - ] ++ optionals (stdenv.isLinux && withWebKit) [ - wrapGAppsHook ]; buildInputs = [ @@ -166,8 +154,6 @@ stdenv.mkDerivation rec { glibmm jemalloc wayland - ] ++ optionals (stdenv.isLinux && withWebKit) [ - webkitgtk ] ++ optionals stdenv.isDarwin [ Cocoa CoreFoundation @@ -225,13 +211,6 @@ stdenv.mkDerivation rec { remove-references-to -t ${tg_owt.dev} $out/bin/$binName ''; - postFixup = optionalString (stdenv.isLinux && withWebKit) '' - # We also use gappsWrapperArgs from wrapGAppsHook. - wrapProgram $out/bin/kotatogram-desktop \ - "''${gappsWrapperArgs[@]}" \ - "''${qtWrapperArgs[@]}" - ''; - passthru = { inherit tg_owt; }; 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 new file mode 100644 index 000000000000..435268cdf623 --- /dev/null +++ b/pkgs/applications/networking/instant-messengers/telegram/kotatogram-desktop/with-webkit.nix @@ -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; + }; +} |