2021-01-19 06:50:56 +00:00
|
|
|
{ stdenv, lib, fetchFromGitHub, cmake, libusb1, pkg-config, freeglut, libGLU, libGL, libXi, libXmu
|
2018-03-14 22:11:51 +00:00
|
|
|
, GLUT, Cocoa
|
|
|
|
}:
|
2015-08-26 14:01:43 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "freenect";
|
2022-09-21 19:12:00 +00:00
|
|
|
version = "0.6.4";
|
2015-08-26 14:01:43 +00:00
|
|
|
|
2016-10-01 11:52:24 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "OpenKinect";
|
|
|
|
repo = "libfreenect";
|
|
|
|
rev = "v${version}";
|
2022-09-21 19:12:00 +00:00
|
|
|
sha256 = "sha256-G9Pa3EOUrHyfx+FyZZLsKTSk7MBpHtpJm7m/uSAoKTo=";
|
2015-09-02 08:26:29 +00:00
|
|
|
};
|
2015-08-26 14:01:43 +00:00
|
|
|
|
2020-04-04 07:44:12 +00:00
|
|
|
buildInputs = [ libusb1 freeglut libGLU libGL libXi libXmu ]
|
2018-03-14 22:11:51 +00:00
|
|
|
++ lib.optionals stdenv.isDarwin [ GLUT Cocoa ];
|
|
|
|
|
2021-01-19 06:50:56 +00:00
|
|
|
nativeBuildInputs = [ cmake pkg-config ];
|
2015-09-02 08:26:29 +00:00
|
|
|
|
2022-01-17 23:31:08 +00:00
|
|
|
# see https://aur.archlinux.org/cgit/aur.git/commit/PKGBUILD?h=libfreenect&id=0d17db49ba64bcb9e3a4eed61cf55c9a5ceb97f1
|
|
|
|
patchPhase = lib.concatMapStrings (x: ''
|
|
|
|
substituteInPlace ${x} --replace "{GLUT_LIBRARY}" "{GLUT_LIBRARIES}"
|
|
|
|
'') [ "examples/CMakeLists.txt" "wrappers/cpp/CMakeLists.txt" ];
|
|
|
|
|
2015-09-02 08:26:29 +00:00
|
|
|
meta = {
|
2017-08-06 22:05:18 +00:00
|
|
|
description = "Drivers and libraries for the Xbox Kinect device on Windows, Linux, and macOS";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "http://openkinect.org";
|
2018-03-14 22:11:51 +00:00
|
|
|
license = with lib.licenses; [ gpl2 asl20 ];
|
|
|
|
maintainers = with lib.maintainers; [ bennofs ];
|
|
|
|
platforms = with lib.platforms; linux ++ darwin ;
|
2015-09-02 08:26:29 +00:00
|
|
|
};
|
2015-08-26 14:01:43 +00:00
|
|
|
}
|