guix-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug#41294] [PATCH] gnu: Add libfreenect.


From: 宋文武
Subject: [bug#41294] [PATCH] gnu: Add libfreenect.
Date: Sun, 17 May 2020 10:15:24 +0800
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux)

Ekaitz Zarraga <address@hidden> writes:

> [...]
>
> 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"))
As note in your latest email, this line should be removed, as it's a single
output package now.

>       (arguments
>        '(#:tests? #f ; Project has not tests
>          #:configure-flags '("-DBUILD_EXAMPLES=ON"
Should be "-DBUILD_EXAMPLES=OFF"?

>                              "-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
Maybe 'configure-examples?  This phases doesn't remove sources, but
avoid building them.

>            (lambda* (#:key outputs #:allow-other-keys)
How about add a comment here: Reuse "libfreenect" from input, avoid building it 
again.

>                     (substitute* "CMakeLists.txt"
>                                  (("add_subdirectory \(src\)") "")
>                                  ((".*libfreenectConfig.cmake.*") "")))))))
>     (synopsis "Examples for libfreenect, the Xbox Kinect device library")))

Also check the outputs of libfreenect and libfreenect-examples, they
shouldn't have same files (maybe by guix install them).

Otherwise, look goods to me.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]