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 WAluA8rkw165OwAA0tVLHw (envelope-from ) for ; Tue, 19 May 2020 13:53:14 +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 6PgBO8nkw149IwAA1q6Kng (envelope-from ) for ; Tue, 19 May 2020 13:53:13 +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 70EB3940712 for ; Tue, 19 May 2020 13:53:13 +0000 (UTC) Received: from localhost ([::1]:54906 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jb2gA-0006aV-I1 for larch@yhetil.org; Tue, 19 May 2020 09:53:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35726) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jb2g2-0006a5-17 for guix-patches@gnu.org; Tue, 19 May 2020 09:53:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:38094) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jb2g1-0006AK-OP for guix-patches@gnu.org; Tue, 19 May 2020 09:53:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jb2g1-0001Em-Ht for guix-patches@gnu.org; Tue, 19 May 2020 09:53: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: Tue, 19 May 2020 13:53: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.15898963614728 (code B ref 41294); Tue, 19 May 2020 13:53:01 +0000 Received: (at 41294) by debbugs.gnu.org; 19 May 2020 13:52:41 +0000 Received: from localhost ([127.0.0.1]:49640 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jb2fc-0001E5-Td for submit@debbugs.gnu.org; Tue, 19 May 2020 09:52:41 -0400 Received: from mail-40134.protonmail.ch ([185.70.40.134]:25447) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jb2fX-0001Df-7m for 41294@debbugs.gnu.org; Tue, 19 May 2020 09:52:35 -0400 Date: Tue, 19 May 2020 13:52:15 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=elenq.tech; s=protonmail; t=1589896344; bh=HzedybxUYcY19RhRvyGmbpSnA8Bc6I4HUHPNVV8YoVI=; h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References:From; b=D4JkZdzwWEzUmODxsXa+yzbZl1b4e9QZvuzmFITl7ZwXgefEdeBbHyxHyTnon4l/4 qjG61G4MKb8N87sOq8H9g8qxRanWmWkARwJIMPrgh1AUPvyzFQqP3AKsX5eiTkb6MK Zf9yHm9msDbK6ngrxH3TI7IGZ0TUTb7CVqaRfY2o= From: Ekaitz Zarraga Message-ID: <9ZfB8rv2oVS3f1P4KqZV9twP9VRoO9GNuPvbzT_BjLAzXCs6kumdqaIPD_TMejSv5B0D34dg6tpbmKPmIQxuLW64pU35VX5LGNn5tM9Ka04=@elenq.tech> In-Reply-To: References: <5kf9uJF2SDo9zwlTUoFI13o7P7q68o-AuSp72MvOp5PUaF2SlAPxzQJvFws5aaTOB5EHY4T3-En0Mhba7hADMIeJkgCeWUOY_Ciy0fv24Ck=@elenq.tech> <87k11c5ymm.fsf@member.fsf.org> <87sgfz1f43.fsf@member.fsf.org> <87eergqcn4.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=D4JkZdzw; 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: ZccUeXo3GzRM =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 Tuesday, May 19, 2020 3:42 PM, Ekaitz Zarraga wrote: > Hi, > > > > There's some kind of weird magic I'm not getting. > > > > Hello, I don't know the whole detail too, but to build a package, guix = likely: > > > > - Load and eval the package module, to get the package object. The > > 'arguments' field is a list. > > > > - Convert this package object to a derivation, and write it in store = as > > a file (/gnu/store/*.drv). Where 'arguments' being part of the > > builder, serialize as string to the file, it dosen't do complex thi= ngs > > for procedure bindings, only write their string descriptions... So > > when the builder file is loaded, you get `Unknown object` errors. > > Here, to avoid duplicating the code, you can: > > > > > > 1. Unquote list value into `arguments`. (eg: 'asdf-substitutions' in l= isp.scm) > > This doesn't work for me. I don't know why. > > Just moved the lambda to a (define* deactivate-sources ...) and then when= I try to put the name like > > (arguments `( #tests? .... ,deactivate-sources ...) > > Shoots an Unknown object error. I add a diff below to let you see the who= le picture of what I did and doesn't work. > > > 2. Use `(package-arguments libfreenect-examples)` with > > `substitute-keyword-arguments` to reuse arguments, but modify > > `configure-flags` etc. (eg: qtx11extras) > > The build system can use 'imported-modules' to make a set of guile > > modules (which can contains useful procedures, etc.) available to t= he > > builder, but thas's overkill to be used here... > > > > I'll check that option too. > > Thank you for your help! > > 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 \ > %D%/packages/nvi.scm \ > %D%/packages/ocaml.scm \ > %D%/packages/ocr.scm \ > > - %D%/packages/openkinect.scm \ > %D%/packages/onc-rpc.scm \ > %D%/packages/opencl.scm \ > %D%/packages/openbox.scm \ > diff --git a/gnu/packages/openkinect.scm b/gnu/packages/openkinect.sc= m > new file mode 100644 > index 0000000000..5a17acef0e > --- /dev/null > +++ b/gnu/packages/openkinect.scm > @@ -0,0 +1,127 @@ > +(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 "0was1va167rqshmpn382h36yyprpfi9cwillb6ylppmn= fdrfrhrr")))) > > > - (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-example= s > > > - "-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-kinec= t.rules" > > > - (string-append rules-out "51-kinect.rul= es")) > > > - #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 Microsof= t Kinect. > > > > +It supports: RGB and Depth Images, Motors, Accelerometer, LED and Audio.= ") > > - (home-page "https://openkinect.org/") > > > - (license license:gpl2+)))) > > > - > > +(define (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 > > > - (modify-phases %standard-phases > > > - ;; Sources are already compiled in libfreenect input > > > - (add-after 'unpack 'disable-sources ,disable-sources)))) ;; U= NKNOW OBJECT! > > > - (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 > > > - (modify-phases %standard-phases > > > - ;; Sources are already compiled in libfreenect input > > > - (add-after 'unpack 'disable-sources ,disable-sources)))) > > > - (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 > > > - (modify-phases %standard-phases > > > - ;; Sources are already compiled in libfreenect input > > > - (add-after 'unpack 'disable-sources ,disable-sources)))) > > > - (synopsis "Python wrapper for libfreenect, the Xbox Kinect device > +library"))) > oh, the code is wrong, there parenthesis on the define are making it a function= but anyway: - Tested using ,(disable-sources) FAIL - Tested removing the parenthesis and leaving (define disable-sources (lamb= da*...)) There must be something I'm missing.