[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Store path in package definition
From: |
Tobias Geerinckx-Rice |
Subject: |
Re: Store path in package definition |
Date: |
Fri, 26 Aug 2022 21:09:26 +0000 |
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.