GNU bug report logs - #57861
[PATCH] gnu: Add ultrastar-deluxe.

Previous Next

Package: guix-patches;

Reported by: Lars-Dominik Braun <lars <at> 6xq.net>

Date: Fri, 16 Sep 2022 13:39:02 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 57861 in the body.
You can then email your comments to 57861 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#57861; Package guix-patches. (Fri, 16 Sep 2022 13:39:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Lars-Dominik Braun <lars <at> 6xq.net>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Fri, 16 Sep 2022 13:39:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Lars-Dominik Braun <lars <at> 6xq.net>
To: guix-patches <at> gnu.org
Subject: [PATCH] gnu: Add ultrastar-deluxe.
Date: Fri, 16 Sep 2022 15:37:25 +0200
Hi,

this patch adds UltraStar Deluxe (USDX), a karaoke game. The top-level
directory includes a copy of the GPL and the game sources also bear GPL
headers, but there is no explicit license for assets, so it’s hard to
tell whether they are actually free or not. Any opinions?
If not, we could move this to the Guix games channel.

Cheers,
Lars

---
 gnu/local.mk                                  |  1 +
 gnu/packages/games.scm                        | 91 +++++++++++++++++++
 .../ultrastar-deluxe-no-freesans.patch        | 31 +++++++
 3 files changed, 123 insertions(+)
 create mode 100644 gnu/packages/patches/ultrastar-deluxe-no-freesans.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index cd41e6794d..9d9f6b3406 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1900,6 +1900,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/u-boot-sifive-prevent-reloc-initrd-fdt.patch	\
   %D%/packages/patches/u-boot-rk3399-enable-emmc-phy.patch	\
   %D%/packages/patches/ucx-tcp-iface-ioctl.patch		\
+  %D%/packages/patches/ultrastar-deluxe-no-freesans.patch		\
   %D%/packages/patches/ungoogled-chromium-extension-search-path.patch	\
   %D%/packages/patches/ungoogled-chromium-ffmpeg-compat.patch	\
   %D%/packages/patches/ungoogled-chromium-RUNPATH.patch		\
diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
index 60ce0167a6..4712d9c4ca 100644
--- a/gnu/packages/games.scm
+++ b/gnu/packages/games.scm
@@ -11169,6 +11169,97 @@ (define-public freerct
 and unsafe rides.  Which path will you take?")
     (license license:gpl2)))
 
+;; Lazily resolve to avoid a circular dependency.
+(define fpc*
+  (delay (module-ref (resolve-interface '(gnu packages pascal))
+                     'fpc)))
+
+(define-public ultrastar-deluxe
+  ;; The last release is quite old and does not support recent versions of ffmpeg.
+  (let ((commit "43484b0a10ce6aae339e19d81ae2f7b37caf6baa")
+        (revision "1"))
+    (package
+      (name "ultrastar-deluxe")
+      (version (git-version "2020.4.0" revision commit))
+      (source (origin
+                (method git-fetch)
+                (uri (git-reference
+                      (url "https://github.com/UltraStar-Deluxe/USDX.git")
+                      (commit commit)))
+                (file-name (git-file-name name version))
+                (sha256
+                 (base32
+                  "078g1rbm1ympmwq9s64v68sxvcms7rr0qid12d2wgm4r04ana47r"))
+                (patches (search-patches "ultrastar-deluxe-no-freesans.patch"))
+                (modules '((guix build utils)))
+                (snippet
+                 `(begin
+                    ;; Remove Windows binaries.
+                    (for-each delete-file (find-files "game" "\\.dll$"))
+                    ;; Remove font blobs.
+                    (let ((font-directories (list "DejaVu" "FreeSans" "NotoSans"
+                                                  "wqy-microhei")))
+                      (for-each
+                        (lambda (d) (delete-file-recursively
+                                      (string-append "game/fonts/" d)))
+                        font-directories))))))
+      (build-system gnu-build-system)
+      (arguments
+        (list
+         #:tests? #f ; No tests.
+         #:phases
+         #~(modify-phases %standard-phases
+           (add-after 'unpack 'fix-configure
+             (lambda* (#:key inputs configure-flags outputs #:allow-other-keys)
+               ;; The configure script looks for lua$version, but we provide lua-$version.
+               (substitute* "configure.ac"
+                 (("lua\\$i") "lua-$i"))
+               ;; fpc does not pass -lfoo to the linker, but uses its own linker script,
+               ;; which references libs. Pass the libraries listed in that linker script,
+               ;; so our custom linker adds a correct rpath.
+               (substitute* "src/Makefile.in"
+                 (("linkflags\\s+:= ")
+                  (string-append "linkflags := -lpthread -lsqlite3 -lSDL2 "
+                                 " -lSDL2_image -ldl "
+                                 "-lz -lfreetype -lportaudio -lavcodec "
+                                 "-lavformat -lavutil -lswresample "
+                                 "-lswscale -llua -ldl -lX11 -lportmidi "
+                                 "-L" #$zlib "/lib "
+                                 "-L" #$libx11 "/lib "
+                                 "-L" #$portmidi "/lib ")))))
+           (add-after 'install 'font-paths
+             (lambda* (#:key outputs #:allow-other-keys)
+               (substitute* (string-append
+                              (assoc-ref outputs "out")
+                              "/share/ultrastardx/fonts/fonts.ini")
+                 (("=NotoSans/") (string-append "=" #$font-google-noto
+                                                "/share/fonts/truetype/"))
+                 (("=DejaVu/") (string-append "=" #$font-dejavu
+                                              "/share/fonts/truetype/"))))))))
+      (inputs (list ffmpeg
+                    font-dejavu
+                    font-google-noto
+                    ; Not needed, since we don’t have freesans.
+                    ;font-wqy-microhei
+                    freetype
+                    libx11
+                    lua
+                    portaudio
+                    portmidi
+                    sdl2
+                    sdl2-image
+                    sqlite
+                    zlib))
+      (native-inputs (list pkg-config (force fpc*) autoconf automake))
+      (synopsis "Karaoke game")
+      (description
+       "UltraStar Deluxe (USDX) is a free and open source karaoke game.  It
+allows up to six players to sing along with music using microphones
+in order to score points, depending on the pitch of the voice and the
+rhythm of singing.")
+      (home-page "https://usdx.eu/")
+      (license license:gpl2+))))
+
 (define-public steam-devices-udev-rules
   ;; Last release from 2019-04-10
   (let ((commit "d87ef558408c5e7a1a793d738db4c9dc2cb5f8fa")
diff --git a/gnu/packages/patches/ultrastar-deluxe-no-freesans.patch b/gnu/packages/patches/ultrastar-deluxe-no-freesans.patch
new file mode 100644
index 0000000000..7beba80774
--- /dev/null
+++ b/gnu/packages/patches/ultrastar-deluxe-no-freesans.patch
@@ -0,0 +1,31 @@
+Remove references to FreeSans font, which is not packaged for Guix.
+
+--- a/game/fonts/fonts.ini	1970-01-01 01:00:01.000000000 +0100
++++ b/game/fonts/fonts.ini	2022-09-16 14:31:51.483096847 +0200
+@@ -116,26 +116,6 @@
+ BoldHighResPreCache=0
+ BoldHighResOutline=0.02
+ 
+-[Font_FreeSans]
+-Name=Free Sans
+-RegularFile=FreeSans/FreeSans.ttf
+-RegularFallbackFile1=wqy-microhei/wqy-microhei.ttc
+-;RegularGlyphSpacing=1.4
+-;RegularStretch=1.2
+-BoldFile=FreeSans/FreeSansBold.ttf
+-BoldFallbackFile1=wqy-microhei/wqy-microhei.ttc
+-;BoldEmbolden=0.06
+-OutlineFile=FreeSans/FreeSansBold.ttf
+-OutlineOutline=0.06
+-;OutlineColorR=0.3
+-;OutlineColorG=0.3
+-;OutlineColorB=0.3
+-;OutlineColorA=0.3
+-BoldHighResFile=FreeSans/FreeSansBold.ttf
+-BoldHighResMaxResolution=256
+-BoldHighResPreCache=0
+-BoldHighResOutline=0.02
+-
+ [Font_DejaVuSans]
+ Name=DejaVu Sans
+ RegularFile=DejaVu/DejaVuSans.ttf
-- 
2.35.1





Information forwarded to guix-patches <at> gnu.org:
bug#57861; Package guix-patches. (Sun, 18 Sep 2022 09:41:02 GMT) Full text and rfc822 format available.

Message #8 received at 57861 <at> debbugs.gnu.org (full text, mbox):

From: Maxime Devos <maximedevos <at> telenet.be>
To: Lars-Dominik Braun <lars <at> 6xq.net>, 57861 <at> debbugs.gnu.org
Subject: Re: [bug#57861] [PATCH] gnu: Add ultrastar-deluxe.
Date: Sun, 18 Sep 2022 11:39:55 +0200
[Message part 1 (text/plain, inline)]

On 16-09-2022 15:37, Lars-Dominik Braun wrote:
> +                                 " -lSDL2_image -ldl "
> +                                 "-lz -lfreetype -lportaudio -lavcodec "
> +                                 "-lavformat -lavutil -lswresample "
> +                                 "-lswscale -llua -ldl -lX11 -lportmidi "
> +                                 "-L" #$zlib "/lib "
> +                                 "-L" #$libx11 "/lib "
> +                                 "-L" #$portmidi "/lib ")))))

To make --with-input transformations work, these #$foo need to be 
replaced by #$(this-package-input "zlib").  To avoid input labels,
you can replace #$zlib "/lib" by
(dirname (search-input-file inputs "lib/libz.so")).

Greetings,
Maxime.
[OpenPGP_0x49E3EE22191725EE.asc (application/pgp-keys, attachment)]
[OpenPGP_signature (application/pgp-signature, attachment)]

Information forwarded to guix-patches <at> gnu.org:
bug#57861; Package guix-patches. (Sun, 18 Sep 2022 12:27:02 GMT) Full text and rfc822 format available.

Message #11 received at 57861 <at> debbugs.gnu.org (full text, mbox):

From: Maxime Devos <maximedevos <at> telenet.be>
To: Lars-Dominik Braun <lars <at> 6xq.net>, 57861 <at> debbugs.gnu.org
Subject: Re: [bug#57861] [PATCH] gnu: Add ultrastar-deluxe.
Date: Sun, 18 Sep 2022 14:26:29 +0200
[Message part 1 (text/plain, inline)]

On 16-09-2022 15:37, Lars-Dominik Braun wrote:
> +                                 " -lSDL2_image -ldl "
> +                                 "-lz -lfreetype -lportaudio -lavcodec "
> +                                 "-lavformat -lavutil -lswresample "
> +                                 "-lswscale -llua -ldl -lX11 -lportmidi "
> +                                 "-L" #$zlib "/lib "
> +                                 "-L" #$libx11 "/lib "
> +                                 "-L" #$portmidi "/lib ")))))

To make --with-input transformations work, these #$foo need to be 
replaced by #$(this-package-input "zlib").  To avoid input labels,
you can replace #$zlib "/lib" by
(dirname (search-input-file inputs "lib/libz.so")).

Greetings,
Maxime.
[OpenPGP_0x49E3EE22191725EE.asc (application/pgp-keys, attachment)]
[OpenPGP_signature (application/pgp-signature, attachment)]

Information forwarded to guix-patches <at> gnu.org:
bug#57861; Package guix-patches. (Wed, 21 Sep 2022 11:53:01 GMT) Full text and rfc822 format available.

Message #14 received at 57861 <at> debbugs.gnu.org (full text, mbox):

From: Lars-Dominik Braun <lars <at> 6xq.net>
To: Maxime Devos <maximedevos <at> telenet.be>
Cc: 57861 <at> debbugs.gnu.org
Subject: [bug#57861] [PATCH v2] gnu: Add ultrastar-deluxe.
Date: Wed, 21 Sep 2022 13:52:12 +0200
Hi Maxime,

oh, I didn’t know gexp’s wouldn’t play nicely with input transformations. Fixed in v2.

Cheers,
Lars

---
 gnu/local.mk                                  |  1 +
 gnu/packages/games.scm                        | 91 +++++++++++++++++++
 .../ultrastar-deluxe-no-freesans.patch        | 31 +++++++
 3 files changed, 123 insertions(+)
 create mode 100644 gnu/packages/patches/ultrastar-deluxe-no-freesans.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index cd41e6794d..9d9f6b3406 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1900,6 +1900,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/u-boot-sifive-prevent-reloc-initrd-fdt.patch	\
   %D%/packages/patches/u-boot-rk3399-enable-emmc-phy.patch	\
   %D%/packages/patches/ucx-tcp-iface-ioctl.patch		\
+  %D%/packages/patches/ultrastar-deluxe-no-freesans.patch		\
   %D%/packages/patches/ungoogled-chromium-extension-search-path.patch	\
   %D%/packages/patches/ungoogled-chromium-ffmpeg-compat.patch	\
   %D%/packages/patches/ungoogled-chromium-RUNPATH.patch		\
diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
index 60ce0167a6..30ac153c9a 100644
--- a/gnu/packages/games.scm
+++ b/gnu/packages/games.scm
@@ -11169,6 +11169,97 @@ (define-public freerct
 and unsafe rides.  Which path will you take?")
     (license license:gpl2)))
 
+;; Lazily resolve to avoid a circular dependency.
+(define fpc*
+  (delay (module-ref (resolve-interface '(gnu packages pascal))
+                     'fpc)))
+
+(define-public ultrastar-deluxe
+  ;; The last release is quite old and does not support recent versions of ffmpeg.
+  (let ((commit "43484b0a10ce6aae339e19d81ae2f7b37caf6baa")
+        (revision "1"))
+    (package
+      (name "ultrastar-deluxe")
+      (version (git-version "2020.4.0" revision commit))
+      (source (origin
+                (method git-fetch)
+                (uri (git-reference
+                      (url "https://github.com/UltraStar-Deluxe/USDX.git")
+                      (commit commit)))
+                (file-name (git-file-name name version))
+                (sha256
+                 (base32
+                  "078g1rbm1ympmwq9s64v68sxvcms7rr0qid12d2wgm4r04ana47r"))
+                (patches (search-patches "ultrastar-deluxe-no-freesans.patch"))
+                (modules '((guix build utils)))
+                (snippet
+                 `(begin
+                    ;; Remove Windows binaries.
+                    (for-each delete-file (find-files "game" "\\.dll$"))
+                    ;; Remove font blobs.
+                    (let ((font-directories (list "DejaVu" "FreeSans" "NotoSans"
+                                                  "wqy-microhei")))
+                      (for-each
+                        (lambda (d) (delete-file-recursively
+                                      (string-append "game/fonts/" d)))
+                        font-directories))))))
+      (build-system gnu-build-system)
+      (arguments
+        (list
+         #:tests? #f ; No tests.
+         #:phases
+         #~(modify-phases %standard-phases
+           (add-after 'unpack 'fix-configure
+             (lambda* (#:key inputs configure-flags outputs #:allow-other-keys)
+               ;; The configure script looks for lua$version, but we provide lua-$version.
+               (substitute* "configure.ac"
+                 (("lua\\$i") "lua-$i"))
+               ;; fpc does not pass -lfoo to the linker, but uses its own linker script,
+               ;; which references libs. Pass the libraries listed in that linker script,
+               ;; so our custom linker adds a correct rpath.
+               (substitute* "src/Makefile.in"
+                 (("linkflags\\s+:= ")
+                  (string-append "linkflags := -lpthread -lsqlite3 -lSDL2"
+                                 " -lSDL2_image -ldl "
+                                 " -lz -lfreetype -lportaudio -lavcodec"
+                                 " -lavformat -lavutil -lswresample"
+                                 " -lswscale -llua -ldl -lX11 -lportmidi"
+                                 " -L" (dirname (search-input-file inputs "lib/libz.so"))
+                                 " -L" (dirname (search-input-file inputs "lib/libX11.so"))
+                                 " -L" (dirname (search-input-file inputs "lib/libportmidi.so")))))))
+           (add-after 'install 'font-paths
+             (lambda* (#:key outputs #:allow-other-keys)
+               (substitute* (string-append
+                              (assoc-ref outputs "out")
+                              "/share/ultrastardx/fonts/fonts.ini")
+                 (("=NotoSans/") (string-append "=" #$font-google-noto
+                                                "/share/fonts/truetype/"))
+                 (("=DejaVu/") (string-append "=" #$font-dejavu
+                                              "/share/fonts/truetype/"))))))))
+      (inputs (list ffmpeg
+                    font-dejavu
+                    font-google-noto
+                    ; Not needed, since we don’t have freesans.
+                    ;font-wqy-microhei
+                    freetype
+                    libx11
+                    lua
+                    portaudio
+                    portmidi
+                    sdl2
+                    sdl2-image
+                    sqlite
+                    zlib))
+      (native-inputs (list pkg-config (force fpc*) autoconf automake))
+      (synopsis "Karaoke game")
+      (description
+       "UltraStar Deluxe (USDX) is a free and open source karaoke game.  It
+allows up to six players to sing along with music using microphones
+in order to score points, depending on the pitch of the voice and the
+rhythm of singing.")
+      (home-page "https://usdx.eu/")
+      (license license:gpl2+))))
+
 (define-public steam-devices-udev-rules
   ;; Last release from 2019-04-10
   (let ((commit "d87ef558408c5e7a1a793d738db4c9dc2cb5f8fa")
diff --git a/gnu/packages/patches/ultrastar-deluxe-no-freesans.patch b/gnu/packages/patches/ultrastar-deluxe-no-freesans.patch
new file mode 100644
index 0000000000..7beba80774
--- /dev/null
+++ b/gnu/packages/patches/ultrastar-deluxe-no-freesans.patch
@@ -0,0 +1,31 @@
+Remove references to FreeSans font, which is not packaged for Guix.
+
+--- a/game/fonts/fonts.ini	1970-01-01 01:00:01.000000000 +0100
++++ b/game/fonts/fonts.ini	2022-09-16 14:31:51.483096847 +0200
+@@ -116,26 +116,6 @@
+ BoldHighResPreCache=0
+ BoldHighResOutline=0.02
+ 
+-[Font_FreeSans]
+-Name=Free Sans
+-RegularFile=FreeSans/FreeSans.ttf
+-RegularFallbackFile1=wqy-microhei/wqy-microhei.ttc
+-;RegularGlyphSpacing=1.4
+-;RegularStretch=1.2
+-BoldFile=FreeSans/FreeSansBold.ttf
+-BoldFallbackFile1=wqy-microhei/wqy-microhei.ttc
+-;BoldEmbolden=0.06
+-OutlineFile=FreeSans/FreeSansBold.ttf
+-OutlineOutline=0.06
+-;OutlineColorR=0.3
+-;OutlineColorG=0.3
+-;OutlineColorB=0.3
+-;OutlineColorA=0.3
+-BoldHighResFile=FreeSans/FreeSansBold.ttf
+-BoldHighResMaxResolution=256
+-BoldHighResPreCache=0
+-BoldHighResOutline=0.02
+-
+ [Font_DejaVuSans]
+ Name=DejaVu Sans
+ RegularFile=DejaVu/DejaVuSans.ttf
-- 
2.35.1





Information forwarded to guix-patches <at> gnu.org:
bug#57861; Package guix-patches. (Mon, 17 Oct 2022 08:34:01 GMT) Full text and rfc822 format available.

Message #17 received at 57861 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Lars-Dominik Braun <lars <at> 6xq.net>
Cc: 57861 <at> debbugs.gnu.org, Maxime Devos <maximedevos <at> telenet.be>
Subject: Re: bug#57861: [PATCH] gnu: Add ultrastar-deluxe.
Date: Mon, 17 Oct 2022 10:33:19 +0200
Hello!

Lars-Dominik Braun <lars <at> 6xq.net> skribis:

> +;; Lazily resolve to avoid a circular dependency.
> +(define fpc*
> +  (delay (module-ref (resolve-interface '(gnu packages pascal))
> +                     'fpc)))

I think this is unnecessary: you can just #:use-module (gnu packages
pascal) and have ‘fpc’ in ‘native-inputs’.  Everything will be fine
because ‘inputs’ is a thunked field (IOW, its evaluation is delayed).

Apart from that LGTM!

Thanks,
Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#57861; Package guix-patches. (Mon, 17 Oct 2022 08:36:01 GMT) Full text and rfc822 format available.

Message #20 received at 57861 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Lars-Dominik Braun <lars <at> 6xq.net>
Cc: 57861 <at> debbugs.gnu.org, Maxime Devos <maximedevos <at> telenet.be>
Subject: Re: bug#57861: [PATCH] gnu: Add ultrastar-deluxe.
Date: Mon, 17 Oct 2022 10:35:00 +0200
Hello!

Lars-Dominik Braun <lars <at> 6xq.net> skribis:

> +;; Lazily resolve to avoid a circular dependency.
> +(define fpc*
> +  (delay (module-ref (resolve-interface '(gnu packages pascal))
> +                     'fpc)))

I think this is unnecessary: you can just #:use-module (gnu packages
pascal) and have ‘fpc’ in ‘native-inputs’.  Everything will be fine
because ‘inputs’ is a thunked field (IOW, its evaluation is delayed).

Apart from that LGTM!

Thanks,
Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#57861; Package guix-patches. (Mon, 17 Oct 2022 13:26:02 GMT) Full text and rfc822 format available.

Message #23 received at 57861 <at> debbugs.gnu.org (full text, mbox):

From: Maxime Devos <maximedevos <at> telenet.be>
To: Ludovic Courtès <ludo <at> gnu.org>,
 Lars-Dominik Braun <lars <at> 6xq.net>
Cc: 57861 <at> debbugs.gnu.org
Subject: Re: bug#57861: [PATCH] gnu: Add ultrastar-deluxe.
Date: Mon, 17 Oct 2022 15:25:52 +0200
[Message part 1 (text/plain, inline)]

On 17-10-2022 10:33, Ludovic Courtès wrote:
> Hello!
> 
> Lars-Dominik Braun <lars <at> 6xq.net> skribis:
> 
>> +;; Lazily resolve to avoid a circular dependency.
>> +(define fpc*
>> +  (delay (module-ref (resolve-interface '(gnu packages pascal))
>> +                     'fpc)))
> 
> I think this is unnecessary: you can just #:use-module (gnu packages
> pascal) and have ‘fpc’ in ‘native-inputs’.  Everything will be fine
> because ‘inputs’ is a thunked field (IOW, its evaluation is delayed).

That's still a circular dependency.  Why import (gnu packages pascal) 
when you don't need it (e.g. when installing another, non-pascal, 
package)?  There is some bug report on the excessive dependencies among 
Guix modules with some proposed solutions.

Greetings,
Maxime.
[OpenPGP_0x49E3EE22191725EE.asc (application/pgp-keys, attachment)]
[OpenPGP_signature (application/pgp-signature, attachment)]

Information forwarded to guix-patches <at> gnu.org:
bug#57861; Package guix-patches. (Mon, 17 Oct 2022 13:29:01 GMT) Full text and rfc822 format available.

Message #26 received at 57861 <at> debbugs.gnu.org (full text, mbox):

From: "(" <paren <at> disroot.org>
To: "Maxime Devos" <maximedevos <at> telenet.be>,
 Ludovic Courtès <ludo <at> gnu.org>, "Lars-Dominik Braun"
 <lars <at> 6xq.net>
Cc: 57861 <at> debbugs.gnu.org
Subject: Re: [bug#57861] [PATCH] gnu: Add ultrastar-deluxe.
Date: Mon, 17 Oct 2022 14:28:52 +0100
On Mon Oct 17, 2022 at 2:25 PM BST, Maxime Devos wrote:
> That's still a circular dependency.  Why import (gnu packages pascal) 
> when you don't need it (e.g. when installing another, non-pascal, 
> package)?  There is some bug report on the excessive dependencies among 
> Guix modules with some proposed solutions.

Wouldn't using #:autoload be a cleaner way that still lazily resolves the variables?

    -- (




Information forwarded to guix-patches <at> gnu.org:
bug#57861; Package guix-patches. (Mon, 17 Oct 2022 13:38:02 GMT) Full text and rfc822 format available.

Message #29 received at 57861 <at> debbugs.gnu.org (full text, mbox):

From: Maxime Devos <maximedevos <at> telenet.be>
To: "(" <paren <at> disroot.org>, Ludovic Courtès <ludo <at> gnu.org>, 
 Lars-Dominik Braun <lars <at> 6xq.net>
Cc: 57861 <at> debbugs.gnu.org
Subject: Re: [bug#57861] [PATCH] gnu: Add ultrastar-deluxe.
Date: Mon, 17 Oct 2022 15:37:09 +0200
[Message part 1 (text/plain, inline)]

On 17-10-2022 15:28, ( wrote:
> On Mon Oct 17, 2022 at 2:25 PM BST, Maxime Devos wrote:
>> That's still a circular dependency.  Why import (gnu packages pascal)
>> when you don't need it (e.g. when installing another, non-pascal,
>> package)?  There is some bug report on the excessive dependencies among
>> Guix modules with some proposed solutions.
> 
> Wouldn't using #:autoload be a cleaner way that still lazily resolves the variables?
> 
>      -- (

Possibly, I proposed this in
<https://issues.guix.gnu.org/54539#28>.  I tried this in 
<https://issues.guix.gnu.org/54539#62> for a few package modules, with a 
relatively small but noticable improvement (presumably it would be more 
improved by doing it for all package modules instead of only a selection 
and presumably it would be more noticable on a spinning disk instead of 
an SSD).

Greetings,
Maxime.
[OpenPGP_0x49E3EE22191725EE.asc (application/pgp-keys, attachment)]
[OpenPGP_signature (application/pgp-signature, attachment)]

Information forwarded to guix-patches <at> gnu.org:
bug#57861; Package guix-patches. (Mon, 17 Oct 2022 16:45:01 GMT) Full text and rfc822 format available.

Message #32 received at 57861 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Maxime Devos <maximedevos <at> telenet.be>
Cc: 57861 <at> debbugs.gnu.org, Lars-Dominik Braun <lars <at> 6xq.net>
Subject: Re: bug#57861: [PATCH] gnu: Add ultrastar-deluxe.
Date: Mon, 17 Oct 2022 18:44:21 +0200
Maxime Devos <maximedevos <at> telenet.be> skribis:

> On 17-10-2022 10:33, Ludovic Courtès wrote:
>> Hello!
>> Lars-Dominik Braun <lars <at> 6xq.net> skribis:
>> 
>>> +;; Lazily resolve to avoid a circular dependency.
>>> +(define fpc*
>>> +  (delay (module-ref (resolve-interface '(gnu packages pascal))
>>> +                     'fpc)))
>> I think this is unnecessary: you can just #:use-module (gnu packages
>> pascal) and have ‘fpc’ in ‘native-inputs’.  Everything will be fine
>> because ‘inputs’ is a thunked field (IOW, its evaluation is delayed).
>
> That's still a circular dependency.  Why import (gnu packages pascal)
> when you don't need it

That’s what every package module does.

We can discuss the drawbacks of this and ways to avoid it, but this
particular patch and review is not the right place to do that IMO.

Thanks,
Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#57861; Package guix-patches. (Mon, 17 Oct 2022 17:27:01 GMT) Full text and rfc822 format available.

Message #35 received at 57861 <at> debbugs.gnu.org (full text, mbox):

From: Maxime Devos <maximedevos <at> telenet.be>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 57861 <at> debbugs.gnu.org, Lars-Dominik Braun <lars <at> 6xq.net>
Subject: Re: bug#57861: [PATCH] gnu: Add ultrastar-deluxe.
Date: Mon, 17 Oct 2022 19:26:35 +0200
[Message part 1 (text/plain, inline)]

On 17-10-2022 18:44, Ludovic Courtès wrote:
> Maxime Devos <maximedevos <at> telenet.be> skribis:
>[...]
>> That's still a circular dependency.  Why import (gnu packages pascal)
>> when you don't need it
> 
> That’s what every package module does.
> 
> We can discuss the drawbacks of this and ways to avoid it, but this
> particular patch and review is not the right place to do that IMO.

I tried to do that, in https://issues.guix.gnu.org/54539, but there were 
no further responses.

Greetings,
Maxime.
[OpenPGP_0x49E3EE22191725EE.asc (application/pgp-keys, attachment)]
[OpenPGP_signature (application/pgp-signature, attachment)]

Information forwarded to guix-patches <at> gnu.org:
bug#57861; Package guix-patches. (Tue, 18 Oct 2022 07:57:02 GMT) Full text and rfc822 format available.

Message #38 received at 57861 <at> debbugs.gnu.org (full text, mbox):

From: Lars-Dominik Braun <lars <at> 6xq.net>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 57861 <at> debbugs.gnu.org, Maxime Devos <maximedevos <at> telenet.be>
Subject: Re: bug#57861: [PATCH] gnu: Add ultrastar-deluxe.
Date: Tue, 18 Oct 2022 09:56:22 +0200
Hi Ludo and Maxim,

> I think this is unnecessary: you can just #:use-module (gnu packages
> pascal) and have ‘fpc’ in ‘native-inputs’.  Everything will be fine
> because ‘inputs’ is a thunked field (IOW, its evaluation is delayed).
the problem is that `make` fails with an error in that case. For me it’s

    ice-9/eval.scm:293:34: error: gash: unbound variable
    hint: Did you forget a `use-modules' form?

but YMMV. With #:autoload `make` succeeds, but throws similar
errors/warnings(?) in the process:

    ;;; Failed to autoload fpc in (gnu packages pascal):
    ;;; Throw to key `unbound-variable' with args `("resolve-interface" "no binding `~A' in module ~A" (fpc (gnu packages pascal)) #f)'.

That’s why I went for the route implemented in the initial patch. What
do we do now?

Lars





Information forwarded to guix-patches <at> gnu.org:
bug#57861; Package guix-patches. (Tue, 18 Oct 2022 12:45:01 GMT) Full text and rfc822 format available.

Message #41 received at 57861 <at> debbugs.gnu.org (full text, mbox):

From: Maxime Devos <maximedevos <at> telenet.be>
To: Lars-Dominik Braun <lars <at> 6xq.net>, Ludovic Courtès
 <ludo <at> gnu.org>
Cc: 57861 <at> debbugs.gnu.org
Subject: Re: bug#57861: [PATCH] gnu: Add ultrastar-deluxe.
Date: Tue, 18 Oct 2022 14:44:46 +0200
[Message part 1 (text/plain, inline)]
On 18-10-2022 09:56, Lars-Dominik Braun wrote:
> [...]
> the problem is that `make` fails with an error in that case. For me it’s
> 
>      ice-9/eval.scm:293:34: error: gash: unbound variable
>      hint: Did you forget a `use-modules' form?
> 
> but YMMV. With #:autoload `make` succeeds, but throws similar
> errors/warnings(?) in the process:
> 
>      ;;; Failed to autoload fpc in (gnu packages pascal):
>      ;;; Throw to key `unbound-variable' with args `("resolve-interface" "no binding `~A' in module ~A" (fpc (gnu packages pascal)) #f)'

Don't know what's up with that, maybe when compiling (gnu packages 
pascal) is imported anyway because 'fpc' might be a macro?

But if I try that in a REPL:

(define-module (foo) #:autoload (bar) ( baz))
;;; Failed to determine exported bindings from module (bar):
;;; no code for module (bar)
;;; Failed to determine exported bindings from module (bar):
;;; no code for module (bar)
$1 = #<directory (foo) 7f31caf71820>

I get other messages (warnings, in this case), so maybe an incorrect 
hypothesis.

> 
> That’s why I went for the route implemented in the initial patch. What
> do we do now?

I think the issue is that (gnu packages pascal) imports (gnu packages 
commencement), even though according to the comment in (gnu packages 
commencement), you aren't supposed to do that (because of cycles).

You could give doing the resolve-module trick in (gnu packages pascal) a 
try.

Greetings,
Maxime
[OpenPGP_0x49E3EE22191725EE.asc (application/pgp-keys, attachment)]
[OpenPGP_signature (application/pgp-signature, attachment)]

Information forwarded to guix-patches <at> gnu.org:
bug#57861; Package guix-patches. (Tue, 18 Oct 2022 12:50:01 GMT) Full text and rfc822 format available.

Message #44 received at 57861 <at> debbugs.gnu.org (full text, mbox):

From: Maxime Devos <maximedevos <at> telenet.be>
To: Lars-Dominik Braun <lars <at> 6xq.net>, Ludovic Courtès
 <ludo <at> gnu.org>
Cc: 57861 <at> debbugs.gnu.org
Subject: Re: bug#57861: [PATCH] gnu: Add ultrastar-deluxe.
Date: Tue, 18 Oct 2022 14:49:35 +0200
[Message part 1 (text/plain, inline)]
(To add to my previous reply):

It appears that other package modules may need a similar change, 
according to a "git grep -F":

gnu/packages/engineering.scm:  #:use-module (gnu packages commencement)
gnu/packages/instrumentation.scm:  #:use-module (gnu packages commencement)
gnu/packages/pascal.scm:  #:use-module (gnu packages commencement)
gnu/packages/raspberry-pi.scm:  #:use-module (gnu packages commencement)

Alternatively, importing commencement could be accepted though the 
indirect dependency on 'games' from 'commencement' may need to be broken 
to resolve the error (?) message,  as done in 
<https://issues.guix.gnu.org/54539#62>

I don't remember if (gnu packages games) was one of the modules that was 
removed from the dependencies, though, and I'm not sure if this change 
would resolve things here.

Greetings,
Maxime.
[OpenPGP_0x49E3EE22191725EE.asc (application/pgp-keys, attachment)]
[OpenPGP_signature (application/pgp-signature, attachment)]

Information forwarded to guix-patches <at> gnu.org:
bug#57861; Package guix-patches. (Wed, 19 Oct 2022 11:10:01 GMT) Full text and rfc822 format available.

Message #47 received at 57861 <at> debbugs.gnu.org (full text, mbox):

From: Lars-Dominik Braun <lars <at> 6xq.net>
To: Maxime Devos <maximedevos <at> telenet.be>
Cc: Ludovic Courtès <ludo <at> gnu.org>, 57861 <at> debbugs.gnu.org
Subject: Re: bug#57861: [PATCH v2] gnu: Add ultrastar-deluxe.
Date: Wed, 19 Oct 2022 13:09:06 +0200
[Message part 1 (text/plain, inline)]
Hi Maxime,

> You could give doing the resolve-module trick in (gnu packages pascal) a 
> try.
or just #:autoload? The attached v2 seems to work at least.

Lars

[0002-gnu-Add-ultrastar-deluxe.patch (text/plain, attachment)]
[0001-gnu-fpc-Autoload-ld-wrapper.patch (text/plain, attachment)]

Information forwarded to guix-patches <at> gnu.org:
bug#57861; Package guix-patches. (Mon, 07 Nov 2022 21:42:02 GMT) Full text and rfc822 format available.

Message #50 received at 57861 <at> debbugs.gnu.org (full text, mbox):

From: Jonathan Brielmaier <jonathan.brielmaier <at> web.de>
To: 57861 <at> debbugs.gnu.org
Subject: [PATCH] gnu: Add ultrastar-deluxe.
Date: Mon, 7 Nov 2022 22:41:04 +0100
Thanks Lars for the patch.

I checked the latest version of the patch series out and
ultrastar-deluxe runs fine.
Even with my rather big (2000 songs) library.




Reply sent to Ludovic Courtès <ludo <at> gnu.org>:
You have taken responsibility. (Mon, 07 Nov 2022 23:01:02 GMT) Full text and rfc822 format available.

Notification sent to Lars-Dominik Braun <lars <at> 6xq.net>:
bug acknowledged by developer. (Mon, 07 Nov 2022 23:01:02 GMT) Full text and rfc822 format available.

Message #55 received at 57861-done <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Lars-Dominik Braun <lars <at> 6xq.net>
Cc: 57861-done <at> debbugs.gnu.org, Maxime Devos <maximedevos <at> telenet.be>
Subject: Re: bug#57861: [PATCH] gnu: Add ultrastar-deluxe.
Date: Mon, 07 Nov 2022 23:59:57 +0100
Hi,

Lars-Dominik Braun <lars <at> 6xq.net> skribis:

>>From c542fd020cbf69fa319ea13301b80eedd35f34a3 Mon Sep 17 00:00:00 2001
> From: Lars-Dominik Braun <lars <at> 6xq.net>
> Date: Wed, 19 Oct 2022 13:05:25 +0200
> Subject: [PATCH v2 2/2] gnu: Add ultrastar-deluxe.
>
> * gnu/packages/games.scm (ultrastar-deluxe): New variable.
> * gnu/packages/patches/ultrastar-deluxe-no-freesans.patch: New file.
> * gnu/local.mk: Add it.

Applied on your behalf.

Turns out pascal.scm didn’t need to include (gnu packages
commencement) so I did that first.

Next step is a fix for <https://issues.guix.gnu.org/55968>, which
affects this package too…

Thanks,
Ludo’.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 06 Dec 2022 12:24:09 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 112 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.