GNU bug report logs - #49970
[PATCH] gnu: Add librealsense.

Previous Next

Package: guix-patches;

Reported by: phodina <phodina <at> protonmail.com>

Date: Mon, 9 Aug 2021 20:55:01 UTC

Severity: normal

Tags: patch

To reply to this bug, email your comments to 49970 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#49970; Package guix-patches. (Mon, 09 Aug 2021 20:55:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to phodina <phodina <at> protonmail.com>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Mon, 09 Aug 2021 20:55:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: phodina <phodina <at> protonmail.com>
To: "guix-patches <at> gnu.org" <guix-patches <at> gnu.org>
Subject: [PATCH] gnu: Add librealsense.
Date: Mon, 09 Aug 2021 20:54:04 +0000
* gnu/packages/video.scm (librealsense): New variable.

diff --git a/gnu/packages/video.scm b/gnu/packages/video.scm
index 399327741f..1d4a8ad3df 100644
--- a/gnu/packages/video.scm
+++ b/gnu/packages/video.scm
@@ -53,6 +53,7 @@
 ;;; Copyright © 2021 Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
 ;;; Copyright © 2020 Hartmut Goebel <h.goebel <at> crazy-compilers.com>
 ;;; Copyright © 2021 Raghav Gururajan <rg <at> raghavgururajan.name>
+;;; Copyright © 2021 Petr Hodina <phodina <at> protonmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -145,6 +146,7 @@
   #:use-module (gnu packages mp3)
   #:use-module (gnu packages ncurses)
   #:use-module (gnu packages networking)
+  #:use-module (gnu packages ninja)
   #:use-module (gnu packages ocr)
   #:use-module (gnu packages pcre)
   #:use-module (gnu packages perl)
@@ -577,6 +579,53 @@ other software.")
       ;; Library.
       license:lgpl3+))))

