about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/librealsense
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/librealsense')
-rw-r--r--nixpkgs/pkgs/development/libraries/librealsense/default.nix24
1 files changed, 20 insertions, 4 deletions
diff --git a/nixpkgs/pkgs/development/libraries/librealsense/default.nix b/nixpkgs/pkgs/development/libraries/librealsense/default.nix
index 4015ab02a3a8..0011dc2f6e11 100644
--- a/nixpkgs/pkgs/development/libraries/librealsense/default.nix
+++ b/nixpkgs/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;
   };
 }