1{ lib
2, stdenv
3, fetchFromSourcehut
4, writeText
5, libinput
6, libX11
7, wayland
8, conf ? null
9, patches ? [ ]
10}:
11
12stdenv.mkDerivation rec {
13 pname = "lisgd";
14 version = "0.3.2";
15
16 src = fetchFromSourcehut {
17 owner = "~mil";
18 repo = "lisgd";
19 rev = version;
20 sha256 = "sha256-yE2CUv1XDvo8fW0bLS1O2oxgDUu4drCO3jFpxPgAYKU=";
21 };
22
23 inherit patches;
24
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 '';
33
34 buildInputs = [
35 libinput
36 libX11
37 wayland
38 ];
39
40 makeFlags = [
41 "PREFIX=${placeholder "out"}"
42 ];
43
44 meta = with lib; {
45 description = "Bind gestures via libinput touch events";
46 homepage = "https://git.sr.ht/~mil/lisgd";
47 license = licenses.mit;
48 platforms = platforms.linux;
49 maintainers = with maintainers; [ dotlambda ];
50 };
51}