summary refs log tree commit diff
path: root/pkgs/development/libraries
diff options
context:
space:
mode:
authorPavol Rusnak <pavol@rusnak.io>2021-06-20 12:34:04 +0200
committerPavol Rusnak <pavol@rusnak.io>2021-06-20 12:37:28 +0200
commitd27721b3f369fb656a52a7c4026958a3ff45f68c (patch)
tree39bb5f79e15a8e4ccc59dd1451d30a565bdd3d1d /pkgs/development/libraries
parentfed9de5dec0d6ec7f6b9ca2b189dbc3b0c91b58f (diff)
downloadnixpkgs-d27721b3f369fb656a52a7c4026958a3ff45f68c.tar
nixpkgs-d27721b3f369fb656a52a7c4026958a3ff45f68c.tar.gz
nixpkgs-d27721b3f369fb656a52a7c4026958a3ff45f68c.tar.bz2
nixpkgs-d27721b3f369fb656a52a7c4026958a3ff45f68c.tar.lz
nixpkgs-d27721b3f369fb656a52a7c4026958a3ff45f68c.tar.xz
nixpkgs-d27721b3f369fb656a52a7c4026958a3ff45f68c.tar.zst
nixpkgs-d27721b3f369fb656a52a7c4026958a3ff45f68c.zip
librealsense: enable build on aarch64-darwin and aarch64-linux
Diffstat (limited to 'pkgs/development/libraries')
-rw-r--r--pkgs/development/libraries/librealsense/default.nix24
1 files changed, 20 insertions, 4 deletions
diff --git a/pkgs/development/libraries/librealsense/default.nix b/pkgs/development/libraries/librealsense/default.nix
index 4015ab02a3a..0011dc2f6e1 100644
--- a/pkgs/development/libraries/librealsense/default.nix
+++ b/pkgs/development/libraries/librealsense/default.nix
@@ -1,6 +1,16 @@
-{ stdenv, config, lib, fetchFromGitHub, cmake, libusb1, ninja, pkg-config, gcc
+{ stdenv
+, config
+, lib
+, fetchFromGitHub
+, fetchpatch
+, cmake
+, libusb1
+, ninja
+, pkg-config
+, gcc
 , cudaSupport ? config.cudaSupport or false, cudatoolkit
-, enablePython ? false, pythonPackages ? null }:
+, enablePython ? false, pythonPackages ? null
+}:
 
 assert cudaSupport -> cudatoolkit != null;
 assert enablePython -> pythonPackages != null;
@@ -24,7 +34,13 @@ stdenv.mkDerivation rec {
   ] ++ lib.optional cudaSupport cudatoolkit
     ++ lib.optionals enablePython (with pythonPackages; [python pybind11 ]);
 
-  patches = lib.optionals enablePython [
+  patches = [
+    # fix build on aarch64-darwin
+    # https://github.com/IntelRealSense/librealsense/pull/9253
+    (fetchpatch {
+      url = "https://github.com/IntelRealSense/librealsense/commit/beb4c44debc8336de991c983274cad841eb5c323.patch";
+      sha256 = "05mxsd2pz3xrvywdqyxkwdvxx8hjfxzcgl51897avz4v2j89pyq8";
+    })
     ./py_sitepackage_dir.patch
     ./py_pybind11_no_external_download.patch
   ];
@@ -57,6 +73,6 @@ stdenv.mkDerivation rec {
     homepage = "https://github.com/IntelRealSense/librealsense";
     license = licenses.asl20;
     maintainers = with maintainers; [ brian-dawn ];
-    platforms = [ "i686-linux" "x86_64-linux" "x86_64-darwin" ];
+    platforms = platforms.unix;
   };
 }