-
-
Notifications
You must be signed in to change notification settings - Fork 15.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
librealsense: init at 2.11.0 #40225
librealsense: init at 2.11.0 #40225
Conversation
version = "2.11.0"; | ||
|
||
src = fetchurl { | ||
url = "https://github.com/IntelRealSense/librealsense/archive/v${version}.tar.gz"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should be able to use fetchFromGithub
.
enableParallelBuilding = true; | ||
|
||
preConfigure = '' | ||
cmakeFlags="$cmakeFlags -DBUILD_EXAMPLES=false" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use cmakeFlags = [ "-DBUILD_EXAMPLES=false" ]
attribute in nix.
cmake | ||
]; | ||
|
||
enableParallelBuilding = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cmake builds in parallel by default.
}; | ||
|
||
nativeBuildInputs = [ | ||
libusb |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nativeBuildInputs
targets the build
platform during cross-compilation. Unless you use some utility from libusb
during, it should be moved to buildInputs
.
nativeBuildInputs = [ | ||
libusb | ||
pkgconfig | ||
cmake |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When using cmake
, it is a good idea to add ninja
as well – it will run slightly faster than the Make backend.
26c92cf
to
8a9402c
Compare
Thanks for the review @jtojnar I think I should have addressed all your comments. It seems I can't access your review anymore, the contributors guide recommended avoiding multiple commits so I have squashed it down. I'm not used to GitHub so my apologies if that was the wrong workflow. |
Motivation for this change
The librealsense library is used to drive a series of depth cameras from Intel. The package doesn't depend on much and would be helpful to those of us who use nix for C++ building.
This is my first contribution to nixpkg so please let me know if I did anything wrong! Unfortunately testing the library is difficult as it requires having a realsense camera to really test it. I was able to test it on my machine using Ubuntu 16.04 and an intel D435.
Things done
build-use-sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)