From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Lepiller Subject: Re: package definition: unbound variable ungexp Date: Sun, 09 Jun 2019 10:51:10 +0200 Message-ID: References: <3129e7be-1108-4ca5-95f6-93107dd0c9d2@www.fastmail.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:470:142:3::10]:59166) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hZtYf-0001La-AS for help-guix@gnu.org; Sun, 09 Jun 2019 04:52:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hZtYb-0007dF-Ge for help-guix@gnu.org; Sun, 09 Jun 2019 04:52:07 -0400 Received: from lepiller.eu ([2a00:5884:8208::1]:52460) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hZtYY-0007a0-Rf for help-guix@gnu.org; Sun, 09 Jun 2019 04:52:03 -0400 In-Reply-To: <3129e7be-1108-4ca5-95f6-93107dd0c9d2@www.fastmail.com> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+gcggh-help-guix=m.gmane.org@gnu.org Sender: "Help-Guix" To: help-guix@gnu.org, Reza Alizadeh Majd Le 9 juin 2019 08:26:24 GMT+02:00, Reza Alizadeh Majd a =C3=A9crit : >Hello Guix,=20 > >I want to create a plain file during package build and copy it to >output=2E=20 >but using following definition, I receive error on during package >installation: > >--- CODE: >-------------------------------------------------------------------------= ------------ >(add-after 'install 'register-plugin > (lambda* (#:key outputs #:allow-other-keys) > (let* ((out (assoc-ref outputs "out")) > (regpath (string-append out "/etc/px/accounts/plugins")) > (plugin-data (string-append "plugin:\n" > " name: " ,name "\n" > " version: " ,version "\n" > " type: python\n"))) > >(install-file #$(plain-file "test-plugin=2Eyaml" plugin-data) regpath)))) >-------------------------------------------------------------------------= ------------------------- > >and error that I received during package build:=20 > >--- ERROR: >-------------------------------------------------------------------------= ----------- >starting phase `register-plugin' >Backtrace: > 8 (primitive-load "/gnu/store/fpj6577yfiiz40ci39bw8zzycsy=E2= =80=A6") >In ice-9/eval=2Escm: > 191:35 7 (_ #f) >In srfi/srfi-1=2Escm: > 863:16 6 (every1 # =E2=80=A6) >In >/gnu/store/4r04fsfcryy5h4v2h3g6lzlibafmmdjm-module-import/guix/build/gnu-= build-system=2Escm: > 799:28 5 (_ _) >In ice-9/eval=2Escm: > 619:8 4 (_ #(#(#(#(#(#(#(#) =E2=80=A6) = =E2=80=A6) =E2=80=A6) =E2=80=A6) =E2=80=A6) =E2=80=A6)) > 159:9 3 (_ #(#(#(#(#(#(#(#) =E2=80=A6) = =E2=80=A6) =E2=80=A6) =E2=80=A6) =E2=80=A6) =E2=80=A6)) > 182:19 2 (proc #(#(#(#(#(#(#(#) =E2=80=A6) = =E2=80=A6) =E2=80=A6) =E2=80=A6) =E2=80=A6) =E2=80=A6)) > 142:16 1 (compile-top-call _ (7 =2E ungexp) ((10 (13 15 7 =2E #) # = =E2=80=A6))) >In unknown file: > 0 (%resolve-variable (7 =2E ungexp) #) > >ERROR: In procedure %resolve-variable: >Unbound variable: ungexp >-------------------------------------------------------------------------= ------------------------- > >does any one knows which package do I have to add in order to solve >this issue?=20 > > >Best,=20 >Reza Hi, I think the issue is that the builder doesn't use (guix gexp)=2E And you'r= e not inside a gexp either, so you can't ungexp=2E I think what you can do = is add an input with that code: (inputs `(("test-plugin=2Eyaml" ,(plain-file =E2=80=A6)))) Then inside your build phase, simply install this input with: (install-file (assoc-ref inputs "test-plugin=2Eyaml") regpath) Alternatively, you can write to the file directly in the phase: (with-output-to-file (string-append regpath "/test-plugin=2Eyaml") (lambda _ (format #t "=E2=80=A6")))