nixpkgs-suyu/pkgs/tools/inputmethods/lisgd/default.nix
2023-02-01 18:28:03 -08:00

51 lines
947 B
Nix

{ lib
, stdenv
, fetchFromSourcehut
, writeText
, libinput
, libX11
, wayland
, conf ? null
, patches ? [ ]
}:
stdenv.mkDerivation rec {
pname = "lisgd";
version = "0.3.7";
src = fetchFromSourcehut {
owner = "~mil";
repo = "lisgd";
rev = version;
hash = "sha256-3kmGpgZpCH7CkN+d1+5ygXOi8E0Ojcgw6Fbd0T9z7z0=";
};
inherit patches;
postPatch = let
configFile = if lib.isDerivation conf || lib.isPath conf then
conf
else
writeText "config.def.h" conf;
in lib.optionalString (conf != null) ''
cp ${configFile} config.def.h
'';
buildInputs = [
libinput
libX11
wayland
];
makeFlags = [
"PREFIX=${placeholder "out"}"
];
meta = with lib; {
description = "Bind gestures via libinput touch events";
homepage = "https://git.sr.ht/~mil/lisgd";
license = licenses.mit;
platforms = platforms.linux;
maintainers = with maintainers; [ dotlambda ];
};
}