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: Fri, 01 Mar 2013 18:28:00 +0100 Message-ID: <87hakv6ndr.fsf@gnu.org> References: <877gm7f01v.fsf@gnu.org> <87obfigz7g.fsf@karetnikov.org> <87y5el6hph.fsf@gnu.org> <87fw0rom1n.fsf@karetnikov.org> <87ehgbql5w.fsf@gnu.org> <87hal5ftyu.fsf@karetnikov.org> <874nh4ju7b.fsf@gnu.org> <87hakzwdzu.fsf@karetnikov.org> <87wqtu3n0z.fsf@gnu.org> <87ehg0rwfd.fsf@karetnikov.org> <87bob38ord.fsf@gnu.org> <87sj4f6u39.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]:38626) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UBTkn-0006k4-9r for bug-guix@gnu.org; Fri, 01 Mar 2013 12:28:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UBTkh-0003AC-Rt for bug-guix@gnu.org; Fri, 01 Mar 2013 12:28:17 -0500 Received: from [2a01:e0b:1:123:ca0a:a9ff:fe03:271e] (port=54518 helo=xanadu.aquilenet.fr) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UBTkh-00037v-KT for bug-guix@gnu.org; Fri, 01 Mar 2013 12:28:11 -0500 In-Reply-To: <87sj4f6u39.fsf@karetnikov.org> (Nikita Karetnikov's message of "Fri, 01 Mar 2013 10:01:39 -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: >> It=E2=80=99s not needed. All that needed is the name of the executable = file >> to wrap. > > I don't understand. How will 'rename-file' get the location of the > executable? For example: > > (wrap-program "wget" [...]) > > I guess that it will only work if you invoke 'wrap-program' from the > same directory. Yes, and that=E2=80=99s what we want. However, the =E2=80=98exec=E2=80=99 line in the wrapper needs the absolute = file name. For that it can do along the lines of: (string-append "exec " (canonicalize-path file)) >> For the case where there are have several variables you want to set. > > Could you provide an example? The following works without '#:rest': > > (display (wrap-program "wget" '(("PATH" ":" =3D ("/nix/.../gawk/bin")) > ("CERT_PATH" ":" suffix ("/nix/.../share/= certs" > "/nix/.../foo/ce= rts"))))) Yeah there are two choices: two required arguments (like above), where the second one is a list, or one required argument and one rest argument. In the latter case, you would instead do: (wrap-program "wget" '("PATH" ":" =3D ("/nix/.../gawk/bin")) '("CERT_PATH" ":" suffix ("/nix/.../share/certs" "/nix/.../foo/certs"))) I tend to prefer this form because it may be more concise in common cases. HTH, Ludo=E2=80=99.