nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ stdenv, lib, fetchFromGitHub, libX11, fixDarwinDylibNames }:
2
3stdenv.mkDerivation rec {
4 version = "0.2.3";
5 pname = "libspnav";
6
7 src = fetchFromGitHub {
8 owner = "FreeSpacenav";
9 repo = "libspnav";
10 rev = "${pname}-${version}";
11 sha256 = "098h1jhlj87axpza5zgy58prp0zn94wyrbch6x0s7q4mzh7dc8ba";
12 };
13
14 nativeBuildInputs = lib.optional stdenv.isDarwin fixDarwinDylibNames;
15 buildInputs = [ libX11 ];
16
17 patches = [
18 # Changes the socket path from /run/spnav.sock to $XDG_RUNTIME_DIR/spnav.sock
19 # to allow for a user service
20 ./configure-socket-path.patch
21 ];
22
23 configureFlags = [ "--disable-debug"];
24 makeFlags = [ "CC=${stdenv.cc.targetPrefix}cc" ];
25
26 preInstall = ''
27 mkdir -p $out/{lib,include}
28 '';
29
30 meta = with lib; {
31 homepage = "http://spacenav.sourceforge.net/";
32 description = "Device driver and SDK for 3Dconnexion 3D input devices";
33 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)";
34 license = licenses.bsd3;
35 platforms = platforms.unix;
36 maintainers = with maintainers; [ sohalt ];
37 };
38}