Re: Unexpected error with #~(modify-phases

2023-01-27 Thread Simon Tournier
Hi Tobias,

On Fri, 27 Jan 2023 at 20:03, Tobias Geerinckx-Rice  wrote:
>
> You're probably missing (guix gexp), and the 'replace' syntax fails before 
> Guile ever gets to expanding the '#~'.

Damned!  Stupid me!  I missed the obvious.  Thanks for the quick help. :-)

Cheerw,
simon



Re: Unexpected error with #~(modify-phases

2023-01-27 Thread Tobias Geerinckx-Rice
You're probably missing (guix gexp), and the 'replace' syntax fails before 
Guile ever gets to expanding the '#~'.

Kind regards,

T G-R

Sent on the go.  Excuse or enjoy my brevity.



Unexpected error with #~(modify-phases

2023-01-27 Thread Simon Tournier
Hi,

Reviewing #59997 [1], there is something I am missing.

Using the V2, all works as expected.  But when I just modify with this
diff:

--8<---cut here---start->8---
1 file changed, 2 insertions(+), 2 deletions(-)
gnu/packages/minimacy.scm | 4 ++--

modified   gnu/packages/minimacy.scm
@@ -48,8 +48,8 @@ (define-public minimacy
"X11" ;for GUI programs, with X11 and ALSA
"X11GL")) ;for GUI programs, with X11, OpenGL, and ALSA
 (arguments
- `(#:phases
-   (modify-phases %standard-phases
+ (list #:phases
+   #~(modify-phases %standard-phases
  (add-after 'unpack 'patch-path
(lambda* (#:key outputs #:allow-other-keys)
  (substitute* "src/hw.c"
--8<---cut here---end--->8---

then I get this error:

--8<---cut here---start->8---
gnu/packages/minimacy.scm:59:9: error: (replace (quote build) (lambda _ (chdir 
"unix") (invoke "make" "nox") (for-each delete-file (find-files "../obj" 
"\\.o$")) (invoke "make" "x11") (for-each delete-file (find-files "../obj" 
"\\.o$")) (invoke "make" "x11gl") (chdir ".."))): 'replace' may only be used 
within 'modify-inputs'
--8<---cut here---end--->8---

where the (unmodified) phase reads:

--8<---cut here---start->8---
 (add-after 'unpack 'patch-path
[...]
 (delete 'configure)
 (replace 'build
   (lambda _
 (chdir "unix")
 (invoke "make" "nox")
 (for-each delete-file
   (find-files "../obj" "\\.o$"))
 (invoke "make" "x11")
 (for-each delete-file
   (find-files "../obj" "\\.o$"))
 (invoke "make" "x11gl")
 (chdir "..")))
 (replace 'install
[...]
--8<---cut here---end--->8---

What do I miss?

1: https://issues.guix.gnu.org/msgid/m1tu219bmo@fastmail.net


Cheers,
simon