btrbk: add mainProgram (#356350)
[NixPkgs.git] / pkgs / by-name / li / lisgd / package.nix
blob23e677144945a2459f056b1576e4d87034f32b8a
1 { lib
2 , stdenv
3 , fetchFromSourcehut
4 , writeText
5 , libinput
6 , libX11
7 , wayland
8 , conf ? null
9 , patches ? [ ]
12 stdenv.mkDerivation rec {
13   pname = "lisgd";
14   version = "0.4.0";
16   src = fetchFromSourcehut {
17     owner = "~mil";
18     repo = "lisgd";
19     rev = version;
20     hash = "sha256-ljRZpBo4lW2cYZYxKKMrXanE0YaHSFwcdyECK0czdWY=";
21   };
23   inherit patches;
25   postPatch = let
26     configFile = if lib.isDerivation conf || lib.isPath conf then
27       conf
28     else
29       writeText "config.def.h" conf;
30   in lib.optionalString (conf != null) ''
31     cp ${configFile} config.def.h
32   '';
34   buildInputs = [
35     libinput
36     libX11
37     wayland
38   ];
40   makeFlags = [
41     "PREFIX=${placeholder "out"}"
42   ];
44   meta = with lib; {
45     description = "Bind gestures via libinput touch events";
46     mainProgram = "lisgd";
47     homepage = "https://git.sr.ht/~mil/lisgd";
48     license = licenses.mit;
49     platforms = platforms.linux;
50     maintainers = with maintainers; [ dotlambda ];
51   };