diff options
author | Peder Bergebakken Sundt <pbsds@hotmail.com> | 2022-05-26 21:09:56 +0200 |
---|---|---|
committer | Peder Bergebakken Sundt <pbsds@hotmail.com> | 2022-08-07 02:59:36 +0200 |
commit | 6a5f7b66ca60fe4df2210b4de25e938642468100 (patch) | |
tree | d46669c0190085e556b1eb20d1644e7bea233572 | |
parent | 7adf1db45066efa315c3488eeed92c53b778d2aa (diff) |
librealsense: add enableGUI option
This option enables compilation of the realsense-viewer example application.
Fixes #165140
-rw-r--r-- | pkgs/development/libraries/librealsense/default.nix | 16 | ||||
-rw-r--r-- | pkgs/top-level/all-packages.nix | 4 |
2 files changed, 16 insertions, 4 deletions
diff --git a/pkgs/development/libraries/librealsense/default.nix b/pkgs/development/libraries/librealsense/default.nix index 5b1673ae3729..135969210d36 100644 --- a/pkgs/development/libraries/librealsense/default.nix +++ b/pkgs/development/libraries/librealsense/default.nix @@ -8,8 +8,14 @@ , ninja , pkg-config , gcc +, mesa +, gtk3 +, glfw +, libGLU +, curl , cudaSupport ? config.cudaSupport or false, cudaPackages ? {} , enablePython ? false, pythonPackages ? null +, enableGUI ? false, }: assert cudaSupport -> (cudaPackages?cudatoolkit && cudaPackages.cudatoolkit != null); @@ -32,7 +38,8 @@ stdenv.mkDerivation rec { libusb1 gcc.cc.lib ] ++ lib.optional cudaSupport cudaPackages.cudatoolkit - ++ lib.optionals enablePython (with pythonPackages; [python pybind11 ]); + ++ lib.optionals enablePython (with pythonPackages; [ python pybind11 ]) + ++ lib.optionals enableGUI [ mesa gtk3 glfw libGLU curl ]; patches = [ # fix build on aarch64-darwin @@ -53,8 +60,9 @@ stdenv.mkDerivation rec { cmakeFlags = [ "-DBUILD_EXAMPLES=ON" - "-DBUILD_GRAPHICAL_EXAMPLES=OFF" - "-DBUILD_GLSL_EXTENSIONS=OFF" + "-DBUILD_GRAPHICAL_EXAMPLES=${lib.boolToString enableGUI}" + "-DBUILD_GLSL_EXTENSIONS=${lib.boolToString enableGUI}" + "-DCHECK_FOR_UPDATES=OFF" # activated by BUILD_GRAPHICAL_EXAMPLES, will make it download and compile libcurl ] ++ lib.optionals enablePython [ "-DBUILD_PYTHON_BINDINGS:bool=true" "-DXXNIX_PYTHON_SITEPACKAGES=${placeholder "out"}/${pythonPackages.python.sitePackages}" @@ -72,7 +80,7 @@ stdenv.mkDerivation rec { description = "A 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 ]; + maintainers = with maintainers; [ brian-dawn pbsds ]; platforms = platforms.unix; }; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index a7ab64e64225..1c4153826f3c 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -23319,6 +23319,10 @@ with pkgs; cudaSupport = false; }; + librealsense-gui = callPackage ../development/libraries/librealsense { + enableGUI = true; + }; + libsass = callPackage ../development/libraries/libsass { }; libsepol = callPackage ../os-specific/linux/libsepol { }; |