From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id 4DGVMH7lv14jWAAA0tVLHw (envelope-from ) for ; Sat, 16 May 2020 13:07:10 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id eFaHLH7lv16SFgAAB5/wlQ (envelope-from ) for ; Sat, 16 May 2020 13:07:10 +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 52E64940369 for ; Sat, 16 May 2020 13:07:10 +0000 (UTC) Received: from localhost ([::1]:58460 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jZwWz-0006df-Af for larch@yhetil.org; Sat, 16 May 2020 09:07:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51392) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jZwWs-0006dN-9Z for guix-patches@gnu.org; Sat, 16 May 2020 09:07:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:56704) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jZwWs-0000Ta-0M for guix-patches@gnu.org; Sat, 16 May 2020 09:07:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jZwWr-00048l-SN for guix-patches@gnu.org; Sat, 16 May 2020 09:07: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: Sat, 16 May 2020 13:07: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.158963440115883 (code B ref 41294); Sat, 16 May 2020 13:07:01 +0000 Received: (at 41294) by debbugs.gnu.org; 16 May 2020 13:06:41 +0000 Received: from localhost ([127.0.0.1]:40017 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jZwWW-000487-TV for submit@debbugs.gnu.org; Sat, 16 May 2020 09:06:41 -0400 Received: from mail1.protonmail.ch ([185.70.40.18]:53517) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jZwWU-00047s-OU for 41294@debbugs.gnu.org; Sat, 16 May 2020 09:06:39 -0400 Date: Sat, 16 May 2020 13:06:23 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=elenq.tech; s=protonmail; t=1589634391; bh=7P1AyvnUyn7/RuqNnB/SB4U0hzFE5B16xNUZIJSz8Mg=; h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References:From; b=sRCqsJn2GKs08XsnxQM+Ktl4oOa/Gps4LJEEJbakN9yjxWyDGf5uJYSFCCNmclf8d 03+qOpTpjOHi6ILa8pJhnfeb/Owu62e6aA4sb4NY36bR7637pzAS07JGsLiFlpOcTj 7mpD7cJUBjdMdpxy5jiSB3nNUTQlF2TrlG01CxsE= From: Ekaitz Zarraga Message-ID: In-Reply-To: References: <5kf9uJF2SDo9zwlTUoFI13o7P7q68o-AuSp72MvOp5PUaF2SlAPxzQJvFws5aaTOB5EHY4T3-En0Mhba7hADMIeJkgCeWUOY_Ciy0fv24Ck=@elenq.tech> <87k11c5ymm.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=sRCqsJn2; 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: 0.09 X-TUID: QUQTFtU/fy+p > Inputs can also be defined with an extra argument for different outputs, = right? It should be something like: > > `(inputs`("freeglut" ,freeglut "examples")) > > Am I right? Nope! I've been digging and I got this wrong. The third part in the tuple is the = output of the dependency. So there's no way to indicate which dependencies are needed for each output= . I also found a flag to compile OpenCV wrappers, which depends on OpenCV. Op= enCV is huge and it's going to be downloaded regardless if its output is us= ed or not. Best choice here seems to be to separate the package in multiple= sub-packages. 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 t= he 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 "0was1va167rqshmpn382h36yyprpfi9cwillb6ylppmnfdrfr= hrr")))) (build-system cmake-build-system) (outputs '("out" "opencv" "examples")) (arguments '(#:tests? #f ; Project has not tests #:configure-flags '("-DBUILD_EXAMPLES=3DON" "-DBUILD_FAKENECT=3DON" "-DBUILD_CPP=3DON" "-DBUILD_CV=3DOFF" "-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.rul= es" (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 Kin= ect. 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=3DON" "-DBUILD_FAKENECT=3DOFF" "-DBUILD_CPP=3DOFF" "-DBUILD_C_SYNC=3DOFF") #:phases (modify-phases %standard-phases (add-after 'unpack 'remove-sources (lambda* (#:key outputs #:allow-other-keys) (substitute* "CMakeLists.txt" (("add_subdirectory \\(src\\)") "") ((".*libfreenectConfig.cmake.*") ""))))))) (synopsis "Examples for libfreenect, the Xbox Kinect device library")))