+(define-public librealsense
+ (package
+  (name "librealsense")
+  (version "2.45.0")
+  (source (origin
+           (method git-fetch)
+           (uri (git-reference
+                 (url "https://github.com/IntelRealSense/librealsense")
+                 (commit (string-append "v" version))))
+           (patches
+            (search-patches "librealsense-remove-network-connectivity.patch"))
+           (file-name (git-file-name name version))
+           (modules '((guix build utils)))
+            (sha256
+             (base32
+              "0aqf48zl7825v7x8c3x5w4d17m4qq377f1mn6xyqzf9b0dnk4i1j"))))
+  (build-system cmake-build-system)
+  (arguments
+       `(#:tests? #f
+         #:configure-flags (list "-DBUILD_EXAMPLES=ON"
+                                 "-DBUILD_GRAPHICAL_EXAMPLES=ON"
+                                 "-DINTERNET_CONNECTION=OFF"
+                                 "-DCHECK_FOR_UPDATES=OFF")
+         #:phases
+           (modify-phases %standard-phases
+            ;; more convenient than manually invoking setup_udev_rules.sh
+            ;; and substituting the path in the script
+            (add-after 'install 'copy-udev-rules
+              (lambda* (#:key outputs #:allow-other-keys)
+               (let ((out (assoc-ref outputs "out")))
+               (mkdir-p (string-append out "/etc/udev/rules.d"))
+               (copy-file "config/99-realsense-libusb.rules"
+                          (string-append out
+                           "/etc/udev/rules.d/99-realsense-libusb.rules"))))))))
+  (native-inputs `(("pkg-config" ,pkg-config)
+                   ("ninja" ,ninja)))
+  (inputs `(("glfw" ,glfw)
+            ("gtk+" ,gtk+)
+            ("libusb" ,libusb)
+            ("glu" ,glu)))
+  (synopsis "Intel RealSense SDK")
+  (description "Intel RealSense SDK 2.0 is a cross-platform library for
+Intel RealSense depth cameras (D400 & L500 series and the SR300) and the
+T265 tracking camera.")
+  (home-page "https://github.com/IntelRealSense/librealsense")
+  (license license:gpl3)))
+
 (define-public tslib
   (package
     (name "tslib")
--
2.32.0




Information forwarded to guix-patches <at> gnu.org:
bug#49970; Package guix-patches. (Tue, 10 Aug 2021 08:02:02 GMT) Full text and rfc822 format available.

Message #8 received at 49970 <at> debbugs.gnu.org (full text, mbox):

From: phodina <phodina <at> protonmail.com>
To: "49970 <at> debbugs.gnu.org" <49970 <at> debbugs.gnu.org>
Subject: [PATCH v2] gnu: Add librealsense.
Date: Tue, 10 Aug 2021 08:01:11 +0000
* gnu/packages/video.scm (librealsense): New variable.
* gnu/packages/patches/librealsense-remove-network-connectivity.patch: New file.

diff --git a/gnu/packages/patches/librealsense-remove-network-connectivity.patch b/gnu/packages/patches/librealsense-remove-network-connectivity.patch
new file mode 100644
index 0000000000..73926587ff
--- /dev/null
+++ b/gnu/packages/patches/librealsense-remove-network-connectivity.patch
@@ -0,0 +1,68 @@
+From cfc87289d7636f439e2b91d88e35430949b29c0f Mon Sep 17 00:00:00 2001
+From: Petr Hodina <phodina <at> protonmail.com>
+Date: Sat, 31 Jul 2021 05:58:40 +0200
+Subject: [PATCH] Remove network connectivity
+
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 0c15d9510..a4d891444 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -3,7 +3,6 @@ cmake_minimum_required(VERSION 3.1.0)
+ project(librealsense2 LANGUAGES CXX C)
+
+ include(CMake/lrs_options.cmake)
+-include(CMake/connectivity_check.cmake)
+
+ #Deprecation message, should be removed in future releases
+ if(${FORCE_LIBUVC} OR ${FORCE_WINUSB_UVC} OR ${ANDROID_USB_HOST_UVC})
+@@ -12,14 +11,12 @@ if(${FORCE_LIBUVC} OR ${FORCE_WINUSB_UVC} OR ${ANDROID_USB_HOST_UVC})
+ endif()
+
+ # Checking Internet connection, as TM2 needs to download the FW from amazon cloud
+-if(BUILD_WITH_TM2 AND NOT INTERNET_CONNECTION)
+-    message(WARNING "No internet connection, disabling BUILD_WITH_TM2")
++if(BUILD_WITH_TM2)
+     set(BUILD_WITH_TM2 OFF)
+ endif()
+
+ # Checking Internet connection, as DEPTH CAM needs to download the FW from amazon cloud
+-if(IMPORT_DEPTH_CAM_FW AND NOT INTERNET_CONNECTION)
+-    message(WARNING "No internet connection, disabling IMPORT_DEPTH_CAM_FW")
++if(IMPORT_DEPTH_CAM_FW)
+     set(IMPORT_DEPTH_CAM_FW OFF)
+ endif()
+
+diff --git a/common/fw/CMakeLists.txt b/common/fw/CMakeLists.txt
+index 32b1dd29a..9961e4d1d 100644
+--- a/common/fw/CMakeLists.txt
++++ b/common/fw/CMakeLists.txt
+@@ -6,8 +6,6 @@ project(fw)
+
+ file(READ "firmware-version.h" ver)
+
+-message(STATUS "Fetching recommended firmwares:")
+-
+ set(REALSENSE_FIRMWARE_URL "https://librealsense.intel.com" CACHE STRING
+     "URL to download firmware binaries from")
+
+@@ -51,16 +49,6 @@ set_target_properties (${PROJECT_NAME} PROPERTIES FOLDER Resources)
+
+ function(target_binary url version sha1 symbol ext)
+   set(binary "${CMAKE_CURRENT_BINARY_DIR}/${symbol}-${version}${ext}")
+-  message(STATUS "${url}/${symbol}-${version}${ext}")
+-  file(DOWNLOAD "${url}/${symbol}-${version}${ext}" "${binary}"
+-       EXPECTED_HASH SHA1=${sha1}
+-       STATUS status)
+-  list(GET status 0 error_code)
+-  if (NOT ${error_code} EQUAL 0)
+-    message(FATAL_ERROR "Download firmwnare (${status}) - ${url}")
+-  else()
+-    message(STATUS "Download firmware ${status} for ${symbol}-${version}${ext}")
+-  endif()
+   string(TOUPPER ${symbol} SYMBOL)
+   string(REPLACE "." "," version_commas ${version})
+   string(REPLACE "\\" "\\\\" binary_escaped "${binary}")
+--
+2.32.0
+
diff --git a/gnu/packages/video.scm b/gnu/packages/video.scm
index 399327741f..73009e97d5 100644
--- a/gnu/packages/video.scm
+++ b/gnu/packages/video.scm
@@ -53,6 +53,7 @@
 ;;; Copyright © 2021 Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
 ;;; Copyright © 2020 Hartmut Goebel <h.goebel <at> crazy-compilers.com>
 ;;; Copyright © 2021 Raghav Gururajan <rg <at> raghavgururajan.name>
+;;; Copyright © 2021 Petr Hodina <phodina <at> protonmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -145,6 +146,7 @@
   #:use-module (gnu packages mp3)
   #:use-module (gnu packages ncurses)
   #:use-module (gnu packages networking)
+  #:use-module (gnu packages ninja)
   #:use-module (gnu packages ocr)
   #:use-module (gnu packages pcre)
   #:use-module (gnu packages perl)
@@ -577,6 +579,54 @@ other software.")
       ;; Library.
       license:lgpl3+))))

+(define-public librealsense
+ (package
+  (name "librealsense")
+  (version "2.47.0")
+  (source (origin
+           (method git-fetch)
+           (uri (git-reference
+                 (url "https://github.com/IntelRealSense/librealsense")
+                 (commit (string-append "v" version))))
+           (patches
+            (search-patches "librealsense-remove-network-connectivity.patch"))
+           (file-name (git-file-name name version))
+           (modules '((guix build utils)))
+            (sha256
+             (base32
+              "1jshhcnvbaa3xm5jr1s5m6z62wn1cspb7wkfdc1w88kp9j02ss8w"))))
+  (build-system cmake-build-system)
+  (arguments
+       `(#:tests? #f ; no tests
+         #:configure-flags (list "-DBUILD_EXAMPLES=ON"
+                                 "-DBUILD_GRAPHICAL_EXAMPLES=ON"
+                                 "-DINTERNET_CONNECTION=OFF"
+                                 "-DCHECK_FOR_UPDATES=OFF")
+         #:phases
+           (modify-phases %standard-phases
+            ;; more convenient than manually invoking setup_udev_rules.sh
+            ;; and substituting the path in the script
+            (add-after 'unpack 'copy-udev-rules
+              (lambda* (#:key outputs #:allow-other-keys)
+               (let ((out (string-append (assoc-ref outputs "out")
+                            "/etc/udev/rules.d")))
+               (mkdir-p (string-append out))
+               (copy-file "config/99-realsense-libusb.rules"
+                          (string-append out
+                           "/99-realsense-libusb.rules"))))))))
+  (native-inputs `(("pkg-config" ,pkg-config)
+                   ("ninja" ,ninja)))
+  (inputs `(("glfw" ,glfw)
+            ("gtk+" ,gtk+)
+            ("libusb" ,libusb)
+            ("glu" ,glu)))
+  (synopsis "Intel RealSense SDK")
+  (description "Intel RealSense SDK 2.0 is a cross-platform library for
+Intel RealSense depth cameras (D400 & L500 series and the SR300) and the
+T265 tracking camera.")
+  (home-page "https://github.com/IntelRealSense/librealsense")
+  (license license:gpl3)))
+
 (define-public tslib
   (package
     (name "tslib")
--
2.32.0




Information forwarded to guix-patches <at> gnu.org:
bug#49970; Package guix-patches. (Sat, 18 Sep 2021 08:06:01 GMT) Full text and rfc822 format available.

Message #11 received at 49970 <at> debbugs.gnu.org (full text, mbox):

From: phodina <phodina <at> protonmail.com>
To: "49970 <at> debbugs.gnu.org" <49970 <at> debbugs.gnu.org>
Subject: Patch status
Date: Sat, 18 Sep 2021 08:05:13 +0000
Hi!

Is there anything to be improved to upstream this patch?




Information forwarded to guix-patches <at> gnu.org:
bug#49970; Package guix-patches. (Sat, 18 Sep 2021 11:13:02 GMT) Full text and rfc822 format available.

Message #14 received at 49970 <at> debbugs.gnu.org (full text, mbox):

From: Liliana Marie Prikler <liliana.prikler <at> gmail.com>
To: phodina <phodina <at> protonmail.com>, 49970 <at> debbugs.gnu.org
Subject: Re: [PATCH] gnu: Add librealsense.
Date: Sat, 18 Sep 2021 13:12:15 +0200
Hi,

Am Montag, den 09.08.2021, 20:54 +0000 schrieb phodina:
> * gnu/packages/video.scm (librealsense): New variable.
> 
> diff --git a/gnu/packages/video.scm b/gnu/packages/video.scm
> index 399327741f..1d4a8ad3df 100644
> --- a/gnu/packages/video.scm
> +++ b/gnu/packages/video.scm
> @@ -53,6 +53,7 @@
>  ;;; Copyright © 2021 Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
>  ;;; Copyright © 2020 Hartmut Goebel <h.goebel <at> crazy-compilers.com>
>  ;;; Copyright © 2021 Raghav Gururajan <rg <at> raghavgururajan.name>
> +;;; Copyright © 2021 Petr Hodina <phodina <at> protonmail.com>
>  ;;;
>  ;;; This file is part of GNU Guix.
>  ;;;
> @@ -145,6 +146,7 @@
>    #:use-module (gnu packages mp3)
>    #:use-module (gnu packages ncurses)
>    #:use-module (gnu packages networking)
> +  #:use-module (gnu packages ninja)
>    #:use-module (gnu packages ocr)
>    #:use-module (gnu packages pcre)
>    #:use-module (gnu packages perl)
> @@ -577,6 +579,53 @@ other software.")
>        ;; Library.
>        license:lgpl3+))))
> 
> +(define-public librealsense
> + (package
> +  (name "librealsense")
> +  (version "2.45.0")
> +  (source (origin
> +           (method git-fetch)
> +           (uri (git-reference
> +                 (url "
> https://github.com/IntelRealSense/librealsense")
> +                 (commit (string-append "v" version))))
> +           (patches
> +            (search-patches "librealsense-remove-network-
> connectivity.patch"))
> +           (file-name (git-file-name name version))
> +           (modules '((guix build utils)))
> +            (sha256
> +             (base32
> +              "0aqf48zl7825v7x8c3x5w4d17m4qq377f1mn6xyqzf9b0dnk4i1j"
> ))))
> +  (build-system cmake-build-system)
> +  (arguments
> +       `(#:tests? #f
Always explain why you're disabling tests.
> +         #:configure-flags (list "-DBUILD_EXAMPLES=ON"
> +                                 "-DBUILD_GRAPHICAL_EXAMPLES=ON"
> +                                 "-DINTERNET_CONNECTION=OFF"
> +                                 "-DCHECK_FOR_UPDATES=OFF")
> +         #:phases
> +           (modify-phases %standard-phases
> +            ;; more convenient than manually invoking
> setup_udev_rules.sh
> +            ;; and substituting the path in the script
> +            (add-after 'install 'copy-udev-rules
> +              (lambda* (#:key outputs #:allow-other-keys)
> +               (let ((out (assoc-ref outputs "out")))
> +               (mkdir-p (string-append out "/etc/udev/rules.d"))
> +               (copy-file "config/99-realsense-libusb.rules"
> +                          (string-append out
> +                           "/etc/udev/rules.d/99-realsense-
> libusb.rules"))))))))
Note that udev-service-type only searches /lib/udev, not /etc/udev.
> +  (native-inputs `(("pkg-config" ,pkg-config)
> +                   ("ninja" ,ninja)))
> +  (inputs `(("glfw" ,glfw)
> +            ("gtk+" ,gtk+)
> +            ("libusb" ,libusb)
> +            ("glu" ,glu)))
> +  (synopsis "Intel RealSense SDK")
> +  (description "Intel RealSense SDK 2.0 is a cross-platform library
> for
> +Intel RealSense depth cameras (D400 & L500 series and the SR300) and
> the
> +T265 tracking camera.")
> +  (home-page "https://github.com/IntelRealSense/librealsense")
> +  (license license:gpl3)))
This package seems to be covered under an Apache license, not the GPL.

Regards





Information forwarded to guix-patches <at> gnu.org:
bug#49970; Package guix-patches. (Sat, 18 Sep 2021 11:49:01 GMT) Full text and rfc822 format available.

Message #17 received at 49970 <at> debbugs.gnu.org (full text, mbox):

From: phodina <phodina <at> protonmail.com>
To: Liliana Marie Prikler <liliana.prikler <at> gmail.com>
Cc: 49970 <at> debbugs.gnu.org
Subject: Re: [PATCH] gnu: Add librealsense.
Date: Sat, 18 Sep 2021 11:47:54 +0000
Hi Liliana,

thanks for the comment! My appology for the licence.
--8<---------------cut here---------------start------------->8---
* gnu/packages/video.scm (librealsense): New variable.
* gnu/packages/patches/librealsense-remove-network-connectivity.patch: New file.

diff --git a/gnu/packages/patches/librealsense-remove-network-connectivity.patch b/gnu/packages/patches/librealsense-remove-network-connectivity.patch
new file mode 100644
index 0000000000..73926587ff
--- /dev/null
+++ b/gnu/packages/patches/librealsense-remove-network-connectivity.patch
@@ -0,0 +1,68 @@
+From cfc87289d7636f439e2b91d88e35430949b29c0f Mon Sep 17 00:00:00 2001
+From: Petr Hodina <phodina <at> protonmail.com>
+Date: Sat, 31 Jul 2021 05:58:40 +0200
+Subject: [PATCH] Remove network connectivity
+
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 0c15d9510..a4d891444 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -3,7 +3,6 @@ cmake_minimum_required(VERSION 3.1.0)
+ project(librealsense2 LANGUAGES CXX C)
+
+ include(CMake/lrs_options.cmake)
+-include(CMake/connectivity_check.cmake)
+
+ #Deprecation message, should be removed in future releases
+ if(${FORCE_LIBUVC} OR ${FORCE_WINUSB_UVC} OR ${ANDROID_USB_HOST_UVC})
+@@ -12,14 +11,12 @@ if(${FORCE_LIBUVC} OR ${FORCE_WINUSB_UVC} OR ${ANDROID_USB_HOST_UVC})
+ endif()
+
+ # Checking Internet connection, as TM2 needs to download the FW from amazon cloud
+-if(BUILD_WITH_TM2 AND NOT INTERNET_CONNECTION)
+-    message(WARNING "No internet connection, disabling BUILD_WITH_TM2")
++if(BUILD_WITH_TM2)
+     set(BUILD_WITH_TM2 OFF)
+ endif()
+
+ # Checking Internet connection, as DEPTH CAM needs to download the FW from amazon cloud
+-if(IMPORT_DEPTH_CAM_FW AND NOT INTERNET_CONNECTION)
+-    message(WARNING "No internet connection, disabling IMPORT_DEPTH_CAM_FW")
++if(IMPORT_DEPTH_CAM_FW)
+     set(IMPORT_DEPTH_CAM_FW OFF)
+ endif()
+
+diff --git a/common/fw/CMakeLists.txt b/common/fw/CMakeLists.txt
+index 32b1dd29a..9961e4d1d 100644
+--- a/common/fw/CMakeLists.txt
++++ b/common/fw/CMakeLists.txt
+@@ -6,8 +6,6 @@ project(fw)
+
+ file(READ "firmware-version.h" ver)
+
+-message(STATUS "Fetching recommended firmwares:")
+-
+ set(REALSENSE_FIRMWARE_URL "https://librealsense.intel.com" CACHE STRING
+     "URL to download firmware binaries from")
+
+@@ -51,16 +49,6 @@ set_target_properties (${PROJECT_NAME} PROPERTIES FOLDER Resources)
+
+ function(target_binary url version sha1 symbol ext)
+   set(binary "${CMAKE_CURRENT_BINARY_DIR}/${symbol}-${version}${ext}")
+-  message(STATUS "${url}/${symbol}-${version}${ext}")
+-  file(DOWNLOAD "${url}/${symbol}-${version}${ext}" "${binary}"
+-       EXPECTED_HASH SHA1=${sha1}
+-       STATUS status)
+-  list(GET status 0 error_code)
+-  if (NOT ${error_code} EQUAL 0)
+-    message(FATAL_ERROR "Download firmwnare (${status}) - ${url}")
+-  else()
+-    message(STATUS "Download firmware ${status} for ${symbol}-${version}${ext}")
+-  endif()
+   string(TOUPPER ${symbol} SYMBOL)
+   string(REPLACE "." "," version_commas ${version})
+   string(REPLACE "\\" "\\\\" binary_escaped "${binary}")
+--
+2.32.0
+
diff --git a/gnu/packages/video.scm b/gnu/packages/video.scm
index 1b9179c6a8..ee783338f4 100644
--- a/gnu/packages/video.scm
+++ b/gnu/packages/video.scm
@@ -53,6 +53,7 @@
 ;;; Copyright © 2021 Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
 ;;; Copyright © 2020 Hartmut Goebel <h.goebel <at> crazy-compilers.com>
 ;;; Copyright © 2021 Raghav Gururajan <rg <at> raghavgururajan.name>
+;;; Copyright © 2021 Petr Hodina <phodina <at> protonmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -145,6 +146,7 @@
   #:use-module (gnu packages mp3)
   #:use-module (gnu packages ncurses)
   #:use-module (gnu packages networking)
+  #:use-module (gnu packages ninja)
   #:use-module (gnu packages ocr)
   #:use-module (gnu packages pcre)
   #:use-module (gnu packages perl)
@@ -577,6 +579,54 @@ other software.")
       ;; Library.
       license:lgpl3+))))

+(define-public librealsense
+ (package
+  (name "librealsense")
+  (version "2.47.0")
+  (source (origin
+           (method git-fetch)
+           (uri (git-reference
+                 (url "https://github.com/IntelRealSense/librealsense")
+                 (commit (string-append "v" version))))
+           (patches
+            (search-patches "librealsense-remove-network-connectivity.patch"))
+           (file-name (git-file-name name version))
+           (modules '((guix build utils)))
+            (sha256
+             (base32
+              "1jshhcnvbaa3xm5jr1s5m6z62wn1cspb7wkfdc1w88kp9j02ss8w"))))
+  (build-system cmake-build-system)
+  (arguments
+       `(#:tests? #f ; tests require camera hardware
+         #:configure-flags (list "-DBUILD_EXAMPLES=ON"
+                                 "-DBUILD_GRAPHICAL_EXAMPLES=ON"
+                                 "-DINTERNET_CONNECTION=OFF"
+                                 "-DCHECK_FOR_UPDATES=OFF")
+         #:phases
+           (modify-phases %standard-phases
+            ;; more convenient than manually invoking setup_udev_rules.sh
+            ;; and substituting the path in the script
+            (add-after 'unpack 'copy-udev-rules
+              (lambda* (#:key outputs #:allow-other-keys)
+               (let ((out (string-append (assoc-ref outputs "out")
+                            "/lib/udev/rules.d")))
+               (mkdir-p (string-append out))
+               (copy-file "config/99-realsense-libusb.rules"
+                          (string-append out
+                           "/99-realsense-libusb.rules"))))))))
+  (native-inputs `(("pkg-config" ,pkg-config)
+                   ("ninja" ,ninja)))
+  (inputs `(("glfw" ,glfw)
+            ("gtk+" ,gtk+)
+            ("libusb" ,libusb)
+            ("glu" ,glu)))
+  (synopsis "Intel RealSense SDK")
+  (description "Intel RealSense SDK 2.0 is a cross-platform library for
+Intel RealSense depth cameras (D400 & L500 series and the SR300) and the
+T265 tracking camera.")
+  (home-page "https://github.com/IntelRealSense/librealsense")
+  (license license:asl2.0)))
+
 (define-public tslib
   (package
     (name "tslib")
--
2.32.0




Information forwarded to guix-patches <at> gnu.org:
bug#49970; Package guix-patches. (Sat, 18 Sep 2021 12:04:02 GMT) Full text and rfc822 format available.

Message #20 received at 49970 <at> debbugs.gnu.org (full text, mbox):

From: Liliana Marie Prikler <liliana.prikler <at> gmail.com>
To: phodina <phodina <at> protonmail.com>
Cc: 49970 <at> debbugs.gnu.org
Subject: Re: [PATCH] gnu: Add librealsense.
Date: Sat, 18 Sep 2021 14:02:54 +0200
Hi Petr,

Am Samstag, den 18.09.2021, 11:47 +0000 schrieb phodina:
> Hi Liliana,
> 
> thanks for the comment! My appology for the licence.
> --8<---------------cut here---------------start------------->8---
> * gnu/packages/video.scm (librealsense): New variable.
> * gnu/packages/patches/librealsense-remove-network-
> connectivity.patch: New file.
Looking at this patch, it only seems to disable some warnings, which
frankly we can choose to ignore.  Is this really required to build
librealsense?

> diff --git a/gnu/packages/patches/librealsense-remove-network-
> connectivity.patch b/gnu/packages/patches/librealsense-remove-
> network-connectivity.patch
> new file mode 100644
> index 0000000000..73926587ff
> --- /dev/null
> +++ b/gnu/packages/patches/librealsense-remove-network-
> connectivity.patch
> @@ -0,0 +1,68 @@
> +From cfc87289d7636f439e2b91d88e35430949b29c0f Mon Sep 17 00:00:00
> 2001
> +From: Petr Hodina <phodina <at> protonmail.com>
> +Date: Sat, 31 Jul 2021 05:58:40 +0200
> +Subject: [PATCH] Remove network connectivity
> +
> +
> +diff --git a/CMakeLists.txt b/CMakeLists.txt
> +index 0c15d9510..a4d891444 100644
> +--- a/CMakeLists.txt
> ++++ b/CMakeLists.txt
> +@@ -3,7 +3,6 @@ cmake_minimum_required(VERSION 3.1.0)
> + project(librealsense2 LANGUAGES CXX C)
> +
> + include(CMake/lrs_options.cmake)
> +-include(CMake/connectivity_check.cmake)
> +
> + #Deprecation message, should be removed in future releases
> + if(${FORCE_LIBUVC} OR ${FORCE_WINUSB_UVC} OR
> ${ANDROID_USB_HOST_UVC})
> +@@ -12,14 +11,12 @@ if(${FORCE_LIBUVC} OR ${FORCE_WINUSB_UVC} OR
> ${ANDROID_USB_HOST_UVC})
> + endif()
> +
> + # Checking Internet connection, as TM2 needs to download the FW
> from amazon cloud
> +-if(BUILD_WITH_TM2 AND NOT INTERNET_CONNECTION)
> +-    message(WARNING "No internet connection, disabling
> BUILD_WITH_TM2")
> ++if(BUILD_WITH_TM2)
> +     set(BUILD_WITH_TM2 OFF)
> + endif()
> +
> + # Checking Internet connection, as DEPTH CAM needs to download the
> FW from amazon cloud
> +-if(IMPORT_DEPTH_CAM_FW AND NOT INTERNET_CONNECTION)
> +-    message(WARNING "No internet connection, disabling
> IMPORT_DEPTH_CAM_FW")
> ++if(IMPORT_DEPTH_CAM_FW)
> +     set(IMPORT_DEPTH_CAM_FW OFF)
> + endif()
> +
> +diff --git a/common/fw/CMakeLists.txt b/common/fw/CMakeLists.txt
> +index 32b1dd29a..9961e4d1d 100644
> +--- a/common/fw/CMakeLists.txt
> ++++ b/common/fw/CMakeLists.txt
> +@@ -6,8 +6,6 @@ project(fw)
> +
> + file(READ "firmware-version.h" ver)
> +
> +-message(STATUS "Fetching recommended firmwares:")
> +-
> + set(REALSENSE_FIRMWARE_URL "https://librealsense.intel.com" CACHE
> STRING
> +     "URL to download firmware binaries from")
> +
> +@@ -51,16 +49,6 @@ set_target_properties (${PROJECT_NAME} PROPERTIES
> FOLDER Resources)
> +
> + function(target_binary url version sha1 symbol ext)
> +   set(binary "${CMAKE_CURRENT_BINARY_DIR}/${symbol}-
> ${version}${ext}")
> +-  message(STATUS "${url}/${symbol}-${version}${ext}")
> +-  file(DOWNLOAD "${url}/${symbol}-${version}${ext}" "${binary}"
> +-       EXPECTED_HASH SHA1=${sha1}
> +-       STATUS status)
> +-  list(GET status 0 error_code)
> +-  if (NOT ${error_code} EQUAL 0)
> +-    message(FATAL_ERROR "Download firmwnare (${status}) - ${url}")
> +-  else()
> +-    message(STATUS "Download firmware ${status} for ${symbol}-
> ${version}${ext}")
> +-  endif()
> +   string(TOUPPER ${symbol} SYMBOL)
> +   string(REPLACE "." "," version_commas ${version})
> +   string(REPLACE "\\" "\\\\" binary_escaped "${binary}")
> +--
> +2.32.0
> +
> diff --git a/gnu/packages/video.scm b/gnu/packages/video.scm
> index 1b9179c6a8..ee783338f4 100644
> --- a/gnu/packages/video.scm
> +++ b/gnu/packages/video.scm
> @@ -53,6 +53,7 @@
>  ;;; Copyright © 2021 Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
>  ;;; Copyright © 2020 Hartmut Goebel <h.goebel <at> crazy-compilers.com>
>  ;;; Copyright © 2021 Raghav Gururajan <rg <at> raghavgururajan.name>
> +;;; Copyright © 2021 Petr Hodina <phodina <at> protonmail.com>
>  ;;;
>  ;;; This file is part of GNU Guix.
>  ;;;
> @@ -145,6 +146,7 @@
>    #:use-module (gnu packages mp3)
>    #:use-module (gnu packages ncurses)
>    #:use-module (gnu packages networking)
> +  #:use-module (gnu packages ninja)
>    #:use-module (gnu packages ocr)
>    #:use-module (gnu packages pcre)
>    #:use-module (gnu packages perl)
> @@ -577,6 +579,54 @@ other software.")
>        ;; Library.
>        license:lgpl3+))))
> 
> +(define-public librealsense
> + (package
> +  (name "librealsense")
> +  (version "2.47.0")
> +  (source (origin
> +           (method git-fetch)
> +           (uri (git-reference
> +                 (url "
> https://github.com/IntelRealSense/librealsense")
> +                 (commit (string-append "v" version))))
> +           (patches
> +            (search-patches "librealsense-remove-network-
> connectivity.patch"))
> +           (file-name (git-file-name name version))
> +           (modules '((guix build utils)))
> +            (sha256
> +             (base32
> +              "1jshhcnvbaa3xm5jr1s5m6z62wn1cspb7wkfdc1w88kp9j02ss8w"
> ))))
> +  (build-system cmake-build-system)
> +  (arguments
> +       `(#:tests? #f ; tests require camera hardware
> +         #:configure-flags (list "-DBUILD_EXAMPLES=ON"
> +                                 "-DBUILD_GRAPHICAL_EXAMPLES=ON"
> +                                 "-DINTERNET_CONNECTION=OFF"
> +                                 "-DCHECK_FOR_UPDATES=OFF")
> +         #:phases
> +           (modify-phases %standard-phases
> +            ;; more convenient than manually invoking
> setup_udev_rules.sh
> +            ;; and substituting the path in the script
> +            (add-after 'unpack 'copy-udev-rules
> +              (lambda* (#:key outputs #:allow-other-keys)
> +               (let ((out (string-append (assoc-ref outputs "out")
> +                            "/lib/udev/rules.d")))
> +               (mkdir-p (string-append out))
> +               (copy-file "config/99-realsense-libusb.rules"
> +                          (string-append out
> +                           "/99-realsense-libusb.rules"))))))))
> +  (native-inputs `(("pkg-config" ,pkg-config)
> +                   ("ninja" ,ninja)))
> +  (inputs `(("glfw" ,glfw)
> +            ("gtk+" ,gtk+)
> +            ("libusb" ,libusb)
> +            ("glu" ,glu)))
> +  (synopsis "Intel RealSense SDK")
> +  (description "Intel RealSense SDK 2.0 is a cross-platform library
> for
> +Intel RealSense depth cameras (D400 & L500 series and the SR300) and
> the
> +T265 tracking camera.")
> +  (home-page "https://github.com/IntelRealSense/librealsense")
> +  (license license:asl2.0)))
> +
>  (define-public tslib
>    (package
>      (name "tslib")
librealsense also seems to bundle a bunch of software in its third-
party directory.  How much of that could we unbundle?





Information forwarded to guix-patches <at> gnu.org:
bug#49970; Package guix-patches. (Sat, 18 Sep 2021 12:48:01 GMT) Full text and rfc822 format available.

Message #23 received at 49970 <at> debbugs.gnu.org (full text, mbox):

From: phodina <phodina <at> protonmail.com>
To: Liliana Marie Prikler <liliana.prikler <at> gmail.com>
Cc: 49970 <at> debbugs.gnu.org
Subject: Re: [PATCH] gnu: Add librealsense.
Date: Sat, 18 Sep 2021 12:46:54 +0000
You're right Liliana the patch is indeed not neccessary.

I'll try to unbundle as much as possible of the third party code.

Regards
Petr




This bug report was last modified 2 years and 228 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.