1 { stdenv, lib, fetchFromGitHub, fetchpatch, libX11, IOKit }:
3 stdenv.mkDerivation rec {
7 src = fetchFromGitHub {
8 owner = "FreeSpacenav";
11 sha256 = "1zz0cm5cgvp9s5n4nzksl8rb11c7sw214bdafzra74smvqfjcjcf";
15 # Fixes Darwin: https://github.com/FreeSpacenav/spacenavd/pull/38
17 url = "https://github.com/FreeSpacenav/spacenavd/commit/d6a25d5c3f49b9676d039775efc8bf854737c43c.patch";
18 sha256 = "02pdgcvaqc20qf9hi3r73nb9ds7yk2ps9nnxaj0x9p50xjnhfg5c";
20 # Changes the socket path from /run/spnav.sock to $XDG_RUNTIME_DIR/spnav.sock
21 # to allow for a user service
22 ./configure-socket-path.patch
23 # Changes the pidfile path from /run/spnavd.pid to $XDG_RUNTIME_DIR/spnavd.pid
24 # to allow for a user service
25 ./configure-pidfile-path.patch
26 # Changes the config file path from /etc/spnavrc to $XDG_CONFIG_HOME/spnavrc or $HOME/.config/spnavrc
27 # to allow for a user service
28 ./configure-cfgfile-path.patch
31 buildInputs = [ libX11 ]
32 ++ lib.optional stdenv.isDarwin IOKit;
34 configureFlags = [ "--disable-debug" ];
36 makeFlags = [ "CC=${stdenv.cc.targetPrefix}cc" ];
39 homepage = "http://spacenav.sourceforge.net/";
40 description = "Device driver and SDK for 3Dconnexion 3D input devices";
41 longDescription = "A free, compatible alternative, to the proprietary 3Dconnexion device driver and SDK, for their 3D input devices (called 'space navigator', 'space pilot', 'space traveller', etc)";
42 license = licenses.gpl3Plus;
43 platforms = platforms.unix;
44 maintainers = with maintainers; [ sohalt ];