From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id cDauMimDGmB+KQAA0tVLHw (envelope-from ) for ; Wed, 03 Feb 2021 11:04:09 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id IDt7LimDGmDQDAAAbx9fmQ (envelope-from ) for ; Wed, 03 Feb 2021 11:04:09 +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 E6928940627 for ; Wed, 3 Feb 2021 11:04:08 +0000 (UTC) Received: from localhost ([::1]:44708 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7Fx9-0000X0-SG for larch@yhetil.org; Wed, 03 Feb 2021 06:04:07 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:48216) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7Fx1-0000Ws-LC for guix-devel@gnu.org; Wed, 03 Feb 2021 06:03:59 -0500 Received: from m42-5.mailgun.net ([69.72.42.5]:20708) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l7Fx0-00082L-3r for guix-devel@gnu.org; Wed, 03 Feb 2021 06:03:59 -0500 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.wilsonb.com; q=dns/txt; s=krs; t=1612350237; h=Content-Transfer-Encoding: Content-Type: MIME-Version: Message-Id: In-Reply-To: References: From: Subject: Cc: To: Date: Sender; bh=6D/eRi8jhcbWXOHvhlf8cxEB1YuVzqc265ex6Z9a+84=; b=8e6vRXeFBbHD3Btzvb/5p0P7wT0WyGLchBrGpxTRkiryDyqGQAnbmR3hzOmLwxh2NCwfV44m Cuf/KSZL7Yj7M+a9OXR35F9bWWtZsVo/g26RKQa7e9gX3Nat0pU91M4i29El92BarcTRK5Mb gxlbPTGSfWfsI4rcgF/Stqle/TzMgIChsdaRefMVyLThkMKeP8hdbJkrMVeKFIf3XL/i+o85 dSd/cdCPY1FUIuysmOALrWDNk/ojK7wprBPPOXQOFXmaaMuAa8N+2YHLXWETarD3cPEWJsQ0 xf0GrBKlC8U1VzVj/vs1l5Ci1d4leYG+lp2DhOL0HXROGcS0Xa/8Hg== X-Mailgun-Sending-Ip: 69.72.42.5 X-Mailgun-Sid: WyIyNWJlMSIsICJndWl4LWRldmVsQGdudS5vcmciLCAiMDg1NDdhIl0= Received: from wilsonb.com (wilsonb.com [104.199.203.42]) by smtp-out-n04.prod.us-west-2.postgun.com with SMTP id 601a831d0d9638bc4c921d50 (version=TLS1.3, cipher=TLS_AES_128_GCM_SHA256); Wed, 03 Feb 2021 11:03:57 GMT Received: from localhost (x099243.dynamic.ppp.asahi-net.or.jp [122.249.99.243]) by wilsonb.com (Postfix) with ESMTPSA id D32C0A1802; Wed, 3 Feb 2021 11:03:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wilsonb.com; s=201703; t=1612350235; bh=6D/eRi8jhcbWXOHvhlf8cxEB1YuVzqc265ex6Z9a+84=; h=Date:To:Cc:Subject:From:References:In-Reply-To:From; b=quCEJVo5b/0TvitXGxkaOhZ4fsXJ6KDRwdqU3gpl+oYfHmvH6QJi4Zl7fDY36vOlo C1wvUWBOaxyME35ts3QFiQPWk6BRxIl9vGa/mItf9u3SM0BLMSBTqQ5jQu3FPYPgLm /VlWCSuz6+NUTuQcSjMsMx0HMXHi4ZWXpxvzjpe/lsqnRrTAWATuj1HtNxwHA1qtb5 VOpRjI+HD/TNkn3lN2aWpr8wpoueI66HGO+iZxmENcB1QlyREcWzD6YltT0NWlSPtA kWLf4js83iwgG3SsRNf5M4JOTIhqzEh6Y6g8EUysf2TSBmTJaOrVGIar/XLW3QhiXP uOLtteXycdBsoeEXaqRlWPH906VV1OHotW3oqRthHY4IK/D5i/Lt34Iz33hY+ppNYQ y4dNwAUCcXWqFsqZHYx2wcDpvd7lkNljvTPTVnHWIwDpnPvTG2Z1lpw3MgOcvkTBoR e+3boYK1hz5Yy4AzDB+GgjVeVQwnjj72RgQt7sHQ18hYaVwNczO/gwmC/ujqHhfaDP kg79DV0E2yyk44mn+5D3q/WmijJXVYNg6Dp51Rir6TANiu9levZu9j5KY0gyadMUc3 7YHGQBoR4lNCqxIDFTNIaF/UGW/5FWoQg3jicwhkY6OEAYEs9R+ymeGhUJLdFdD2J+ WXtWPYzd3h4eiYlLehyIoPTI= Date: Wed, 03 Feb 2021 20:04:19 +0900 To: Maxime Devos Subject: Re: Installing a wrapper guile script in /bin References: <3EA9135IVLYXR.223U6JDXT4SSS@wilsonb.com> <874kivlqol.fsf@gnu.org> <2VMUHEHLO03FL.3AF0SWRKGMFZ3@wilsonb.com> <6d41cb49f87561620e46f5e8a25946f2fbb927ab.camel@telenet.be> In-Reply-To: <6d41cb49f87561620e46f5e8a25946f2fbb927ab.camel@telenet.be> Message-Id: <3TT5JRKHCZ2E4.2VYCP49OAJARA@wilsonb.com> User-Agent: mblaze/1.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=69.72.42.5; envelope-from=bounce+ec9951.08547a-guix-devel=gnu.org@mg.wilsonb.com; helo=m42-5.mailgun.net X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: guix-devel@gnu.org, Ludovic =?UTF-8?Q?Court=C3=A8s?= Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: "Guix-devel" Reply-to: elaexuotee@wilsonb.com From: elaexuotee--- via "Development of GNU Guix and the GNU System distribution." X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -2.86 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=mg.wilsonb.com header.s=krs header.b=8e6vRXeF; dkim=fail ("headers rsa verify failed") header.d=wilsonb.com header.s=201703 header.b=quCEJVo5; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of guix-devel-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-devel-bounces@gnu.org X-Migadu-Queue-Id: E6928940627 X-Spam-Score: -2.86 X-Migadu-Scanner: scn1.migadu.com X-TUID: 4hOyQ67RcjNw Maxime Devos wrote: > Let's presume the binary is called $X. >=20 > What I would do: add a build phase after the "install" phase that renames= > /bin/$X to /bin/.$X-real using the rename-file procedure. Crea= te > your wrapper script at /bin/.$X-real with call-with-output-file, som= e > I/O procedures and chmod (to make the wrapper script executable). >=20 > I hope that helps, Maxime. Thanks for the pointers. The script contents are not what I'm confused about. I don't know how to tu= rn my gexp script into a file under /bin/. This is conceptually what I wa= nt: (package (name "foo") ... (arguments `(... #:phases (modify-phases %standard-phases ... (replace 'install (lambda* (#:key outputs #:allow-other-keys) (let ((out (assoc-ref outputs "out")) (wrapper-script #~(...))) ... ; Do normal install stuff (copy-file wrapper-script (string-append out "/bin/foo")) ... ; Finish install stuff ))))))) Of course `copy-file` doesn't work here because `wrapper-script` is a gexp = not a file. What code do I replace this with? I am vaguely aware things like `build-expression->derivation` to reify a ge= xp into a derivation; however, I'm not sure what to do with the derivation obj= ect in this case or if this is even on the right track. Cheers!