all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Ekaitz Zarraga <ekaitz@elenq.tech>
To: "iyzsong@member.fsf.org" <iyzsong@member.fsf.org>
Cc: "41294\\@debbugs.gnu.org" <41294@debbugs.gnu.org>
Subject: [bug#41294] [PATCH] gnu: Add libfreenect.
Date: Sun, 17 May 2020 12:15:06 +0000	[thread overview]
Message-ID: <zgYthp30GnrnAddRXlGZx4viwqwoXH-IAl4YyIpaZPVi9RGq33qbQ6Sg1r3Kg4QnVYCmwY0xpoxJVyv8xhARPY-cHsbdsoA1gfKKr9k-VL0=@elenq.tech> (raw)
In-Reply-To: <Tm4Gn-oOCCKkN_lXgi0Ratd53rukPCo0cCdUiedNp5yWWy9EOgKhRRTvWyUZzKFaL_8SIJHbYoti5YofNZTA8Z4wzULhbbFGqedOTpgrGBk=@elenq.tech>

Hi,
I came up with this. It's just a diff because I'd like to improve something.

There's the same lambda sent to all the packages that need to disable sources compilation but I'm not able to create it in a function that I send later to all those.

How can I do that? I'm getting `Unknown object` errors.

I tried to create a new function with `define*` with the same body the lambda has. Quasiquote the `arguments` and unquote the function there.
Nothing. There's some kind of weird magic I'm not getting.


diff --git a/gnu/packages/openkinect.scm b/gnu/packages/openkinect.scm
new file mode 100644
index 0000000000..1aebb34384
--- /dev/null
+++ b/gnu/packages/openkinect.scm
@@ -0,0 +1,137 @@
+(define-module (gnu packages openkinect)
+  #:use-module (guix packages)
+  #:use-module (guix git-download)
+  #:use-module (guix build-system cmake)
+  #:use-module ((guix licenses) #:prefix license:)
+  #:use-module (gnu packages pkg-config)
+  #:use-module (gnu packages libusb)
+  #:use-module (gnu packages python)
+  #:use-module (gnu packages python-xyz)
+  #:use-module (gnu packages gl)
+  #:use-module (gnu packages pkg-config)
+  #:use-module (gnu packages image-processing))
+
+(define-public libfreenect
+  (let ((version "0.6.1"))
+    (package
+      (name "libfreenect")
+      (version version)
+      (source (origin
+                (method git-fetch)
+                (uri (git-reference
+                      (url "https://github.com/OpenKinect/libfreenect")
+                      (commit (string-append "v" version))))
+                (sha256
+                 (base32 "0was1va167rqshmpn382h36yyprpfi9cwillb6ylppmnfdrfrhrr"))))
+      (build-system cmake-build-system)
+      (arguments
+       '(#:tests? #f ; Project has not tests
+         #:configure-flags
+         '("-DBUILD_FAKENECT=ON"
+           "-DBUILD_CPP=ON"
+           "-DBUILD_EXAMPLES=OFF" ; Available in libfreenect-examples
+           "-DBUILD_CV=OFF"       ; Available in libfreenect-cv
+           "-DBUILD_PYTHON=OFF"   ; Available in libfreenect-python
+           "-DBUILD_C_SYNC=ON")
+         #:phases
+         (modify-phases %standard-phases
+           (add-after 'install 'install-udev-rules
+             (lambda* (#:key outputs #:allow-other-keys)
+               (let* ((out (assoc-ref outputs "out"))
+                      (rules-out (string-append out "/lib/udev/rules.d")))
+                 (install-file "../source/platform/linux/udev/51-kinect.rules"
+                               (string-append rules-out "51-kinect.rules"))
+                 #t))))))
+      (native-inputs
+       `(("pkg-config" ,pkg-config)))
+      (inputs
+       `(("libusb" ,libusb)))
+      (synopsis "Drivers and libraries for the Xbox Kinect device")
+      (description "libfreenect is a userspace driver for the Microsoft Kinect.
+It supports: RGB and Depth Images, Motors, Accelerometer, LED and Audio.")
+      (home-page "https://openkinect.org/")
+      (license license:gpl2+))))
+
+
+
+(define-public libfreenect-examples
+  (package
+    (inherit libfreenect)
+    (name "libfreenect-examples")
+    (inputs
+     `(("libfreenect" ,libfreenect)
+       ("glut" ,freeglut)))
+    (arguments
+     `(#:tests? #f ; Project has not tests
+       #:configure-flags '("-DBUILD_EXAMPLES=ON"
+                           "-DBUILD_FAKENECT=OFF"
+                           "-DBUILD_CPP=OFF"
+                           "-DBUILD_C_SYNC=OFF"
+                           "-DBUILD_CV=OFF")
+       #:phases
+       (modify-phases %standard-phases
+         ;; Sources are already compiled in libfreenect input
+         (add-after 'unpack 'disable-sources
+                    (lambda* (#:key outputs #:allow-other-keys)
+                             (substitute* "CMakeLists.txt"
+                               ((".*libusb.*") "")
+                               (("add_subdirectory \\(src\\)") "")
+                               ((".*libfreenectConfig.cmake.*") "")))
+                    ))))
+    (synopsis "Examples for libfreenect, the Xbox Kinect device library")))
+
+(define-public libfreenect-cv
+  (package
+    (inherit libfreenect)
+    (name "libfreenect-cv")
+    (inputs
+     `(("libfreenect" ,libfreenect)
+       ("opencv" ,opencv)))
+    (arguments
+     '(#:tests? #f ; Project has not tests
+       #:configure-flags '("-DBUILD_EXAMPLES=OFF"
+                           "-DBUILD_FAKENECT=OFF"
+                           "-DBUILD_CPP=OFF"
+                           "-DBUILD_C_SYNC=OFF"
+                           "-DBUILD_CV=ON")
+       #:phases
+       (modify-phases %standard-phases
+         ;; Sources are already compiled in libfreenect input
+         (add-after 'unpack 'disable-sources
+           (lambda* (#:key outputs #:allow-other-keys)
+             (substitute* "CMakeLists.txt"
+               ((".*libusb.*") "")
+               (("add_subdirectory \\(src\\)") "")
+               ((".*libfreenectConfig.cmake.*") "")))))))
+    (synopsis "OpenCV wrapper for libfreenect, the Xbox Kinect device
+library")))
+
+(define-public libfreenect-python
+  (package
+    (inherit libfreenect)
+    (name "libfreenect-python")
+    (native-inputs
+     `(("python-cython" ,python-cython)))
+    (inputs
+     `(("libfreenect" ,libfreenect)))
+    (propagated-inputs
+     `(("python" ,python)
+       ("python-numpy" ,python-numpy)))
+    (arguments
+     '(#:tests? #f ; Project has not tests
+       #:configure-flags '("-DBUILD_EXAMPLES=OFF"
+                           "-DBUILD_FAKENECT=OFF"
+                           "-DBUILD_CPP=OFF"
+                           "-DBUILD_C_SYNC=OFF"
+                           "-DBUILD_CV=OFF"
+                           "-DBUILD_PYTHON3=ON")
+       #:phases
+       (modify-phases %standard-phases
+         ;; Sources are already compiled in libfreenect input
+         (add-after 'unpack 'disable-sources
+           (lambda* (#:key outputs #:allow-other-keys)
+             (substitute* "CMakeLists.txt"
+               ((".*libusb.*") "")
+               (("add_subdirectory \\(src\\)") "")
+               ((".*libfreenectConfig.cmake.*") "")))))))
+    (synopsis "Python wrapper for libfreenect, the Xbox Kinect device
+library")))





  reply	other threads:[~2020-05-17 12:16 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-15 21:47 [bug#41294] [PATCH] gnu: Add libfreenect Ekaitz Zarraga
2020-05-15 23:09 ` [bug#41294] [PATCH] gnu: libfreenect: Correct native-inputs vs inputs Ekaitz Zarraga
2020-05-16  3:48 ` [bug#41294] [PATCH] gnu: Add libfreenect 宋文武
2020-05-16 10:18   ` Ekaitz Zarraga
2020-05-16 13:06     ` Ekaitz Zarraga
2020-05-16 13:28       ` Ekaitz Zarraga
2020-05-17  2:15       ` 宋文武
2020-05-17  9:37         ` Ekaitz Zarraga
2020-05-17 12:15           ` Ekaitz Zarraga [this message]
2020-05-19 13:26             ` 宋文武
2020-05-19 13:42               ` Ekaitz Zarraga
2020-05-19 13:52                 ` Ekaitz Zarraga
2020-05-20 13:33                   ` 宋文武
2020-05-20 16:37                     ` Ekaitz Zarraga
2020-05-21 11:38                       ` bug#41294: " 宋文武
2020-05-21 11:40                         ` [bug#41294] " Ekaitz Zarraga
2020-05-17  1:56     ` 宋文武

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='zgYthp30GnrnAddRXlGZx4viwqwoXH-IAl4YyIpaZPVi9RGq33qbQ6Sg1r3Kg4QnVYCmwY0xpoxJVyv8xhARPY-cHsbdsoA1gfKKr9k-VL0=@elenq.tech' \
    --to=ekaitz@elenq.tech \
    --cc=41294@debbugs.gnu.org \
    --cc=iyzsong@member.fsf.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.