mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-27 23:33:30 +00:00
Merge pull request #273539 from bouk/bouk/upgrade-librealsense
librealsense: 2.45.0 -> 2.54.2
This commit is contained in:
commit
45bfb4ce9d
@ -23,7 +23,7 @@ assert enablePython -> pythonPackages != null;
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "librealsense";
|
||||
version = "2.45.0";
|
||||
version = "2.54.2";
|
||||
|
||||
outputs = [ "out" "dev" ];
|
||||
|
||||
@ -31,7 +31,7 @@ stdenv.mkDerivation rec {
|
||||
owner = "IntelRealSense";
|
||||
repo = pname;
|
||||
rev = "v${version}";
|
||||
sha256 = "0aqf48zl7825v7x8c3x5w4d17m4qq377f1mn6xyqzf9b0dnk4i1j";
|
||||
sha256 = "sha256-EbnIHnsUgsqN/SVv4m9H7K8gfwni+u82+M55QBstAGI=";
|
||||
};
|
||||
|
||||
buildInputs = [
|
||||
@ -42,22 +42,10 @@ stdenv.mkDerivation rec {
|
||||
++ lib.optionals enableGUI [ mesa gtk3 glfw libGLU curl ];
|
||||
|
||||
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
|
||||
./install-presets.patch
|
||||
];
|
||||
|
||||
postPatch = ''
|
||||
# https://github.com/IntelRealSense/librealsense/issues/11092
|
||||
# insert a "#include <iostream" at beginning of file
|
||||
sed '1i\#include <iostream>' -i wrappers/python/pyrs_device.cpp
|
||||
'';
|
||||
|
||||
nativeBuildInputs = [
|
||||
cmake
|
||||
ninja
|
||||
|
@ -0,0 +1,13 @@
|
||||
diff --git a/tools/realsense-viewer/CMakeLists.txt b/tools/realsense-viewer/CMakeLists.txt
|
||||
index 44be6278f..1a4531dff 100644
|
||||
--- a/tools/realsense-viewer/CMakeLists.txt
|
||||
+++ b/tools/realsense-viewer/CMakeLists.txt
|
||||
@@ -253,7 +253,7 @@ install(
|
||||
)
|
||||
#https://cmake.org/cmake/help/latest/command/install.html
|
||||
install(DIRECTORY presets/
|
||||
- DESTINATION $ENV{HOME}/Documents/librealsense2/presets
|
||||
+ DESTINATION $ENV{out}/share/librealsense2/presets
|
||||
FILES_MATCHING PATTERN "*.preset"
|
||||
)
|
||||
endif()
|
@ -1,39 +1,15 @@
|
||||
From 01e51b9c90ba51b2d0ca797dde676812cf3db415 Mon Sep 17 00:00:00 2001
|
||||
From: "Robert T. McGibbon" <rmcgibbo@gmail.com>
|
||||
Date: Mon, 10 May 2021 17:26:04 -0400
|
||||
Subject: [PATCH 1/1] V1
|
||||
|
||||
---
|
||||
wrappers/python/CMakeLists.txt | 15 +--------------
|
||||
1 file changed, 1 insertion(+), 14 deletions(-)
|
||||
|
||||
diff --git a/wrappers/python/CMakeLists.txt b/wrappers/python/CMakeLists.txt
|
||||
index aa83e4c77..4ec92ccfa 100644
|
||||
--- a/wrappers/python/CMakeLists.txt
|
||||
+++ b/wrappers/python/CMakeLists.txt
|
||||
@@ -8,21 +8,8 @@ if (NOT BUILD_PYTHON_BINDINGS)
|
||||
endif()
|
||||
diff --git a/CMake/global_config.cmake b/CMake/global_config.cmake
|
||||
index 350f7a268..2cf125c67 100644
|
||||
--- a/CMake/global_config.cmake
|
||||
+++ b/CMake/global_config.cmake
|
||||
@@ -69,7 +69,8 @@ macro(global_set_flags)
|
||||
|
||||
set(DEPENDENCIES realsense2)
|
||||
-# In order for the external project clone to occur during cmake configure step(rather than during compilation, as would normally happen),
|
||||
-# we copy the external project declaration to the build folder and then execute it
|
||||
-configure_file(${CMAKE_SOURCE_DIR}/third-party/pybind11/CMakeLists.txt ${CMAKE_BINARY_DIR}/external-projects/pybind11/CMakeLists.txt)
|
||||
-execute_process(COMMAND "${CMAKE_COMMAND}" -G "${CMAKE_GENERATOR}" .
|
||||
- WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/external-projects/pybind11"
|
||||
-)
|
||||
-execute_process(COMMAND "${CMAKE_COMMAND}" --build .
|
||||
- WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/external-projects/pybind11"
|
||||
-)
|
||||
if(BUILD_PYTHON_BINDINGS)
|
||||
include(libusb_config)
|
||||
- include(CMake/external_pybind11.cmake)
|
||||
+ find_package(pybind11 REQUIRED)
|
||||
+ set(PYTHON_INSTALL_DIR "${XXNIX_PYTHON_SITEPACKAGES}/pyrealsense2" CACHE PATH "Installation directory for Python bindings")
|
||||
endif()
|
||||
|
||||
-# Add pybind11 makefile
|
||||
-add_subdirectory("${CMAKE_BINARY_DIR}/third-party/pybind11"
|
||||
- "${CMAKE_BINARY_DIR}/third-party/pybind11"
|
||||
- EXCLUDE_FROM_ALL
|
||||
-)
|
||||
+find_package(pybind11 REQUIRED)
|
||||
|
||||
set(PYBIND11_CPP_STANDARD -std=c++11)
|
||||
# Force Pybind11 not to share pyrealsense2 resources with other pybind modules.
|
||||
--
|
||||
2.29.3
|
||||
if(CHECK_FOR_UPDATES)
|
||||
|
||||
|
@ -1,15 +0,0 @@
|
||||
--- a/wrappers/python/CMakeLists.txt
|
||||
+++ b/wrappers/python/CMakeLists.txt
|
||||
@@ -10,11 +10,11 @@
|
||||
if (CMAKE_VERSION VERSION_LESS 3.12)
|
||||
find_package(PythonInterp REQUIRED)
|
||||
find_package(PythonLibs REQUIRED)
|
||||
- set(PYTHON_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/pyrealsense2" CACHE PATH "Installation directory for Python bindings")
|
||||
+ set(PYTHON_INSTALL_DIR "${XXNIX_PYTHON_SITEPACKAGES}/pyrealsense2" CACHE PATH "Installation directory for Python bindings")
|
||||
set(CMAKECONFIG_PY_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}/cmake/pyrealsense2")
|
||||
else()
|
||||
find_package(Python REQUIRED COMPONENTS Interpreter Development)
|
||||
- set(PYTHON_INSTALL_DIR "${Python_SITEARCH}/pyrealsense2" CACHE PATH "Installation directory for Python bindings")
|
||||
+ set(PYTHON_INSTALL_DIR "${XXNIX_PYTHON_SITEPACKAGES}/pyrealsense2" CACHE PATH "Installation directory for Python bindings")
|
||||
set(CMAKECONFIG_PY_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}/cmake/pyrealsense2")
|
||||
endif()
|
Loading…
Reference in New Issue
Block a user