nixpkgs/pkgs/by-name/li/libinput-gestures/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

63 lines
1.8 KiB
Nix

{
lib,
stdenv,
fetchFromGitHub,
makeWrapper,
libinput,
wmctrl,
python3,
coreutils,
xdotool ? null,
extraUtilsPath ? lib.optional (xdotool != null) xdotool,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "libinput-gestures";
version = "2.77";
src = fetchFromGitHub {
owner = "bulletmark";
repo = "libinput-gestures";
rev = "refs/tags/${finalAttrs.version}";
hash = "sha256-eMXNlSgQSuN+/5SXJQjsylC1ygHS87sIEmnVGFk3pzA=";
};
patches = [
./0001-hardcode-name.patch
./0002-paths.patch
];
nativeBuildInputs = [ makeWrapper ];
buildInputs = [ python3 ];
postPatch = ''
substituteInPlace libinput-gestures-setup --replace-fail /usr/ /
substituteInPlace libinput-gestures \
--replace-fail /etc "$out/etc" \
--subst-var-by libinput "${libinput}/bin/libinput" \
--subst-var-by wmctrl "${wmctrl}/bin/wmctrl"
'';
installPhase = ''
runHook preInstall
${stdenv.shell} libinput-gestures-setup -d "$out" install
runHook postInstall
'';
postFixup = ''
rm "$out/bin/libinput-gestures-setup"
substituteInPlace "$out/share/systemd/user/libinput-gestures.service" --replace "/usr" "$out"
substituteInPlace "$out/share/applications/libinput-gestures.desktop" --replace "/usr" "$out"
chmod +x "$out/share/applications/libinput-gestures.desktop"
wrapProgram "$out/bin/libinput-gestures" --prefix PATH : "${
lib.makeBinPath ([ coreutils ] ++ extraUtilsPath)
}"
'';
meta = {
homepage = "https://github.com/bulletmark/libinput-gestures";
description = "Gesture mapper for libinput";
mainProgram = "libinput-gestures";
license = lib.licenses.gpl3Plus;
platforms = lib.platforms.linux;
maintainers = with lib.maintainers; [ teozkr ];
};
})