Skip to content
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

Merged
merged 1 commit into from May 12, 2018

Conversation

brian-dawn
Copy link
Member

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
  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

version = "2.11.0";

src = fetchurl {
url = "https://github.com/IntelRealSense/librealsense/archive/v${version}.tar.gz";
Copy link
Contributor

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"
Copy link
Contributor

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;
Copy link
Contributor

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
Copy link
Contributor

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
Copy link
Contributor

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.

@brian-dawn
Copy link
Member Author

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.

@matthewbauer matthewbauer merged commit 6f8cfae into NixOS:master May 12, 2018
@brian-dawn brian-dawn deleted the brian/add-librealsense branch May 12, 2018 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants