[PATCH 0/3] Happy hacking in the Spring 2021 LGJ

  • Done
  • quality assurance status badge
Details
3 participants
  • Efraim Flashner
  • Leo Prikler
  • Ludovic Courtès
Owner
unassigned
Submitted by
Leo Prikler
Severity
normal
L
L
Leo Prikler wrote on 16 Apr 2021 13:05
(address . guix-patches@gnu.org)
20210416110511.9812-1-leo.prikler@student.tugraz.at
Hi Guix,

the spring 2021 Lisp Game Jam is here, which hopefully results in some
more free software games being written. I won't promote it much further,
since the site itself rather talks about "open source" games -- which, as
we all know, are not always free -- but I hope this patch set helps some
of you write a truly free game in the coming ten days.

Regards,
Leo

Leo Prikler (3):
gnu: guile-sdl2: Update to 0.6.0.
gnu: guile-chickadee: Update to 0.7.0.
gnu: tsukundere: Update to 0.3.0.

gnu/packages/game-development.scm | 49 +++++++++++++++++++------------
gnu/packages/sdl.scm | 4 +--
2 files changed, 32 insertions(+), 21 deletions(-)

--
2.31.1
L
L
Leo Prikler wrote on 16 Apr 2021 13:07
[PATCH 1/3] gnu: guile-sdl2: Update to 0.6.0.
(address . 47824@debbugs.gnu.org)
20210416110723.9938-1-leo.prikler@student.tugraz.at
* gnu/packages/sdl.scm (guile-sdl2): Update to 0.6.0.
---
gnu/packages/sdl.scm | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

Toggle diff (23 lines)
diff --git a/gnu/packages/sdl.scm b/gnu/packages/sdl.scm
index 8db731bbc4..128bd95af8 100644
--- a/gnu/packages/sdl.scm
+++ b/gnu/packages/sdl.scm
@@ -620,14 +620,14 @@ sound and device input (keyboards, joysticks, mice, etc.).")
(define-public guile-sdl2
(package
(name "guile-sdl2")
- (version "0.5.0")
+ (version "0.6.0")
(source (origin
(method url-fetch)
(uri (string-append "https://files.dthompson.us/guile-sdl2/"
"guile-sdl2-" version ".tar.gz"))
(sha256
(base32
- "118x0cg7fzbsyrfhy5f9ab7dqp9czgia0ycgzp6sn3nlsdrcnr4m"))))
+ "06vrknn4iz0ag932rb4almyhi9cvdkn081shvsi0h4skd6ry8bdl"))))
(build-system gnu-build-system)
(arguments
'(#:make-flags '("GUILE_AUTO_COMPILE=0")))
--
2.31.1
L
L
Leo Prikler wrote on 16 Apr 2021 13:07
[PATCH 2/3] gnu: guile-chickadee: Update to 0.7.0.
(address . 47824@debbugs.gnu.org)
20210416110723.9938-2-leo.prikler@student.tugraz.at
* gnu/packages/game-development.scm (guile-chickadee): Update to 0.7.0.
---
gnu/packages/game-development.scm | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

Toggle diff (23 lines)
diff --git a/gnu/packages/game-development.scm b/gnu/packages/game-development.scm
index 679da99e63..0d4855d275 100644
--- a/gnu/packages/game-development.scm
+++ b/gnu/packages/game-development.scm
@@ -1856,14 +1856,14 @@ a 2D editor view.")
(define-public guile-chickadee
(package
(name "guile-chickadee")
- (version "0.6.0")
+ (version "0.7.0")
(source (origin
(method url-fetch)
(uri (string-append "https://files.dthompson.us/chickadee/"
"chickadee-" version ".tar.gz"))
(sha256
(base32
- "1jv4jkc35b7rizz8iflh74hhk9qy665isn1xa6gqz0qp9grwb019"))))
+ "199y4kc28va6klfs19h998sfh7vx9spnrvjw7p92i47q5a7jdcp6"))))
(build-system gnu-build-system)
(arguments
'(#:make-flags '("GUILE_AUTO_COMPILE=0")))
--
2.31.1
L
L
Leo Prikler wrote on 16 Apr 2021 13:07
[PATCH 3/3] gnu: tsukundere: Update to 0.3.0.
(address . 47824@debbugs.gnu.org)
20210416110723.9938-3-leo.prikler@student.tugraz.at
* gnu/packages/game-development.scm (tsukundere): Update to 0.3.0.
[patch-command]: Patch path to guile. Construct load paths directly from
inputs.
[propagated-inputs]: Remove.
[inputs]: Add guile (as guile-runtime) and guile-sdl2.
---
gnu/packages/game-development.scm | 45 +++++++++++++++++++------------
1 file changed, 28 insertions(+), 17 deletions(-)

Toggle diff (85 lines)
diff --git a/gnu/packages/game-development.scm b/gnu/packages/game-development.scm
index 0d4855d275..98ef88971a 100644
--- a/gnu/packages/game-development.scm
+++ b/gnu/packages/game-development.scm
@@ -493,7 +493,7 @@ clone.")
(define-public tsukundere
(package
(name "tsukundere")
- (version "0.2.3")
+ (version "0.3.0")
(source (origin
(method git-fetch)
(uri (git-reference
@@ -502,10 +502,11 @@ clone.")
(file-name (git-file-name name version))
(sha256
(base32
- "05ckds2df810441wfavllx9lsw5jsc9h3nb7m31df01nsj56azdw"))))
+ "06jiaylbnx8khicsaq2gwnd8wspjhjymbb5z6x5445krklk0jx18"))))
(build-system gnu-build-system)
(arguments
- `(#:modules (((guix build guile-build-system)
+ `(#:modules ((srfi srfi-1)
+ ((guix build guile-build-system)
#:select (target-guile-effective-version))
,@%gnu-build-system-modules)
#:imported-modules ((guix build guile-build-system)
@@ -513,22 +514,31 @@ clone.")
#:phases
(modify-phases %standard-phases
(add-after 'unpack 'patch-command
- (lambda* (#:key outputs #:allow-other-keys)
- (let* ((out (assoc-ref outputs "out"))
- (version (target-guile-effective-version))
- (scm (string-append out "/share/guile/site/"
- version))
- (go (string-append out "/lib/guile/"
- version "/site-ccache")))
-
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (let* ((version (target-guile-effective-version))
+ (scm (lambda (in)
+ (string-append in "/share/guile/site/"
+ version)))
+ (go (lambda (in)
+ (string-append in "/lib/guile/" version
+ "/site-ccache")))
+ (pkgs
+ (cons
+ (assoc-ref outputs "out")
+ (filter-map
+ (lambda (input)
+ (and (string-prefix? "guile-" (car input)) (cdr input)))
+ inputs))))
(substitute* "bin/tsukundere"
- (("exec guile .*" all)
+ (("exec guile (.*)" _ args)
(string-append
(format #f "export GUILE_LOAD_PATH=~@?~%"
- "\"~a:~a\"" scm (getenv "GUILE_LOAD_PATH"))
+ "\"~{~a~^:~}\"" (map scm pkgs))
(format #f "export GUILE_LOAD_COMPILED_PATH=~@?~%"
- "\"~a:~a\"" go (getenv "GUILE_LOAD_COMPILED_PATH"))
- all)))
+ "\"~{~a~^:~}\"" (map go pkgs))
+ "exec "
+ (assoc-ref inputs "guile-runtime")
+ "/bin/guile " args)))
#t))))))
(native-inputs
`(("autoconf" ,autoconf)
@@ -536,8 +546,9 @@ clone.")
("guile" ,guile-3.0)
("pkg-config" ,pkg-config)
("texinfo" ,texinfo)))
- (propagated-inputs
- `(("guile-sdl2" ,guile3.0-sdl2)))
+ (inputs
+ `(("guile-sdl2" ,guile3.0-sdl2)
+ ("guile-runtime" ,guile-3.0)))
(home-page "https://gitlab.com/leoprikler/tsukundere")
(synopsis "Visual novel engine")
(description "Tsukundere is a game engine geared heavily towards the
--
2.31.1
E
E
Efraim Flashner wrote on 19 Apr 2021 09:56
(name . Leo Prikler)(address . leo.prikler@student.tugraz.at)(address . 47824@debbugs.gnu.org)
YH03x7d1Eh5HRIxj@3900XT
Attachment: file
-----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEEoov0DD5VE3JmLRT3Qarn3Mo9g1EFAmB9N8UACgkQQarn3Mo9
g1ENLQ/+Kd2XpH93QnltLOYttlPuWg0agPrAi4WN171Z+mvAFiq/rMkAZdpF6XFU
fNU2Q8PMRwep41G63d2V9Vsho7fycT4TtOwtFKDcKGMXmzv7SzlVPFEaQsJdhgar
uXoiWz0XQVzBhItdGX0uxaaRc0M0qw/3t1w2iIjsOWTTbyxTwYbWKdmvPjdi8cGF
q+uIA1eEJ3kCcOwCyy+XoTDCSFTu+Ofx3cz7awHCM4ZeS+Nc5sSvox1xn9WtEtjp
IOLOelpx8LBXmq16qTqAqvhFSTyTKHnQtK3J5d80DH8F9s1JXY8UyHAVYWu03krj
OxcAsobiYzjq34r2C7Qkra22o+aLw3rkhcUrxJBB526B9p7xbDKrQtNOag6WW+RA
/blhtYd4S6Po14UM9Gj82oR3NCmb43f0jiOLv3T/bfaaMxGslhAJaqmGOfn5kBy5
Uldgk5muWcyRVLGrX3IPgYeOnAHTngGi7URSKeF+Kp3sDe8AAeXspN9cPdOsiFaq
XI3lMAsLWqjXosdh/5h6YKxQBQCEigafX+CvoTxZbxj4cC9FcWFjTnS99g/0Nwcd
TpU1dZsgPqd3RRDRCps3zuSUElcyXLhJmxHnv8fPnXH5iHmmxsmr4Wgaxc7CZMk8
XIKPNi9r/ledQgScNm9oY2aFBypdjkRxFZCh0w4PMmsOi6evmG4=
=H1Nu
-----END PGP SIGNATURE-----


L
L
Leo Prikler wrote on 19 Apr 2021 10:17
[PATCH v2 1/3] gnu: guile-sdl2: Update to 0.6.0.
(address . 47824@debbugs.gnu.org)(address . efraim@flashner.co.il)
20210419081744.7247-1-leo.prikler@student.tugraz.at
* gnu/packages/sdl.scm (guile-sdl2): Update to 0.6.0.
---
gnu/packages/sdl.scm | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

Toggle diff (23 lines)
diff --git a/gnu/packages/sdl.scm b/gnu/packages/sdl.scm
index 8db731bbc4..128bd95af8 100644
--- a/gnu/packages/sdl.scm
+++ b/gnu/packages/sdl.scm
@@ -620,14 +620,14 @@ sound and device input (keyboards, joysticks, mice, etc.).")
(define-public guile-sdl2
(package
(name "guile-sdl2")
- (version "0.5.0")
+ (version "0.6.0")
(source (origin
(method url-fetch)
(uri (string-append "https://files.dthompson.us/guile-sdl2/"
"guile-sdl2-" version ".tar.gz"))
(sha256
(base32
- "118x0cg7fzbsyrfhy5f9ab7dqp9czgia0ycgzp6sn3nlsdrcnr4m"))))
+ "06vrknn4iz0ag932rb4almyhi9cvdkn081shvsi0h4skd6ry8bdl"))))
(build-system gnu-build-system)
(arguments
'(#:make-flags '("GUILE_AUTO_COMPILE=0")))
--
2.31.1
L
L
Leo Prikler wrote on 19 Apr 2021 10:17
[PATCH v2 2/3] gnu: guile-chickadee: Update to 0.7.0.
(address . 47824@debbugs.gnu.org)(address . efraim@flashner.co.il)
20210419081744.7247-2-leo.prikler@student.tugraz.at
* gnu/packages/game-development.scm (guile-chickadee): Update to 0.7.0.
---
gnu/packages/game-development.scm | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

Toggle diff (23 lines)
diff --git a/gnu/packages/game-development.scm b/gnu/packages/game-development.scm
index 679da99e63..0d4855d275 100644
--- a/gnu/packages/game-development.scm
+++ b/gnu/packages/game-development.scm
@@ -1856,14 +1856,14 @@ a 2D editor view.")
(define-public guile-chickadee
(package
(name "guile-chickadee")
- (version "0.6.0")
+ (version "0.7.0")
(source (origin
(method url-fetch)
(uri (string-append "https://files.dthompson.us/chickadee/"
"chickadee-" version ".tar.gz"))
(sha256
(base32
- "1jv4jkc35b7rizz8iflh74hhk9qy665isn1xa6gqz0qp9grwb019"))))
+ "199y4kc28va6klfs19h998sfh7vx9spnrvjw7p92i47q5a7jdcp6"))))
(build-system gnu-build-system)
(arguments
'(#:make-flags '("GUILE_AUTO_COMPILE=0")))
--
2.31.1
L
L
Leo Prikler wrote on 19 Apr 2021 10:17
[PATCH v2 3/3] gnu: tsukundere: Update to 0.3.0.
(address . 47824@debbugs.gnu.org)(address . efraim@flashner.co.il)
20210419081744.7247-3-leo.prikler@student.tugraz.at
* gnu/packages/game-development.scm (tsukundere): Update to 0.3.0.
[patch-command]: Patch path to guile. Construct load paths directly from
inputs.
[propagated-inputs]: Remove.
[inputs]: Add guile (as guile-runtime) and guile-sdl2.
---
gnu/packages/game-development.scm | 51 +++++++++++++++++++------------
1 file changed, 32 insertions(+), 19 deletions(-)

Toggle diff (89 lines)
diff --git a/gnu/packages/game-development.scm b/gnu/packages/game-development.scm
index 0d4855d275..ccf1fbdc5d 100644
--- a/gnu/packages/game-development.scm
+++ b/gnu/packages/game-development.scm
@@ -493,7 +493,7 @@ clone.")
(define-public tsukundere
(package
(name "tsukundere")
- (version "0.2.3")
+ (version "0.3.0")
(source (origin
(method git-fetch)
(uri (git-reference
@@ -502,10 +502,12 @@ clone.")
(file-name (git-file-name name version))
(sha256
(base32
- "05ckds2df810441wfavllx9lsw5jsc9h3nb7m31df01nsj56azdw"))))
+ "06jiaylbnx8khicsaq2gwnd8wspjhjymbb5z6x5445krklk0jx18"))))
(build-system gnu-build-system)
(arguments
- `(#:modules (((guix build guile-build-system)
+ `(#:modules ((ice-9 match)
+ (srfi srfi-1)
+ ((guix build guile-build-system)
#:select (target-guile-effective-version))
,@%gnu-build-system-modules)
#:imported-modules ((guix build guile-build-system)
@@ -513,22 +515,32 @@ clone.")
#:phases
(modify-phases %standard-phases
(add-after 'unpack 'patch-command
- (lambda* (#:key outputs #:allow-other-keys)
- (let* ((out (assoc-ref outputs "out"))
- (version (target-guile-effective-version))
- (scm (string-append out "/share/guile/site/"
- version))
- (go (string-append out "/lib/guile/"
- version "/site-ccache")))
-
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (let* ((scm (lambda (in)
+ (string-append in "/share/guile/site/"
+ (target-guile-effective-version))))
+ (ccache (lambda (in)
+ (string-append in "/lib/guile/"
+ (target-guile-effective-version)
+ "/site-ccache")))
+ (pkgs
+ (cons
+ (assoc-ref outputs "out")
+ (filter-map
+ (match-lambda
+ ((label . pkg)
+ (and (string-prefix? "guile-" label) pkg)))
+ inputs))))
(substitute* "bin/tsukundere"
- (("exec guile .*" all)
+ (("exec guile (.*)" _ args)
(string-append
- (format #f "export GUILE_LOAD_PATH=~@?~%"
- "\"~a:~a\"" scm (getenv "GUILE_LOAD_PATH"))
- (format #f "export GUILE_LOAD_COMPILED_PATH=~@?~%"
- "\"~a:~a\"" go (getenv "GUILE_LOAD_COMPILED_PATH"))
- all)))
+ (format #f "export GUILE_LOAD_PATH=\"~@?\"~%"
+ "\"~{~a~^:~}\"" (map scm pkgs))
+ (format #f "export GUILE_LOAD_COMPILED_PATH=\"~@?\"~%"
+ "\"~{~a~^:~}\"" (map ccache pkgs))
+ "exec "
+ (assoc-ref inputs "guile-runtime")
+ "/bin/guile " args)))
#t))))))
(native-inputs
`(("autoconf" ,autoconf)
@@ -536,8 +548,9 @@ clone.")
("guile" ,guile-3.0)
("pkg-config" ,pkg-config)
("texinfo" ,texinfo)))
- (propagated-inputs
- `(("guile-sdl2" ,guile3.0-sdl2)))
+ (inputs
+ `(("guile-sdl2" ,guile3.0-sdl2)
+ ("guile-runtime" ,guile-3.0)))
(home-page "https://gitlab.com/leoprikler/tsukundere")
(synopsis "Visual novel engine")
(description "Tsukundere is a game engine geared heavily towards the
--
2.31.1
L
L
Leo Prikler wrote on 19 Apr 2021 10:24
Re: [bug#47824] [PATCH 3/3] gnu: tsukundere: Update to 0.3.0.
(name . Efraim Flashner)(address . efraim@flashner.co.il)(address . 47824@debbugs.gnu.org)
ad2246fe1deda5d9165231c0aca5c067fac46e51.camel@student.tugraz.at
Am Montag, den 19.04.2021, 10:56 +0300 schrieb Efraim Flashner:
Toggle quote (60 lines)
> On Fri, Apr 16, 2021 at 01:07:23PM +0200, Leo Prikler wrote:
> > * gnu/packages/game-development.scm (tsukundere): Update to 0.3.0.
> > [patch-command]: Patch path to guile. Construct load paths
> > directly from
> > inputs.
> > [propagated-inputs]: Remove.
> > [inputs]: Add guile (as guile-runtime) and guile-sdl2.
> > ---
> > gnu/packages/game-development.scm | 45 +++++++++++++++++++------
> > ------
> > 1 file changed, 28 insertions(+), 17 deletions(-)
> >
> > diff --git a/gnu/packages/game-development.scm b/gnu/packages/game-
> > development.scm
> > index 0d4855d275..98ef88971a 100644
> > --- a/gnu/packages/game-development.scm
> > +++ b/gnu/packages/game-development.scm
> > @@ -493,7 +493,7 @@ clone.")
> > (define-public tsukundere
> > (package
> > (name "tsukundere")
> > - (version "0.2.3")
> > + (version "0.3.0")
> > (source (origin
> > (method git-fetch)
> > (uri (git-reference
> > @@ -502,10 +502,11 @@ clone.")
> > (file-name (git-file-name name version))
> > (sha256
> > (base32
> > - "05ckds2df810441wfavllx9lsw5jsc9h3nb7m31df01nsj56a
> > zdw"))))
> > + "06jiaylbnx8khicsaq2gwnd8wspjhjymbb5z6x5445krklk0j
> > x18"))))
> > (build-system gnu-build-system)
> > (arguments
> > - `(#:modules (((guix build guile-build-system)
> > + `(#:modules ((srfi srfi-1)
> > + ((guix build guile-build-system)
> > #:select (target-guile-effective-version))
> > ,@%gnu-build-system-modules)
> > #:imported-modules ((guix build guile-build-system)
> > @@ -513,22 +514,31 @@ clone.")
> > #:phases
> > (modify-phases %standard-phases
> > (add-after 'unpack 'patch-command
> > - (lambda* (#:key outputs #:allow-other-keys)
> > - (let* ((out (assoc-ref outputs "out"))
> > - (version (target-guile-effective-version))
> > - (scm (string-append out "/share/guile/site/"
> > - version))
> > - (go (string-append out "/lib/guile/"
> > - version "/site-ccache")))
> > -
> > + (lambda* (#:key inputs outputs #:allow-other-keys)
> > + (let* ((version (target-guile-effective-version))
>
> I see that the code before uses version but I wouldn't overwrite the
> version variable which normally points to the package's version. I
> suggest guile-version or something similar.
Good point. Since it's only used to construct scm and go (now ccache),
I've decided to inline (target-guile-effective-version).

Toggle quote (7 lines)
> > + (scm (lambda (in)
> > + (string-append in "/share/guile/site/"
> > + version)))
> > + (go (lambda (in)
>
> Perhaps go-cache would be more descriptive
> (I see that it was also 'go' before)
Decided on ccache, YMMV.

Toggle quote (17 lines)
> > + (string-append in "/lib/guile/" version
> > + "/site-ccache")))
> > + (pkgs
> > + (cons
> > + (assoc-ref outputs "out")
> > + (filter-map
> > + (lambda (input)
> > + (and (string-prefix? "guile-" (car
> > input)) (cdr input)))
>
> I'm not in love with this, I personally find it a bit hard to parse.
> I'm
> not really sure what the (cdr input) is there for. (without testing
> it
> myself) I'd suggest borrowing the filter-map code from guile-studio
> in
> (gnu packages guile-xyz) where it searches for emacs packages.
I wanted to avoid needing ice-9 match, but you're right, that looks
better.

Toggle quote (26 lines)
> > + inputs))))
> > (substitute* "bin/tsukundere"
> > - (("exec guile .*" all)
> > + (("exec guile (.*)" _ args)
> > (string-append
> > (format #f "export GUILE_LOAD_PATH=~@?~%"
> > - "\"~a:~a\"" scm (getenv
> > "GUILE_LOAD_PATH"))
> > + "\"~{~a~^:~}\"" (map scm pkgs))
> > (format #f "export
> > GUILE_LOAD_COMPILED_PATH=~@?~%"
> > - "\"~a:~a\"" go (getenv
> > "GUILE_LOAD_COMPILED_PATH"))
> > - all)))
> > + "\"~{~a~^:~}\"" (map go pkgs))
> > + "exec "
> > + (assoc-ref inputs "guile-runtime")
> > + "/bin/guile " args)))
> > #t))))))
>
> (Again without really testing it) Perhaps it would be better to
> remove
> this whole phase and to replace it with wrap-script.
>
> Actually, forget all of that. There's a comment in (guix build utils)
> saying that Guile scripts are not supported.
That's why I'm implementing my custom wrapper here. I'm not sure if
this is a general solution for guile scripts, but for those, that use
the "exec guile" trick, the phase I wrote should act similar to wrap-
program without needing to construct a wrapper script.

Regards,
Leo
L
L
Ludovic Courtès wrote on 5 May 2021 16:16
Re: bug#47824: [PATCH 0/3] Happy hacking in the Spring 2021 LGJ
(name . Leo Prikler)(address . leo.prikler@student.tugraz.at)
874kfhjmfd.fsf_-_@gnu.org
Hi Leo,

On a cursory look, all three patches LGTM.

One nit:

Toggle quote (4 lines)
> + "exec "
> + (assoc-ref inputs "guile-runtime")
> + "/bin/guile " args)))

[...]

Toggle quote (9 lines)
> ("guile" ,guile-3.0)
> ("pkg-config" ,pkg-config)
> ("texinfo" ,texinfo)))
> - (propagated-inputs
> - `(("guile-sdl2" ,guile3.0-sdl2)))
> + (inputs
> + `(("guile-sdl2" ,guile3.0-sdl2)
> + ("guile-runtime" ,guile-3.0)))

I think it’s best to not play trick with labels, and to always use the
package name as the label (to facilitate migration on the day where we
get rid of labels, who knows…).

A common pattern for the case above is to provide “guile” both as native
input and input, and to write:

(assoc-ref (or native-inputs inputs) "guile")

Thanks, and congrats to the Lisp Game Jam participants!

Ludo’.
L
L
Leo Prikler wrote on 5 May 2021 17:00
(name . Ludovic Courtès)(address . ludo@gnu.org)
867322166b5492fe1964df02db2b4d148ade29dd.camel@student.tugraz.at
Hi Ludo,

Am Mittwoch, den 05.05.2021, 16:16 +0200 schrieb Ludovic Courtès:
Toggle quote (32 lines)
> Hi Leo,
>
> On a cursory look, all three patches LGTM.
>
> One nit:
>
> > + "exec "
> > + (assoc-ref inputs "guile-runtime")
> > + "/bin/guile " args)))
>
> [...]
>
> > ("guile" ,guile-3.0)
> > ("pkg-config" ,pkg-config)
> > ("texinfo" ,texinfo)))
> > - (propagated-inputs
> > - `(("guile-sdl2" ,guile3.0-sdl2)))
> > + (inputs
> > + `(("guile-sdl2" ,guile3.0-sdl2)
> > + ("guile-runtime" ,guile-3.0)))
>
> I think it’s best to not play trick with labels, and to always use
> the
> package name as the label (to facilitate migration on the day where
> we
> get rid of labels, who knows…).
>
> A common pattern for the case above is to provide “guile” both as
> native
> input and input, and to write:
>
> (assoc-ref (or native-inputs inputs) "guile")
What I'm doing here is the exact opposite. I don't want the
omnipresent native-input guile to shadow the guile I use as input, so I
assign a "unique" label to the input guile to refer to it. As a neat
side effect, this label allows me to construct GUILE_LOAD_PATH more
easily.

We already have a number of issues related to the "native-input as
input" thing, "which" returning the wrong binary, and so on, and I
didn't want to add another one on top. The code I wrote certainly
looks and feels ugly, but I don't see any other way with what Guix
currently provides. Maybe for the next c-u merge we can do proper
separation of inputs and native-inputs, hopefully using that to clean
up some of our recipes.

Regards,
Leo
L
L
Ludovic Courtès wrote on 6 May 2021 12:52
(name . Leo Prikler)(address . leo.prikler@student.tugraz.at)
875yzwgmmg.fsf@gnu.org
Hi,

Leo Prikler <leo.prikler@student.tugraz.at> skribis:

Toggle quote (36 lines)
> Am Mittwoch, den 05.05.2021, 16:16 +0200 schrieb Ludovic Courtès:
>> Hi Leo,
>>
>> On a cursory look, all three patches LGTM.
>>
>> One nit:
>>
>> > + "exec "
>> > + (assoc-ref inputs "guile-runtime")
>> > + "/bin/guile " args)))
>>
>> [...]
>>
>> > ("guile" ,guile-3.0)
>> > ("pkg-config" ,pkg-config)
>> > ("texinfo" ,texinfo)))
>> > - (propagated-inputs
>> > - `(("guile-sdl2" ,guile3.0-sdl2)))
>> > + (inputs
>> > + `(("guile-sdl2" ,guile3.0-sdl2)
>> > + ("guile-runtime" ,guile-3.0)))
>>
>> I think it’s best to not play trick with labels, and to always use
>> the
>> package name as the label (to facilitate migration on the day where
>> we
>> get rid of labels, who knows…).
>>
>> A common pattern for the case above is to provide “guile” both as
>> native
>> input and input, and to write:
>>
>> (assoc-ref (or native-inputs inputs) "guile")
> What I'm doing here is the exact opposite. I don't want the
> omnipresent native-input guile to shadow the guile I use as input,

In that case, you can unconditionally do:

(assoc-ref inputs "guile")

Unless I’m mistaken, it won’t be shadowed by the native input “guile”
when cross-compiling.

Or am I missing something?

Ludo’.
L
L
Leo Prikler wrote on 6 May 2021 13:03
(name . Ludovic Courtès)(address . ludo@gnu.org)
82ad8a0c2757ff74694e8c83eb528cf84c59855e.camel@student.tugraz.at
Am Donnerstag, den 06.05.2021, 12:52 +0200 schrieb Ludovic Courtès:
Toggle quote (50 lines)
> Hi,
>
> Leo Prikler <leo.prikler@student.tugraz.at> skribis:
>
> > Am Mittwoch, den 05.05.2021, 16:16 +0200 schrieb Ludovic Courtès:
> > > Hi Leo,
> > >
> > > On a cursory look, all three patches LGTM.
> > >
> > > One nit:
> > >
> > > > + "exec "
> > > > + (assoc-ref inputs "guile-runtime")
> > > > + "/bin/guile " args)))
> > >
> > > [...]
> > >
> > > > ("guile" ,guile-3.0)
> > > > ("pkg-config" ,pkg-config)
> > > > ("texinfo" ,texinfo)))
> > > > - (propagated-inputs
> > > > - `(("guile-sdl2" ,guile3.0-sdl2)))
> > > > + (inputs
> > > > + `(("guile-sdl2" ,guile3.0-sdl2)
> > > > + ("guile-runtime" ,guile-3.0)))
> > >
> > > I think it’s best to not play trick with labels, and to always
> > > use
> > > the
> > > package name as the label (to facilitate migration on the day
> > > where
> > > we
> > > get rid of labels, who knows…).
> > >
> > > A common pattern for the case above is to provide “guile” both as
> > > native
> > > input and input, and to write:
> > >
> > > (assoc-ref (or native-inputs inputs) "guile")
> > What I'm doing here is the exact opposite. I don't want the
> > omnipresent native-input guile to shadow the guile I use as input,
>
> In that case, you can unconditionally do:
>
> (assoc-ref inputs "guile")
>
> Unless I’m mistaken, it won’t be shadowed by the native input “guile”
> when cross-compiling.
>
> Or am I missing something?
Perhaps it's an implementation detail, that when performing native
builds, inputs are merged as (append inputs native-inputs), but they
could as well be (append native-inputs inputs). I'd have to check, and
I'm not sure whether I want to rely on that detail.

Regards,
Leo
L
L
Leo Prikler wrote on 15 May 2021 10:35
(name . Ludovic Courtès)(address . ludo@gnu.org)
62d2f1043b816c5c7619cb0eef15ff3a73bc4e2b.camel@student.tugraz.at
Ping.
For the record, I've pushed guile-sdl and chickadee already, any hints
w.r.t. the problem in Tsukundere?

Am Donnerstag, den 06.05.2021, 13:03 +0200 schrieb Leo Prikler:
Toggle quote (62 lines)
> Am Donnerstag, den 06.05.2021, 12:52 +0200 schrieb Ludovic Courtès:
> > Hi,
> >
> > Leo Prikler <leo.prikler@student.tugraz.at> skribis:
> >
> > > Am Mittwoch, den 05.05.2021, 16:16 +0200 schrieb Ludovic Courtès:
> > > > Hi Leo,
> > > >
> > > > On a cursory look, all three patches LGTM.
> > > >
> > > > One nit:
> > > >
> > > > > + "exec "
> > > > > + (assoc-ref inputs "guile-runtime")
> > > > > + "/bin/guile " args)))
> > > >
> > > > [...]
> > > >
> > > > > ("guile" ,guile-3.0)
> > > > > ("pkg-config" ,pkg-config)
> > > > > ("texinfo" ,texinfo)))
> > > > > - (propagated-inputs
> > > > > - `(("guile-sdl2" ,guile3.0-sdl2)))
> > > > > + (inputs
> > > > > + `(("guile-sdl2" ,guile3.0-sdl2)
> > > > > + ("guile-runtime" ,guile-3.0)))
> > > >
> > > > I think it’s best to not play trick with labels, and to always
> > > > use
> > > > the
> > > > package name as the label (to facilitate migration on the day
> > > > where
> > > > we
> > > > get rid of labels, who knows…).
> > > >
> > > > A common pattern for the case above is to provide “guile” both
> > > > as
> > > > native
> > > > input and input, and to write:
> > > >
> > > > (assoc-ref (or native-inputs inputs) "guile")
> > > What I'm doing here is the exact opposite. I don't want the
> > > omnipresent native-input guile to shadow the guile I use as
> > > input,
> >
> > In that case, you can unconditionally do:
> >
> > (assoc-ref inputs "guile")
> >
> > Unless I’m mistaken, it won’t be shadowed by the native input
> > “guile”
> > when cross-compiling.
> >
> > Or am I missing something?
> Perhaps it's an implementation detail, that when performing native
> builds, inputs are merged as (append inputs native-inputs), but they
> could as well be (append native-inputs inputs). I'd have to check,
> and
> I'm not sure whether I want to rely on that detail.
>
> Regards,
> Leo
L
L
Ludovic Courtès wrote on 15 May 2021 15:45
(name . Leo Prikler)(address . leo.prikler@student.tugraz.at)
87k0o0jekg.fsf@gnu.org
Hi Leo,

Leo Prikler <leo.prikler@student.tugraz.at> skribis:

Toggle quote (3 lines)
> For the record, I've pushed guile-sdl and chickadee already, any hints
> w.r.t. the problem in Tsukundere?

[...]

Toggle quote (33 lines)
>> > > > I think it’s best to not play trick with labels, and to always
>> > > > use
>> > > > the
>> > > > package name as the label (to facilitate migration on the day
>> > > > where
>> > > > we
>> > > > get rid of labels, who knows…).
>> > > >
>> > > > A common pattern for the case above is to provide “guile” both
>> > > > as
>> > > > native
>> > > > input and input, and to write:
>> > > >
>> > > > (assoc-ref (or native-inputs inputs) "guile")
>> > > What I'm doing here is the exact opposite. I don't want the
>> > > omnipresent native-input guile to shadow the guile I use as
>> > > input,
>> >
>> > In that case, you can unconditionally do:
>> >
>> > (assoc-ref inputs "guile")
>> >
>> > Unless I’m mistaken, it won’t be shadowed by the native input
>> > “guile”
>> > when cross-compiling.
>> >
>> > Or am I missing something?
>> Perhaps it's an implementation detail, that when performing native
>> builds, inputs are merged as (append inputs native-inputs), but they
>> could as well be (append native-inputs inputs). I'd have to check,
>> and
>> I'm not sure whether I want to rely on that detail.

I didn’t see a question mark, which is why I didn’t answer. :-)

I fail to see why (assoc-ref inputs …) wouldn’t work.

Thanks,
Ludo’.
L
L
Leo Prikler wrote on 15 May 2021 16:02
(name . Ludovic Courtès)(address . ludo@gnu.org)
1bd6a090e32090c50325b56172f29fa68e4e387e.camel@student.tugraz.at
Hi Ludo’,

Am Samstag, den 15.05.2021, 15:45 +0200 schrieb Ludovic Courtès:
Toggle quote (30 lines)
> Hi Leo,
>
> Leo Prikler <leo.prikler@student.tugraz.at> skribis:
>
> > For the record, I've pushed guile-sdl and chickadee already, any
> > hints
> > w.r.t. the problem in Tsukundere?
>
> [...]
>
> > > > In that case, you can unconditionally do:
> > > >
> > > > (assoc-ref inputs "guile")
> > > >
> > > > Unless I’m mistaken, it won’t be shadowed by the native input
> > > > “guile” when cross-compiling.
> > > >
> > > > Or am I missing something?
> > > Perhaps it's an implementation detail, that when performing
> > > native
> > > builds, inputs are merged as (append inputs native-inputs), but
> > > they
> > > could as well be (append native-inputs inputs). I'd have to
> > > check,
> > > and
> > > I'm not sure whether I want to rely on that detail.
>
> I didn’t see a question mark, which is why I didn’t answer. :-)
>
> I fail to see why (assoc-ref inputs …) wouldn’t work.
Ahh, my bad, it appears I was just confused. If both native-inputs and
inputs refer to "the same" guile and are on the same architecture, they
should have the same hash, so it doesn't matter, which one is picked.
I'll try to rewrite the package with that in mind.

