From: Tobias Geerinckx-Rice <me@tobias.gr>
To: help-guix@gnu.org, Nathan Dehnel <ncdehnel@gmail.com>, saku@laesvuori.fi
Subject: Re: Store path in package definition
Date: Fri, 26 Aug 2022 21:09:26 +0000 [thread overview]
Message-ID: <BEB0208A-1EC0-424C-B97A-2C9265D7711D@tobias.gr> (raw)
In-Reply-To: <CAEEhgEuxLcrS+8BwyyEkzjozwR-NPHD4FXrTmW4S64TndbY9Uw@mail.gmail.com>
Hi,
On 26 August 2022 20:39:55 UTC, Nathan Dehnel <ncdehnel@gmail.com> wrote:
>Would something like this work?
>
>(string-append (assoc-ref %outputs "out") "/passff.py")
Consider this deprecated. It's unreliable and even where it appears to work can break for what seems to be no reason when, e.g., cross-compiling.
Modulo typos, and indentation being weird because 'phone,
(arguments
(list
#:make-flags
#~(list (string-append "HELLO=" #$output "/bin/hello"))
#:phases
#~(modify-phases %standard-phases
(add-after 'unpack 'option-one
(lambda _
(substitute* "foo.c"
(("hello")
(string-append #$output "/bin/hello")))))
(add-after 'unpack 'option-two
(lambda* (#:key outputs #:allow-other-keys
(let ((out (assoc-ref outputs "out")))
(substitute* "foo.c"
(("hello")
(string-append out "/bin/hello"))))))))))
From what you describe it sounds like you're using a phase, but I included make-flags to show that they work the same way.
I used to prefer option one, but actually prefer option two nowadays, because it's less magical.
>https://guix.gnu.org/cookbook/en/html_node/Extended-example.html#Build-system-arguments
This should be updated.
Kind regards,
T G-R
Sent on the go. Excuse or enjoy my brevity.
next prev parent reply other threads:[~2022-08-26 21:09 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-26 20:39 Store path in package definition Nathan Dehnel
2022-08-26 20:45 ` (
2022-08-26 21:09 ` Tobias Geerinckx-Rice [this message]
2022-08-28 14:30 ` Saku Laesvuori
-- strict thread matches above, loose matches on Subject: below --
2022-08-25 19:21 Saku Laesvuori
2022-08-27 10:44 ` Hartmut Goebel
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=BEB0208A-1EC0-424C-B97A-2C9265D7711D@tobias.gr \
--to=me@tobias.gr \
--cc=help-guix@gnu.org \
--cc=ncdehnel@gmail.com \
--cc=saku@laesvuori.fi \
/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.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.