From patchwork Sun May 17 12:15:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ekaitz Zarraga X-Patchwork-Id: 22122 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 71E7F27BBE1; Sun, 17 May 2020 13:16:11 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,T_DKIM_INVALID,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id CC5E327BBE3 for ; Sun, 17 May 2020 13:16:09 +0100 (BST) Received: from localhost ([::1]:55540 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jaIDB-0007Pt-Cx for patchwork@mira.cbaines.net; Sun, 17 May 2020 08:16:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54040) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jaID4-0007Pi-6W for guix-patches@gnu.org; Sun, 17 May 2020 08:16:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:59172) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jaID3-0002M3-U4 for guix-patches@gnu.org; Sun, 17 May 2020 08:16:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jaID3-0005ok-P3 for guix-patches@gnu.org; Sun, 17 May 2020 08:16:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#41294] [PATCH] gnu: Add libfreenect. Resent-From: Ekaitz Zarraga Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 17 May 2020 12:16:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 41294 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: "iyzsong@member.fsf.org" Cc: "41294\\@debbugs.gnu.org" <41294@debbugs.gnu.org> Received: via spool by 41294-submit@debbugs.gnu.org id=B41294.158971772322304 (code B ref 41294); Sun, 17 May 2020 12:16:01 +0000 Received: (at 41294) by debbugs.gnu.org; 17 May 2020 12:15:23 +0000 Received: from localhost ([127.0.0.1]:42485 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jaICR-0005ng-0v for submit@debbugs.gnu.org; Sun, 17 May 2020 08:15:23 -0400 Received: from mail-40131.protonmail.ch ([185.70.40.131]:56304) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jaICO-0005nO-8l for 41294@debbugs.gnu.org; Sun, 17 May 2020 08:15:21 -0400 Date: Sun, 17 May 2020 12:15:06 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=elenq.tech; s=protonmail; t=1589717713; bh=6JS5784G1ZV9lFLu+U1WBJrDzoS7zgQUKY04KA9c9Ao=; h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References:From; b=rX2GD7mNmbALrKmgnrgHJ5lq6ojTw9eNSN75LcZRUeFLswTDm//P34NLgiBlH3GLn 0yvCoAict27CwiWsPZt2zwdW7VFECT5ndNLfKldWzrjMhIUgi27NYDjbOW7e/Vxjv6 J2FqkRQLmKKnv3Wp3cn9tYhEywF/XDKW3aTkkVws= From: Ekaitz Zarraga Message-ID: In-Reply-To: References: <5kf9uJF2SDo9zwlTUoFI13o7P7q68o-AuSp72MvOp5PUaF2SlAPxzQJvFws5aaTOB5EHY4T3-En0Mhba7hADMIeJkgCeWUOY_Ciy0fv24Ck=@elenq.tech> <87k11c5ymm.fsf@member.fsf.org> <87sgfz1f43.fsf@member.fsf.org> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Ekaitz Zarraga Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches 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. +library"))) 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