From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id 8DBWC7Viv15hGwAA0tVLHw (envelope-from ) for ; Sat, 16 May 2020 03:49:09 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id OpXQBrViv16EDwAAbx9fmQ (envelope-from ) for ; Sat, 16 May 2020 03:49:09 +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 E2E3894017B for ; Sat, 16 May 2020 03:49:07 +0000 (UTC) Received: from localhost ([::1]:37712 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jZnov-0002Kr-E3 for larch@yhetil.org; Fri, 15 May 2020 23:49:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51146) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jZnos-0002Kl-CJ for guix-patches@gnu.org; Fri, 15 May 2020 23:49:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:55929) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jZnos-0007BM-3U for guix-patches@gnu.org; Fri, 15 May 2020 23:49:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jZnos-0002ER-1L for guix-patches@gnu.org; Fri, 15 May 2020 23:49:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#41294] [PATCH] gnu: Add libfreenect. Resent-From: iyzsong@member.fsf.org (=?UTF-8?Q?=E5=AE=8B=E6=96=87=E6=AD=A6?=) Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 16 May 2020 03:49: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: Ekaitz Zarraga Cc: 41294@debbugs.gnu.org Received: via spool by 41294-submit@debbugs.gnu.org id=B41294.15896009328564 (code B ref 41294); Sat, 16 May 2020 03:49:01 +0000 Received: (at 41294) by debbugs.gnu.org; 16 May 2020 03:48:52 +0000 Received: from localhost ([127.0.0.1]:39242 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jZnod-0002Dz-V0 for submit@debbugs.gnu.org; Fri, 15 May 2020 23:48:51 -0400 Received: from rezeros.cc ([45.76.207.221]:46054) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jZnob-0002Dm-FJ for 41294@debbugs.gnu.org; Fri, 15 May 2020 23:48:46 -0400 Received: from localhost ( [117.173.227.26]) by rezeros.cc (OpenSMTPD) with ESMTPSA id 6f788797 (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO); Sat, 16 May 2020 03:48:37 +0000 (UTC) Received: from gift (localhost [127.0.0.1]) by localhost (OpenSMTPD) with ESMTP id ed178785; Sat, 16 May 2020 03:48:01 +0000 (UTC) From: iyzsong@member.fsf.org (=?UTF-8?Q?=E5=AE=8B=E6=96=87=E6=AD=A6?=) References: <5kf9uJF2SDo9zwlTUoFI13o7P7q68o-AuSp72MvOp5PUaF2SlAPxzQJvFws5aaTOB5EHY4T3-En0Mhba7hADMIeJkgCeWUOY_Ciy0fv24Ck=@elenq.tech> Date: Sat, 16 May 2020 11:48:01 +0800 In-Reply-To: <5kf9uJF2SDo9zwlTUoFI13o7P7q68o-AuSp72MvOp5PUaF2SlAPxzQJvFws5aaTOB5EHY4T3-En0Mhba7hADMIeJkgCeWUOY_Ciy0fv24Ck=@elenq.tech> (Ekaitz Zarraga's message of "Fri, 15 May 2020 21:47:15 +0000") Message-ID: <87k11c5ymm.fsf@member.fsf.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -1.0 (-) X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=fsf.org (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: 0.59 X-TUID: MPRsIDcx+TMR Ekaitz Zarraga writes: > Hi, Hello, > > Adding libfreenect as discussed here: > > https://issues.guix.gnu.org/40492 > > I have some doubts with this package: > > - It has some extra flags that can be set in the configure step to build = some python bindings. I didn't set them because they also require a python = interpreter. How is the best way to handle that? Make another package with = the flags set? Activate them by default? Leave them as I did? We generally try to enable all optional features when adding a package, I'd go with: 1. Build the python bindings by default. 2. Try seperate the python bindings into another output. (eg: newt) 3. If 1 and 2 seems difficult, try add a seperate package for the python bindings, and it better only contains the bindings, reuse the original package as input. (eg: python-libxml2) 4. If not feel lucky, just leave a TODO comment for it... > > - The package is 300 megs checking `guix size` that's because it has some= testing binaries that have extra dependencies. If only the library is comp= iled it doesn't depend on GLUT and that reduces the size a lot. I tried to = separate the package's outputs but I don't know how to do it correctly (I c= hecked the docs but it doesn't go in detail). I'd like to do it but I need = some help. To define a packages with multiple outputs: - Decide what =E2=80=98outputs=E2=80=99 can be made, eg: =E2=80=98doc=E2=80= =99, =E2=80=98bin=E2=80=99, =E2=80=98examples=E2=80=99, etc. In this case, I=E2=80=99d add an =E2=80=98examples=E2=80=99 output,= to put those =E2=80=98freenect-*=E2=80=99 binaries, built from the =E2=80=9Cexamples= =E2=80=9D directory. =20=20 - Add an =E2=80=98outputs=E2=80=99 field, it default to =E2=80=98(list "out= ")=E2=80=99, We=E2=80=99d use =E2=80=98(outputs '("out" "examples")=E2=80=99. - Modify the install flags or phases to get files into their output directory. Sometimes we can configure the target directory by flags, but usually we have to move the files around after the install phase=E2= =80=A6 =20=20 You can see =E2=80=98newt=E2=80=99 in =E2=80=98gnu/packages/slang.scm=E2=80= =99 for a example.=20=20 > > - I'm not sure if the file where I added it is a good choice. Same here, we can always move it later=E2=80=A6 > > Best, > > Ekaitz > > --- > >>>From aa74e0b4872f6a2748ed919ebe3c265472d04664 Mon Sep 17 00:00:00 2001 > From: Ekaitz Zarraga > Date: Fri, 15 May 2020 23:22:04 +0200 > Subject: [PATCH] gnu: Add libfreenect. > > * gnu/packages/libusb (libfreenect): New variable. > --- > gnu/packages/libusb.scm | 39 ++++++++++++++++++++++++++++++++++++++- > 1 file changed, 38 insertions(+), 1 deletion(-) > > diff --git a/gnu/packages/libusb.scm b/gnu/packages/libusb.scm > index 3842f3fead..a27373c15a 100644 > --- a/gnu/packages/libusb.scm > +++ b/gnu/packages/libusb.scm > @@ -10,6 +10,7 @@ > ;;; Copyright =C2=A9 2018 Vagrant Cascadian > ;;; Copyright =C2=A9 2020 Marius Bakke > ;;; Copyright =C2=A9 2020 Christopher Howard > +;;; Copyright =C2=A9 2020 Ekaitz Zarraga > ;;; > ;;; This file is part of GNU Guix. > ;;; > @@ -48,7 +49,8 @@ > #:use-module (gnu packages python) > #:use-module (gnu packages python-xyz) > #:use-module (gnu packages tls) > - #:use-module (gnu packages xiph)) > + #:use-module (gnu packages xiph) > + #:use-module (gnu packages gl)) > > (define-public libusb > (package > @@ -679,3 +681,38 @@ HID-Class devices.") > > (define-public python2-hidapi > (package-with-python2 python-hidapi)) > + > +(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 "0was1va167rqshmpn382h36yyprpfi9cwillb6ylppmnfd= rfrhrr")))) > + (build-system cmake-build-system) > + (arguments > + `(#:tests? #f ;; Project has not tests This ` quasiquote is unnecessary here, a ' quote is enough, because we refer nothing outside in the arguments list. By convention, a single semicolon is for comment after expression in the same line. a double semicolon is for comment the next lines. > + #: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 > + `(("libusb" ,libusb) > + ("pkg-config" ,pkg-config))) > + (inputs > + `(("glut" ,freeglut))) > + (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+)))) > -- > 2.26.1 Otherwise, look goods to me, hope it helps!