depot/third_party/nixpkgs/pkgs/development/libraries/freenect/default.nix
Default email 7e47f3658e Project import generated by Copybara.
GitOrigin-RevId: 1925c603f17fc89f4c8f6bf6f631a802ad85d784
2024-09-26 11:04:55 +00:00

33 lines
1.1 KiB
Nix

{ stdenv, lib, fetchFromGitHub, cmake, libusb1, pkg-config, libglut, libGLU, libGL, libXi, libXmu
, GLUT, Cocoa
}:
stdenv.mkDerivation rec {
pname = "freenect";
version = "0.7.5";
src = fetchFromGitHub {
owner = "OpenKinect";
repo = "libfreenect";
rev = "v${version}";
sha256 = "sha256-PpJGFWrlQ5sK7TJxQNoPujw1MxWRjphvblwOqnF+mSg=";
};
buildInputs = [ libusb1 libglut libGLU libGL libXi libXmu ]
++ lib.optionals stdenv.hostPlatform.isDarwin [ GLUT Cocoa ];
nativeBuildInputs = [ cmake pkg-config ];
# 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" ];
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 ;
};
}