diff mbox series

[bug#49970] gnu: Add librealsense.

Message ID y4Ix88bHY2jOE46LZiB-nQunRKf6z2OjurR-4jWS5Aey4abatO0ieqlIChop4H6Ps1x40pGkzBupl6URdPOTfzAA0ru5qNnFkWFEkZ8z6uo=@protonmail.com
State New
Headers show
Series [bug#49970] gnu: Add librealsense. | expand

Checks

Context Check Description
cbaines/applying patch fail View Laminar job
cbaines/issue success View issue

Commit Message

phodina Aug. 9, 2021, 8:54 p.m. UTC
* gnu/packages/video.scm (librealsense): New variable.

--
2.32.0

Comments

phodina Sept. 18, 2021, 8:05 a.m. UTC | #1
Hi!

Is there anything to be improved to upstream this patch?
Liliana Marie Prikler Sept. 18, 2021, 11:12 a.m. UTC | #2
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@gmail.com>
>  ;;; Copyright © 2020 Hartmut Goebel <h.goebel@crazy-compilers.com>
>  ;;; Copyright © 2021 Raghav Gururajan <rg@raghavgururajan.name>
> +;;; Copyright © 2021 Petr Hodina <phodina@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
diff mbox series

Patch

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@gmail.com>
 ;;; Copyright © 2020 Hartmut Goebel <h.goebel@crazy-compilers.com>
 ;;; Copyright © 2021 Raghav Gururajan <rg@raghavgururajan.name>
+;;; Copyright © 2021 Petr Hodina <phodina@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")