From 46a84aa1b700e18cea536ff165eaecf26103cbae Mon Sep 17 00:00:00 2001 From: Bobby Rong Date: Tue, 25 Apr 2023 12:53:30 +0800 Subject: [PATCH] cinnamon.warpinator: 1.4.5 -> 1.6.1 https://github.com/linuxmint/warpinator/compare/1.4.5...1.6.1 --- pkgs/desktops/cinnamon/warpinator/default.nix | 59 +++++++++++-------- 1 file changed, 33 insertions(+), 26 deletions(-) diff --git a/pkgs/desktops/cinnamon/warpinator/default.nix b/pkgs/desktops/cinnamon/warpinator/default.nix index a488baab0071..fbf5df1fc7ce 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 + # 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" - preFixup = '' - # these get loaded via import from bin, so don't need wrapping - chmod -x+X $out/libexec/warpinator/*.py - - 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 {