summary refs log tree commit diff
path: root/pkgs/applications/networking/instant-messengers
diff options
context:
space:
mode:
authorAlexander Bantyev <balsoft@balsoft.ru>2022-04-10 09:40:53 +0300
committerGitHub <noreply@github.com>2022-04-10 09:40:53 +0300
commitae07156fc3cf644e01b6f6b446bf859fedcc3c16 (patch)
tree8441863bff6087c7be4fd7efb1fdcdbb64a67869 /pkgs/applications/networking/instant-messengers
parentae979da6b8fdbb0f7c4d246188105a68c437eec5 (diff)
parentdc508e7f5af09a01abdb41cdf580cd151ade72f2 (diff)
downloadnixpkgs-ae07156fc3cf644e01b6f6b446bf859fedcc3c16.tar
nixpkgs-ae07156fc3cf644e01b6f6b446bf859fedcc3c16.tar.gz
nixpkgs-ae07156fc3cf644e01b6f6b446bf859fedcc3c16.tar.bz2
nixpkgs-ae07156fc3cf644e01b6f6b446bf859fedcc3c16.tar.lz
nixpkgs-ae07156fc3cf644e01b6f6b446bf859fedcc3c16.tar.xz
nixpkgs-ae07156fc3cf644e01b6f6b446bf859fedcc3c16.tar.zst
nixpkgs-ae07156fc3cf644e01b6f6b446bf859fedcc3c16.zip
Merge pull request #168059 from ilya-fedin/kotatogram-with-webkit
kotatogram-desktop-with-webkit: init
Diffstat (limited to 'pkgs/applications/networking/instant-messengers')
-rw-r--r--pkgs/applications/networking/instant-messengers/telegram/kotatogram-desktop/default.nix21
-rw-r--r--pkgs/applications/networking/instant-messengers/telegram/kotatogram-desktop/with-webkit.nix23
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 ce5dc0e266e..f46a918d3c6 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 00000000000..435268cdf62
--- /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;
+  };
+}