Thanks,
Leo
L
L
Leo Prikler wrote on 15 May 2021 20:32
[PATCH] gnu: tsukundere: Update to 0.3.0.
(address . 47824@debbugs.gnu.org)(address . ludo@gnu.org)
20210515183223.29644-1-leo.prikler@student.tugraz.at
* gnu/packages/game-development.scm (tsukundere): Update to 0.3.0.
[patch-command]: Patch path to guile. Construct load paths directly from
inputs.
[propagated-inputs]: Remove.
[inputs]: Add guile and guile-sdl2.
---
gnu/packages/game-development.scm | 52 ++++++++++++++++++++-----------
1 file changed, 33 insertions(+), 19 deletions(-)

Toggle diff (90 lines)
diff --git a/gnu/packages/game-development.scm b/gnu/packages/game-development.scm
index cee7e5dc0a..52541196b3 100644
--- a/gnu/packages/game-development.scm
+++ b/gnu/packages/game-development.scm
@@ -493,7 +493,7 @@ clone.")
(define-public tsukundere
(package
(name "tsukundere")
- (version "0.2.3")
+ (version "0.3.0")
(source (origin
(method git-fetch)
(uri (git-reference
@@ -502,10 +502,12 @@ clone.")
(file-name (git-file-name name version))
(sha256
(base32
- "05ckds2df810441wfavllx9lsw5jsc9h3nb7m31df01nsj56azdw"))))
+ "06jiaylbnx8khicsaq2gwnd8wspjhjymbb5z6x5445krklk0jx18"))))
(build-system gnu-build-system)
(arguments
- `(#:modules (((guix build guile-build-system)
+ `(#:modules ((ice-9 match)
+ (srfi srfi-1)
+ ((guix build guile-build-system)
#:select (target-guile-effective-version))
,@%gnu-build-system-modules)
#:imported-modules ((guix build guile-build-system)
@@ -513,22 +515,33 @@ clone.")
#:phases
(modify-phases %standard-phases
(add-after 'unpack 'patch-command
- (lambda* (#:key outputs #:allow-other-keys)
- (let* ((out (assoc-ref outputs "out"))
- (version (target-guile-effective-version))
- (scm (string-append out "/share/guile/site/"
- version))
- (go (string-append out "/lib/guile/"
- version "/site-ccache")))
-
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (let* ((scm (lambda (in)
+ (string-append in "/share/guile/site/"
+ (target-guile-effective-version))))
+ (ccache (lambda (in)
+ (string-append in "/lib/guile/"
+ (target-guile-effective-version)
+ "/site-ccache")))
+ (pkgs
+ (cons
+ (assoc-ref outputs "out")
+ (filter-map
+ (match-lambda
+ (("guile" . pkg) pkg)
+ ((label . pkg)
+ (and (string-prefix? "guile-" label) pkg)))
+ inputs))))
(substitute* "bin/tsukundere"
- (("exec guile .*" all)
+ (("exec guile (.*)" _ args)
(string-append
- (format #f "export GUILE_LOAD_PATH=~@?~%"
- "\"~a:~a\"" scm (getenv "GUILE_LOAD_PATH"))
- (format #f "export GUILE_LOAD_COMPILED_PATH=~@?~%"
- "\"~a:~a\"" go (getenv "GUILE_LOAD_COMPILED_PATH"))
- all)))
+ (format #f "export GUILE_LOAD_PATH=\"~@?\"~%"
+ "~{~a~^:~}" (map scm pkgs))
+ (format #f "export GUILE_LOAD_COMPILED_PATH=\"~@?\"~%"
+ "~{~a~^:~}" (map ccache pkgs))
+ "exec "
+ (assoc-ref inputs "guile")
+ "/bin/guile " args)))
#t))))))
(native-inputs
`(("autoconf" ,autoconf)
@@ -536,8 +549,9 @@ clone.")
("guile" ,guile-3.0)
("pkg-config" ,pkg-config)
("texinfo" ,texinfo)))
- (propagated-inputs
- `(("guile-sdl2" ,guile3.0-sdl2)))
+ (inputs
+ `(("guile-sdl2" ,guile3.0-sdl2)
+ ("guile" ,guile-3.0)))
(home-page "https://gitlab.com/leoprikler/tsukundere")
(synopsis "Visual novel engine")
(description "Tsukundere is a game engine geared heavily towards the
--
2.31.1
L
L
Ludovic Courtès wrote on 16 May 2021 22:21
(name . Leo Prikler)(address . leo.prikler@student.tugraz.at)(address . 47824@debbugs.gnu.org)
87mtsuh1jy.fsf@gnu.org
Hi Leo,

Leo Prikler <leo.prikler@student.tugraz.at> skribis:

Toggle quote (6 lines)
> * gnu/packages/game-development.scm (tsukundere): Update to 0.3.0.
> [patch-command]: Patch path to guile. Construct load paths directly from
> inputs.
> [propagated-inputs]: Remove.
> [inputs]: Add guile and guile-sdl2.

LGTM, thanks!

Ludo’.
L
L
Leo Prikler wrote on 17 May 2021 00:27
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . 47824-done@debbugs.gnu.org)
bf6af4aa6ed334b6bf548799958fd187365d9c53.camel@student.tugraz.at
Am Sonntag, den 16.05.2021, 22:21 +0200 schrieb Ludovic Courtès:
Toggle quote (14 lines)
> Hi Leo,
>
> Leo Prikler <leo.prikler@student.tugraz.at> skribis:
>
> > * gnu/packages/game-development.scm (tsukundere): Update to 0.3.0.
> > [patch-command]: Patch path to guile. Construct load paths
> > directly from
> > inputs.
> > [propagated-inputs]: Remove.
> > [inputs]: Add guile and guile-sdl2.
>
> LGTM, thanks!
>
> Ludo’.
I went ahead and pushed this now. Thank you.
Closed
?