From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: Toward 0.2 Date: Wed, 20 Feb 2013 12:28:27 +0100 Message-ID: <87ehgbql5w.fsf@gnu.org> References: <877gm7f01v.fsf@gnu.org> <87obfigz7g.fsf@karetnikov.org> <87y5el6hph.fsf@gnu.org> <87fw0rom1n.fsf@karetnikov.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([208.118.235.92]:58330) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U87qu-0000U0-Uc for bug-guix@gnu.org; Wed, 20 Feb 2013 06:28:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U87qo-0007vs-GQ for bug-guix@gnu.org; Wed, 20 Feb 2013 06:28:44 -0500 Received: from [2a01:e0b:1:123:ca0a:a9ff:fe03:271e] (port=60948 helo=xanadu.aquilenet.fr) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U87qo-0007td-A0 for bug-guix@gnu.org; Wed, 20 Feb 2013 06:28:38 -0500 In-Reply-To: <87fw0rom1n.fsf@karetnikov.org> (Nikita Karetnikov's message of "Tue, 19 Feb 2013 19:39:17 -0500") List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org To: Nikita Karetnikov Cc: bug-guix@gnu.org Nikita Karetnikov skribis: >> wrapProgram $out/bin/guile-snarf --prefix PATH : "${gawk}/bin" > > How can I get the output of a package? With the recently-added =E2=80=98package-output=E2=80=99 (singular): --8<---------------cut here---------------start------------->8--- scheme@(guile-user)> (package-output s binutils "out") $2 =3D "/nix/store/bfh5c2a4is27jdmc811fp6g0jfac7fiw-binutils-2.22" scheme@(guile-user)> (package-output s binutils "lib") $3 =3D "/nix/store/n29brzqlhjkzww51labk9anx493gl4d3-binutils-2.22-lib" --8<---------------cut here---------------end--------------->8--- Under the hood it calls =E2=80=98package-derivation=E2=80=99, which does th= e actual output path computation. >> #!/bin/sh >> export PATH=3D"/nix/store/...-gawk/bin:$PATH" >> exec ./.guile-snarf-real "$@" > > Should it be saved as 'guile-snarf'? And I have to use rename(2), > right? You first rename the wrapped program, then create the wrapper as above, and finally chmod it so that it=E2=80=99s executable. > What should I use to handle prefixes (e.g., a keyword, a simple > argument)? Should they be case insensitive? Good question. The thing is that sometimes you want to affect several environment variables. Maybe something like: (define* (wrap-program file #:rest variables) ...) Where each rest argument has a form like this: ("PATH" ":" prefix ("/nix/.../foo/bin" "/nix/.../bar/bin")) Instead of =E2=80=98prefix=E2=80=99, users could ask for =E2=80=98prefix=E2= =80=99 (prepend to the search path) or =E2=80=98=3D=E2=80=99 (set the search path to exactly that value.) WDYT? Ludo=E2=80=99.