summary refs log tree commit diff
diff options
context:
space:
mode:
authorBobby Rong <rjl931189261@126.com>2023-04-25 12:53:30 +0800
committerBobby Rong <rjl931189261@126.com>2023-04-27 08:40:37 +0800
commit46a84aa1b700e18cea536ff165eaecf26103cbae (patch)
treee3b22471649eb1f6e63a08a644710b3c7d231a5c
parente78d25df6f1036b3fa76750ed4603dd9d5fe90fc (diff)
downloadnixpkgs-46a84aa1b700e18cea536ff165eaecf26103cbae.tar
nixpkgs-46a84aa1b700e18cea536ff165eaecf26103cbae.tar.gz
nixpkgs-46a84aa1b700e18cea536ff165eaecf26103cbae.tar.bz2
nixpkgs-46a84aa1b700e18cea536ff165eaecf26103cbae.tar.lz
nixpkgs-46a84aa1b700e18cea536ff165eaecf26103cbae.tar.xz
nixpkgs-46a84aa1b700e18cea536ff165eaecf26103cbae.tar.zst
nixpkgs-46a84aa1b700e18cea536ff165eaecf26103cbae.zip
cinnamon.warpinator: 1.4.5 -> 1.6.1
https://github.com/linuxmint/warpinator/compare/1.4.5...1.6.1
-rw-r--r--pkgs/desktops/cinnamon/warpinator/default.nix59
1 files changed, 33 insertions, 26 deletions
diff --git a/pkgs/desktops/cinnamon/warpinator/default.nix b/pkgs/desktops/cinnamon/warpinator/default.nix
index a488baab007..fbf5df1fc7c 100644
--- a/pkgs/desktops/cinnamon/warpinator/default.nix
+++ b/pkgs/desktops/cinnamon/warpinator/default.nix
@@ -1,4 +1,5 @@
-{ fetchFromGitHub
+{ stdenv
+, fetchFromGitHub
 , lib
 , gobject-introspection
 , meson
@@ -6,24 +7,39 @@
 , python3
 , gtk3
 , gdk-pixbuf
+, xapp
 , wrapGAppsHook
 , gettext
 , polkit
 , glib
 , gitUpdater
+, bubblewrap
 }:
 
-python3.pkgs.buildPythonApplication rec  {
+let
+  pythonEnv = python3.withPackages (pp: with pp; [
+    grpcio-tools
+    protobuf
+    pygobject3
+    setproctitle
+    pp.xapp
+    zeroconf
+    grpcio
+    setuptools
+    cryptography
+    pynacl
+    netifaces
+  ]);
+in
+stdenv.mkDerivation rec {
   pname = "warpinator";
-  version = "1.4.5";
-
-  format = "other";
+  version = "1.6.1";
 
   src = fetchFromGitHub {
     owner = "linuxmint";
     repo = pname;
     rev = version;
-    hash = "sha256-5mMV4WinpFR9ihgoQsgIXre0VpBdg9S8GjSkx+7ocLg=";
+    hash = "sha256-H8bFSgx3IysHCoKrMZ9gbwRl9forEjY90a/PIC68E6k=";
   };
 
   nativeBuildInputs = [
@@ -39,20 +55,8 @@ python3.pkgs.buildPythonApplication rec  {
     glib
     gtk3
     gdk-pixbuf
-  ];
-
-  propagatedBuildInputs = with python3.pkgs; [
-    grpcio-tools
-    protobuf
-    pygobject3
-    setproctitle
+    pythonEnv
     xapp
-    zeroconf
-    grpcio
-    setuptools
-    cryptography
-    pynacl
-    netifaces
   ];
 
   mesonFlags = [
@@ -66,15 +70,18 @@ python3.pkgs.buildPythonApplication rec  {
     find . -type f -exec sed -i \
       -e s,/usr/libexec/warpinator,$out/libexec/warpinator,g \
       {} +
-  '';
-
-  dontWrapGApps = true; # Prevent double wrapping
 
-  preFixup = ''
-    # these get loaded via import from bin, so don't need wrapping
-    chmod -x+X $out/libexec/warpinator/*.py
+    # We make bubblewrap mode always available since
+    # landlock mode is not supported in old kernels.
+    substituteInPlace src/warpinator-launch.py \
+      --replace '"/bin/python3"' '"${pythonEnv.interpreter}"' \
+      --replace "/bin/bwrap" "${bubblewrap}/bin/bwrap" \
+      --replace 'GLib.find_program_in_path("bwrap")' "True"
 
-    makeWrapperArgs+=("''${gappsWrapperArgs[@]}")
+    # Typo fix that can be removed on next update
+    # https://github.com/linuxmint/warpinator/pull/174
+    substituteInPlace src/remote.py \
+      --replace "receiver.remaining_count" "op.remaining_count"
   '';
 
   passthru.updateScript = gitUpdater {