From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: Optional runtime dependencies in Guix Date: Mon, 12 Jan 2015 17:26:02 +0100 Message-ID: <87fvbgrmn9.fsf@gnu.org> References: <87zjbh3arc.fsf@gnu.org> <87twzwuyn9.fsf@gnu.org> <87vbkcxhx3.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:56469) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YAhog-0008Bt-OL for guix-devel@gnu.org; Mon, 12 Jan 2015 11:26:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YAhoa-0003Jr-A7 for guix-devel@gnu.org; Mon, 12 Jan 2015 11:26:10 -0500 Received: from hera.aquilenet.fr ([2a01:474::1]:37191) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YAhoZ-0003J8-Rh for guix-devel@gnu.org; Mon, 12 Jan 2015 11:26:04 -0500 In-Reply-To: <87vbkcxhx3.fsf@gmail.com> (=?utf-8?B?IuWui+aWh+atpiIncw==?= message of "Mon, 12 Jan 2015 21:11:36 +0800") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: =?utf-8?B?5a6L5paH5q2m?= Cc: guix-devel@gnu.org =E5=AE=8B=E6=96=87=E6=AD=A6 skribis: > Ludovic Court=C3=A8s writes: > >> Gammel Holte skribis: >> >>> For example, consider samtools, a package I use daily and that was rece= ntly >>> committed to Guix: >>> >>> http://git.savannah.gnu.org/cgit/guix.git/tree/gnu/packages/bioinformat= ics.scm#n139 >>> >>> It forces me to install python. In contrast, consider Arch AUR's packag= e: >>> >>> https://aur.archlinux.org/packages/samtools/ >> >> From looking at the page above, it seems that it would be feasible to >> simply move varfilter.py to a different output. That way, users would >> be able to install the default output (which doesn=E2=80=99t depend on P= ython), >> or the =E2=80=9Cpython=E2=80=9D output. Ricardo, WDYT? > Move it to a different output should work, but the 'python' output > doesn't make much sense to me compare to 'doc', 'bin' and 'debug'. Yeah, but I don=E2=80=99t see anything against using =E2=80=9Cpython=E2=80= =9D as an output name. > Note that 'python' is not a build dependency of 'samtools', so we > can only patch '#!/usr/bin/env' but not 'python' for varfilter.py. > Then we should give recommends or suggests, user need it could > install python manually. Right, that=E2=80=99s probably even simpler. >>> An extreme example of this is weechat: >>> >>> http://lists.gnu.org/archive/html/guix-devel/2014-09/msg00229.html >>> >>> Compare with: >>> >>> https://www.archlinux.org/packages/extra/i686/weechat/ >>> >>> Guix version forces the user to install all interpreters for running >>> user-defined scripts to extend Weechat. These are quite many: lua, perl, >>> python, ruby, tcl (and guile). >> >> Yes, I hadn=E2=80=99t noticed this and I agree this is problematic. >> >> Kevin, any idea on how to split things? > This is total different, those plugins must live in $out/lib/plugins > to work (can't move to seperated outputs). OK. This could be relaxed using an environment variable (say LTDL_LIBRARY_PATH, if Weechat uses libltdl.) > Keep in mind that interpreters are both build and runtime dependencies > of weechat, the nature way is making them optional when building: > > (define-public (%weechat #:key (python? #t) > (guile? #t) > ... > (package > (inputs > `(("python" ,(if python? python #nil)) > ("guile" ,(if guile? guile #nil)) > ... >=20=20=20=20=20=20=20=20 > > (define-public weechat (%weechat)) ; our default version > > Then user can install the customized version with: > $ guix package -e '((@ (gnu packages weechat) %weechat) #:python? #f)' Yes, but it=E2=80=99s not very convenient. To begin with, we could have a =E2=80=9Cweechat=E2=80=9D package with a =E2= =80=9Creasonable=E2=80=9D option set: (define weechat (make-weechat "weechat")) And possibly another variant with, say, all the options enabled: (define weechat-full (make-weechat "weechat-full" #:python? #t #:lua? #t)) This should satisfy most users and would be easily usable. This is already done for a few packages, notably Emacs and PETSc. And then demanding users can do as you suggest. WDYT? A long term possibility would be to officially support something like Gentoo=E2=80=99s =E2=80=9CUSE=E2=80=9D flags. These would be declared as p= art of the package, and the build process would take them into account somehow: (define weechat (package ... (inputs `(,@(if (package-option weechat 'guile) `(("guile" ,guile)) '()) ...)) (arguments `(#:configure-flags ,(if (package-option weechat 'guile) '("--with-guile") '()))) (options (list (option-specification (name 'guile) (description "Whether to support Guile plug-ins.") (default #t)))))) And then: $ guix package --show-options weechat ... $ guix package -i weechat -o guile How does that sound? Thanks, Ludo=E2=80=99.