2021-02-05 17:12:51 +00:00
|
|
|
{ stdenv, lib, fetchFromGitHub, cmake, libusb1, pkg-config, freeglut, libGLU, libGL, libXi, libXmu
|
2020-04-24 23:36:52 +00:00
|
|
|
, GLUT, Cocoa
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "freenect";
|
2023-05-24 13:37:59 +00:00
|
|
|
version = "0.7.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "OpenKinect";
|
|
|
|
repo = "libfreenect";
|
|
|
|
rev = "v${version}";
|
2023-05-24 13:37:59 +00:00
|
|
|
sha256 = "sha256-Lb5mrl9jiI1Z9UOAlP+bBPNoKNxm5VSrFZRvifEfhoU=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [ libusb1 freeglut libGLU libGL libXi libXmu ]
|
|
|
|
++ lib.optionals stdenv.isDarwin [ GLUT Cocoa ];
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
nativeBuildInputs = [ cmake pkg-config ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-01-19 23:45:15 +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" ];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
meta = {
|
|
|
|
description = "Drivers and libraries for the Xbox Kinect device on Windows, Linux, and macOS";
|
|
|
|
homepage = "http://openkinect.org";
|
|
|
|
license = with lib.licenses; [ gpl2 asl20 ];
|
|
|
|
maintainers = with lib.maintainers; [ bennofs ];
|
|
|
|
platforms = with lib.platforms; linux ++ darwin ;
|
|
|
|
};
|
|
|
|
}
|