Unverified Commit 76a85de7 authored by Bobby Rong's avatar Bobby Rong Committed by GitHub
Browse files

Merge pull request #228083 from bobby285271/upd/warpinator

cinnamon.warpinator: 1.4.5 -> 1.6.1
parents 9b81bd5f 46a84aa1
Loading
Loading
Loading
Loading
+33 −26
Original line number Diff line number Diff line
{ 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 {