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: Sat, 16 May 2020 13:06:23 +0000	[thread overview]
Message-ID: <BxJab7z2VOD-VeXpKiEpcbdx5pJVou3NuReW9G63QWzmMbMwDRgTFYp2eYlMyntlcAlH3cas1XMml6CsUQIABP80dy1fLQ8lbae0dClfaDI=@elenq.tech> (raw)
In-Reply-To: <anygGLcrTLR-L_lbGpsSCRwfeCxVv7GdmryjPmzGc1M7AxdMInuEmimpAI_u3lst7LBl-xg4LHJBqOi1gYLiRyUJX8_kw0F9RcI723VUjQU=@elenq.tech>

> Inputs can also be defined with an extra argument for different outputs, right? It should be something like:
>
> `(inputs`("freeglut" ,freeglut "examples"))
>
> Am I right?

Nope!

I've been digging and I got this wrong. The third part in the tuple is the output of the dependency.
So there's no way to indicate which dependencies are needed for each output.

I also found a flag to compile OpenCV wrappers, which depends on OpenCV. OpenCV is huge and it's going to be downloaded regardless if its output is used or not. Best choice here seems to be to separate the package in multiple sub-packages.

I made this with the examples (see below), how does it look?
I used libfreenect as a dependency for examples too, so I needed to patch the CMakeLists.txt to avoid it compile the `src` folder again.
Is it cool if I do the same thing with OpenCV and Python?

(now we can move it to its own module because it's going to be long :) )

---

(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)
      (outputs '("out" "opencv" "examples"))
      (arguments
       '(#:tests? #f ; Project has not tests
         #:configure-flags '("-DBUILD_EXAMPLES=ON"
                             "-DBUILD_FAKENECT=ON"
                             "-DBUILD_CPP=ON"
                             "-DBUILD_CV=OFF"
                             "-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
     `(("libusb" ,libusb)
       ("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")
       #:phases
       (modify-phases
         %standard-phases
         (add-after
           'unpack 'remove-sources
           (lambda* (#:key outputs #:allow-other-keys)
                    (substitute* "CMakeLists.txt"
                                 (("add_subdirectory \\(src\\)") "")
                                 ((".*libfreenectConfig.cmake.*") "")))))))
    (synopsis "Examples for libfreenect, the Xbox Kinect device library")))





  reply	other threads:[~2020-05-16 13:07 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 [this message]
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
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='BxJab7z2VOD-VeXpKiEpcbdx5pJVou3NuReW9G63QWzmMbMwDRgTFYp2eYlMyntlcAlH3cas1XMml6CsUQIABP80dy1fLQ8lbae0dClfaDI=@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.