unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
From: Xinglu Chen <public@yoctocell.xyz>
To: Foo Chuan Wei <chuanwei.foo@hotmail.com>, help-guix@gnu.org
Subject: Re: How to add /bin/sh to the build environment
Date: Mon, 08 Nov 2021 17:54:12 +0100	[thread overview]
Message-ID: <87bl2u37wr.fsf@disroot.org> (raw)
In-Reply-To: <PU1PR01MB215518323856E1943404F8138D919@PU1PR01MB2155.apcprd01.prod.exchangelabs.com>

[-- Attachment #1: Type: text/plain, Size: 767 bytes --]

Hi,

On Mon, Nov 08 2021, Foo Chuan Wei wrote:

> I am trying to package the Standard ML of New Jersey (SML/NJ) compiler
> in Guix. My current understanding is that its installation process
> relies on the existence of /bin/sh in a fundamental way. Is there a way
> to add /bin/sh to the build environment?
>
> In the build phase of the package definition, I tried something like
> this:
>
>     (mkdir-p "/bin")
>     (symlink (which "sh") "/bin/sh")

I would use ‘substitute*’ from (guix build utils) to patch the
references to /bin/sh

  (lambda* (#:key inputs #:allow-other-keys)
    (let ((sh (assoc-ref inputs "bash")))
      (substitute* "some-file"
       (("\"/bin/sh\"") (string-append "\"" sh "/bin/sh\"")))))

Hope that helps!

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 861 bytes --]

  reply	other threads:[~2021-11-08 16:54 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-08  9:25 How to add /bin/sh to the build environment Foo Chuan Wei
2021-11-08 16:54 ` Xinglu Chen [this message]
2021-11-08 20:19   ` Foo Chuan Wei
2021-11-08 22:23     ` Leo Famulari
2021-11-09  1:36       ` Philip McGrath
2021-11-09  3:51         ` Foo Chuan Wei
2021-11-10  1:41         ` Leo Famulari
2021-11-08 22:58     ` Philip McGrath

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87bl2u37wr.fsf@disroot.org \
    --to=public@yoctocell.xyz \
    --cc=chuanwei.foo@hotmail.com \
    --cc=help-guix@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).