From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id mF5NBxRdxV6jFQAA0tVLHw (envelope-from ) for ; Wed, 20 May 2020 16:38:44 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id eMUyAxRdxV5rFAAA1q6Kng (envelope-from ) for ; Wed, 20 May 2020 16:38:44 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 9E37194038F for ; Wed, 20 May 2020 16:38:42 +0000 (UTC) Received: from localhost ([::1]:35126 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jbRjt-00016r-Fa for larch@yhetil.org; Wed, 20 May 2020 12:38:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48170) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jbRjG-0007fi-KF for guix-patches@gnu.org; Wed, 20 May 2020 12:38:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:42573) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jbRjG-0002tr-AC for guix-patches@gnu.org; Wed, 20 May 2020 12:38:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jbRjG-0008JC-6C for guix-patches@gnu.org; Wed, 20 May 2020 12:38:02 -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: Wed, 20 May 2020 16:38:02 +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.158999265631904 (code B ref 41294); Wed, 20 May 2020 16:38:02 +0000 Received: (at 41294) by debbugs.gnu.org; 20 May 2020 16:37:36 +0000 Received: from localhost ([127.0.0.1]:54119 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jbRim-0008IQ-CK for submit@debbugs.gnu.org; Wed, 20 May 2020 12:37:36 -0400 Received: from mail2.protonmail.ch ([185.70.40.22]:28306) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jbRig-0008I7-9Q for 41294@debbugs.gnu.org; Wed, 20 May 2020 12:37:30 -0400 Date: Wed, 20 May 2020 16:37:16 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=elenq.tech; s=protonmail; t=1589992638; bh=G35OKBaxZbRe7s+73uUqrwqsXnGhCYLktV4Evovp3GQ=; h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References:From; b=srW0RncLfBIzGGp3JovMpeeqBzysIsgVlKt+czWrhGt6OZDkloNawbcBjQeEpWKco LZ5uRrtZNRxwQTsja7wE0CWZmRe+pmBAnI98WB29dKnUmQHykz6wsQNs4iMB9hR9EA ODmXykA6UvRm14UQIpjK4lUAJQzmUpY7wKM4JBIw= From: Ekaitz Zarraga Message-ID: In-Reply-To: <87h7wak9yj.fsf@member.fsf.org> References: <5kf9uJF2SDo9zwlTUoFI13o7P7q68o-AuSp72MvOp5PUaF2SlAPxzQJvFws5aaTOB5EHY4T3-En0Mhba7hADMIeJkgCeWUOY_Ciy0fv24Ck=@elenq.tech> <87sgfz1f43.fsf@member.fsf.org> <87eergqcn4.fsf@member.fsf.org> <9ZfB8rv2oVS3f1P4KqZV9twP9VRoO9GNuPvbzT_BjLAzXCs6kumdqaIPD_TMejSv5B0D34dg6tpbmKPmIQxuLW64pU35VX5LGNn5tM9Ka04=@elenq.tech> <87h7wak9yj.fsf@member.fsf.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -1.7 (-) 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+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=fail (rsa verify failed) header.d=elenq.tech header.s=protonmail header.b=srW0RncL; dmarc=fail reason="SPF not aligned (relaxed)" header.from=elenq.tech (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Spam-Score: 1.59 X-TUID: rVKIBhrZvxYp =E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90 Original Me= ssage =E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90 On Wednesday, May 20, 2020 3:33 PM, wrote: > > Um, I mean something like this: > > (define libfreenect-derived-phases > '(modify-phases %standard-phases > (lambda* (#:key outputs #:allow-other-keys) > ...))) > > ... > (arguments > `(#:phases ,libfreenect-derived-phases)) > ... > > Here 'libfreenect-derived-phases' is a list of symbols, the arguments > field we want is a list of symbols too. Hi, That makes way more sense than what I was trying to do. I applied that and separated libfreenect to a different module. Patch below= . Thank you very much for your support. PS: I'm still wondering what kind of weird magic is involved in the example= I shown. >From efcf2b3fcb4b422939550e614d20abafaaed3d7f Mon Sep 17 00:00:00 2001 From: Ekaitz Zarraga Date: Wed, 20 May 2020 18:18:23 +0200 Subject: [PATCH] gnu: openkinect: New module * gnu/packages/openkinect.scm: New file. * gnu/local.mk (GNU_SYSTEM_MODULES): Add it. --- gnu/local.mk | 1 + gnu/packages/openkinect.scm | 140 ++++++++++++++++++++++++++++++++++++ 2 files changed, 141 insertions(+) create mode 100644 gnu/packages/openkinect.scm diff --git a/gnu/local.mk b/gnu/local.mk index ab2bac9bc5..b9c09cc5e3 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -394,6 +394,7 @@ GNU_SYSTEM_MODULES =3D=09=09=09=09\ %D%/packages/nvi.scm=09=09=09=09\ %D%/packages/ocaml.scm=09=09=09\ %D%/packages/ocr.scm=09=09=09=09\ + %D%/packages/openkinect.scm=09=09=09\ %D%/packages/onc-rpc.scm=09=09=09\ %D%/packages/opencl.scm=09=09=09\ %D%/packages/openbox.scm=09=09=09\ diff --git a/gnu/packages/openkinect.scm b/gnu/packages/openkinect.scm new file mode 100644 index 0000000000..96150801e6 --- /dev/null +++ b/gnu/packages/openkinect.scm @@ -0,0 +1,140 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright =C2=A9 2020 Ekaitz Zarraga +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(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 "0was1va167rqshmpn382h36yyprpfi9cwillb6ylppmnfdrf= rhrr")))) + (build-system cmake-build-system) + (arguments + '(#:tests? #f ; Project has not tests + #:configure-flags + '("-DBUILD_FAKENECT=3DON" + "-DBUILD_CPP=3DON" + "-DBUILD_EXAMPLES=3DOFF" ; Available in libfreenect-examples + "-DBUILD_CV=3DOFF" ; Available in libfreenect-cv + "-DBUILD_PYTHON=3DOFF" ; Available in libfreenect-python + "-DBUILD_C_SYNC=3DON") + #: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.ru= les" + (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 Ki= nect. +It supports: RGB and Depth Images, Motors, Accelerometer, LED and Audio.") + (home-page "https://openkinect.org/") + (license license:gpl2+)))) + +;; Sources are already compiled in libfreenect input: remove them from the +;; compilation +(define libfreenect-derived-phases + '(modify-phases %standard-phases + (add-after 'unpack 'disable-sources + (lambda* (#:key outputs #:allow-other-keys) + (substitute* "CMakeLists.txt" + ((".*libusb.*") "") + (("add_subdirectory \\(src\\)") "") + ((".*libfreenectConfig.cmake.*") "")))))) + +(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=3DON" + "-DBUILD_FAKENECT=3DOFF" + "-DBUILD_CPP=3DOFF" + "-DBUILD_C_SYNC=3DOFF" + "-DBUILD_CV=3DOFF") + #:phases ,libfreenect-derived-phases)) + (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=3DOFF" + "-DBUILD_FAKENECT=3DOFF" + "-DBUILD_CPP=3DOFF" + "-DBUILD_C_SYNC=3DOFF" + "-DBUILD_CV=3DON") + #:phases ,libfreenect-derived-phases)) + (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=3DOFF" + "-DBUILD_FAKENECT=3DOFF" + "-DBUILD_CPP=3DOFF" + "-DBUILD_C_SYNC=3DOFF" + "-DBUILD_CV=3DOFF" + "-DBUILD_PYTHON3=3DON") + #:phases ,libfreenect-derived-phases)) + (synopsis "Python wrapper for libfreenect, the Xbox Kinect device +library"))) -- 2.26.2