Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at 22.05 54 lines 1.6 kB view raw
1{ lib, stdenv, fetchFromGitHub, makeWrapper, 2 libinput, wmctrl, python3, 3 coreutils, xdotool ? null, 4 extraUtilsPath ? lib.optional (xdotool != null) xdotool 5}: 6stdenv.mkDerivation rec { 7 pname = "libinput-gestures"; 8 version = "2.72"; 9 10 src = fetchFromGitHub { 11 owner = "bulletmark"; 12 repo = "libinput-gestures"; 13 rev = version; 14 sha256 = "sha256-si94aKyiJtRwg+JS0PazqRjGrA/zUwN8CCIKI5KLJNw="; 15 }; 16 patches = [ 17 ./0001-hardcode-name.patch 18 ./0002-paths.patch 19 ]; 20 21 nativeBuildInputs = [ makeWrapper ]; 22 buildInputs = [ python3 ]; 23 24 postPatch = 25 '' 26 substituteInPlace libinput-gestures-setup --replace /usr/ / 27 28 substituteInPlace libinput-gestures \ 29 --replace /etc "$out/etc" \ 30 --subst-var-by libinput "${libinput}/bin/libinput" \ 31 --subst-var-by wmctrl "${wmctrl}/bin/wmctrl" 32 ''; 33 installPhase = 34 '' 35 runHook preInstall 36 ${stdenv.shell} libinput-gestures-setup -d "$out" install 37 runHook postInstall 38 ''; 39 postFixup = 40 '' 41 rm "$out/bin/libinput-gestures-setup" 42 substituteInPlace "$out/share/applications/libinput-gestures.desktop" --replace "/usr" "$out" 43 chmod +x "$out/share/applications/libinput-gestures.desktop" 44 wrapProgram "$out/bin/libinput-gestures" --prefix PATH : "${lib.makeBinPath ([coreutils] ++ extraUtilsPath)}" 45 ''; 46 47 meta = with lib; { 48 homepage = "https://github.com/bulletmark/libinput-gestures"; 49 description = "Gesture mapper for libinput"; 50 license = licenses.gpl3Plus; 51 platforms = platforms.linux; 52 maintainers = with maintainers; [ teozkr ]; 53 }; 54}