nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ lib
2, stdenv
3, fetchFromGitHub
4, git
5, withWayland ? true, cairo, libxkbcommon, wayland
6, withX ? true, libXi, libXinerama, libXft, libXfixes, libXtst, libX11, libXext
7}:
8
9stdenv.mkDerivation rec {
10 pname = "warpd";
11 version = "1.3.5";
12
13 src = fetchFromGitHub {
14 owner = "rvaiya";
15 repo = "warpd";
16 rev = "v${version}";
17 hash = "sha256-5B3Ec+R1vF2iI0ennYcsRlnFXJkSns0jVbyAWJA4lTU=";
18 leaveDotGit = true;
19 };
20
21 nativeBuildInputs = [ git ];
22
23 buildInputs = lib.optionals withWayland [
24 cairo
25 libxkbcommon
26 wayland
27 ] ++ lib.optionals withX [
28 libXi
29 libXinerama
30 libXft
31 libXfixes
32 libXtst
33 libX11
34 libXext
35 ];
36
37 makeFlags = [ "PREFIX=$(out)" ]
38 ++ lib.optional (!withWayland) "DISABLE_WAYLAND=y"
39 ++ lib.optional (!withX) "DISABLE_X=y";
40
41 postPatch = ''
42 substituteInPlace mk/linux.mk \
43 --replace '-m644' '-Dm644' \
44 --replace '-m755' '-Dm755' \
45 --replace 'warpd.1.gz $(DESTDIR)' 'warpd.1.gz -t $(DESTDIR)' \
46 --replace 'bin/warpd $(DESTDIR)' 'bin/warpd -t $(DESTDIR)'
47 '';
48
49 meta = with lib; {
50 description = "A modal keyboard driven interface for mouse manipulation.";
51 homepage = "https://github.com/rvaiya/warpd";
52 changelog = "https://github.com/rvaiya/warpd/blob/${src.rev}/CHANGELOG.md";
53 maintainers = with maintainers; [ hhydraa ];
54 license = licenses.mit;
55 platforms = platforms.linux;
56 };
57}