From 7564809000aea811d68e8197e4304c7bb4e73f59 Mon Sep 17 00:00:00 2001 From: kraem Date: Mon, 14 Mar 2022 22:28:46 +0100 Subject: [PATCH] libinput-gestures: 2.39 -> 2.72 --- .../0001-hardcode-name.patch | 18 +++--- .../libinput-gestures/0002-paths.patch | 61 ++++++++----------- .../libinput-gestures/default.nix | 4 +- 3 files changed, 36 insertions(+), 47 deletions(-) diff --git a/pkgs/tools/inputmethods/libinput-gestures/0001-hardcode-name.patch b/pkgs/tools/inputmethods/libinput-gestures/0001-hardcode-name.patch index 4655879149d..f811343ee79 100644 --- a/pkgs/tools/inputmethods/libinput-gestures/0001-hardcode-name.patch +++ b/pkgs/tools/inputmethods/libinput-gestures/0001-hardcode-name.patch @@ -1,13 +1,13 @@ diff --git a/libinput-gestures b/libinput-gestures -index 66479b6..aca94ac 100755 +index 78c7c28..da04007 100755 --- a/libinput-gestures +++ b/libinput-gestures -@@ -6,7 +6,7 @@ from collections import OrderedDict - from pathlib import Path - from distutils.version import LooseVersion as Version - --PROG = Path(sys.argv[0]).stem -+PROG = "libinput-gestures" - +@@ -27,7 +27,7 @@ except ImportError: + + session_locked = False + +-PROGPATH = Path(sys.argv[0]) ++PROGPATH = Path("libinput-gestures") + PROGNAME = PROGPATH.stem + # Conf file containing gesture commands. - # Search first for user file then system file. diff --git a/pkgs/tools/inputmethods/libinput-gestures/0002-paths.patch b/pkgs/tools/inputmethods/libinput-gestures/0002-paths.patch index 407450c8bcc..a507625406f 100644 --- a/pkgs/tools/inputmethods/libinput-gestures/0002-paths.patch +++ b/pkgs/tools/inputmethods/libinput-gestures/0002-paths.patch @@ -1,45 +1,34 @@ diff --git a/libinput-gestures b/libinput-gestures -index aca94ac..c2f03ca 100755 +index 78c7c28..1a2c965 100755 --- a/libinput-gestures +++ b/libinput-gestures -@@ -77,7 +77,7 @@ def get_libinput_vers(): +@@ -87,11 +87,11 @@ def get_libinput_vers(): 'Return the libinput installed version number string' # Try to use newer libinput interface then fall back to old # (depreciated) interface. - res = run(('libinput', '--version'), check=False) + res = run(('@libinput@', '--version'), check=False) - return res.strip() if res else \ - run(('libinput-list-devices', '--version'), check=False) - -@@ -87,8 +87,8 @@ if not libvers: - sys.exit('libinput helper tools do not seem to be installed?') - - if Version(libvers) >= Version('1.8'): -- cmd_debug_events = 'libinput debug-events' -- cmd_list_devices = 'libinput list-devices' -+ cmd_debug_events = '@libinput@ debug-events' -+ cmd_list_devices = '@libinput@ list-devices' - else: - cmd_debug_events = 'libinput-debug-events' - cmd_list_devices = 'libinput-list-devices' -@@ -199,7 +199,7 @@ class COMMAND_internal(COMMAND): - - def run(self): - 'Get list of current workspaces and select next one' -- stdout = run(('wmctrl', '-d'), check=False) -+ stdout = run(('@wmctrl@', '-d'), check=False) - if not stdout: - # This command can fail on GNOME when you have only a single - # dynamic workspace using Xorg (probably a GNOME bug) so let's -@@ -233,7 +233,7 @@ class COMMAND_internal(COMMAND): - - # Switch to desired workspace - if index >= minindex and index < maxindex: -- run(('wmctrl', '-s', str(index))) -+ run(('@wmctrl@', '-s', str(index))) - - # Table of gesture handlers - handlers = OrderedDict() --- -2.19.1 + if res: + return res.strip(), True +- res = run(('libinput-list-devices', '--version'), check=False) ++ res = run(('@libinput-list-devices@', '--version'), check=False) + return res and res.strip(), False + + def get_devices_list(cmd_list_devices, device_list): +@@ -694,11 +694,11 @@ def main(): + sys.exit('libinput helper tools do not seem to be installed?') + + if has_subcmd: +- cmd_debug_events = 'libinput debug-events' +- cmd_list_devices = 'libinput list-devices' ++ cmd_debug_events = '@libinput@ debug-events' ++ cmd_list_devices = '@libinput@ list-devices' + else: +- cmd_debug_events = 'libinput-debug-events' +- cmd_list_devices = 'libinput-list-devices' ++ cmd_debug_events = '@libinput@-debug-events' ++ cmd_list_devices = '@libinput@-list-devices' + + if args.verbose: + # Output various info/version info diff --git a/pkgs/tools/inputmethods/libinput-gestures/default.nix b/pkgs/tools/inputmethods/libinput-gestures/default.nix index 1d0ea40e34f..52ef02b24f9 100644 --- a/pkgs/tools/inputmethods/libinput-gestures/default.nix +++ b/pkgs/tools/inputmethods/libinput-gestures/default.nix @@ -5,13 +5,13 @@ }: stdenv.mkDerivation rec { pname = "libinput-gestures"; - version = "2.39"; + version = "2.72"; src = fetchFromGitHub { owner = "bulletmark"; repo = "libinput-gestures"; rev = version; - sha256 = "0bzyi55yhr9wyar9mnd09cr6pi88jkkp0f9lndm0a9jwi1xr4bdf"; + sha256 = "sha256-si94aKyiJtRwg+JS0PazqRjGrA/zUwN8CCIKI5KLJNw="; }; patches = [ ./0001-hardcode-name.patch