Skip to content

Commit

Permalink
librealsenseWithCuda: add passthru.test.hasCudaObjects
Browse files Browse the repository at this point in the history
  • Loading branch information
pbsds committed Oct 27, 2024
1 parent 32ddc13 commit 810f298
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions pkgs/development/libraries/librealsense/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,19 @@
assert cudaSupport -> (cudaPackages?cudatoolkit && cudaPackages.cudatoolkit != null);
assert enablePython -> pythonPackages != null;

stdenv.mkDerivation rec {
pname = "librealsense";
stdenv.mkDerivation (finalAttrs: {
pname = "librealsense"
+ lib.optionalString enablePython "-py${pythonPackages.python.version}"
+ lib.optionalString cudaSupport "-cu${cudaPackages.cudatoolkit.version}"
+ lib.optionalString enableGUI "-gui";
version = "2.56.2";

outputs = [ "out" "dev" ];

src = fetchFromGitHub {
owner = "IntelRealSense";
repo = pname;
rev = "v${version}";
repo = "librealsense";
rev = "v${finalAttrs.version}";
sha256 = "sha256-7DO+AC9R6mnSs52ex/uIzEv7q+fS7FQ5FGYe5niap4Q=";
};

Expand Down Expand Up @@ -84,11 +87,17 @@ stdenv.mkDerivation rec {
cp ../wrappers/python/pyrealsense2/__init__.py $out/${pythonPackages.python.sitePackages}/pyrealsense2
'';

passthru.tests = lib.optionalAttrs cudaSupport {
hasCudaObjects = cudaPackages.testAnyCudaObject {
package = finalAttrs.finalPackage;
};
};

meta = with lib; {
description = "Cross-platform library for Intel® RealSense™ depth cameras (D400 series and the SR300)";
homepage = "https://github.com/IntelRealSense/librealsense";
license = licenses.asl20;
maintainers = with maintainers; [ brian-dawn pbsds ];
platforms = platforms.unix;
};
}
})

0 comments on commit 810f298

Please sign in to comment.