nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ stdenv, lib, fetchFromGitHub, pkg-config, gtk2 }:
2
3stdenv.mkDerivation rec {
4 pname = "spnavcfg";
5 version = "0.3.1";
6
7 src = fetchFromGitHub {
8 owner = "FreeSpacenav";
9 repo = pname;
10 rev = "v${version}";
11 sha256 = "180mkdis15gxs79rr3f7hpwa1p6v81bybw37pzzdjnmqwqrc08a0";
12 };
13
14 patches = [
15 # Changes the pidfile path from /run/spnavd.pid to $XDG_RUNTIME_DIR/spnavd.pid
16 # to allow for a user service
17 ./configure-pidfile-path.patch
18 # Changes the config file path from /etc/spnavrc to $XDG_CONFIG_HOME/spnavrc or $HOME/.config/spnavrc
19 # to allow for a user service
20 ./configure-cfgfile-path.patch
21 ];
22
23 postPatch = ''
24 sed -i s/4775/775/ Makefile.in
25 '';
26
27 nativeBuildInputs = [ pkg-config ];
28 buildInputs = [ gtk2 ];
29
30 makeFlags = [ "CC=${stdenv.cc.targetPrefix}cc" ];
31
32 meta = with lib; {
33 homepage = "https://spacenav.sourceforge.net/";
34 description = "Interactive configuration GUI for space navigator input devices";
35 license = licenses.gpl3Plus;
36 platforms = platforms.unix;
37 maintainers = with maintainers; [ gebner ];
38 };
39}