GNU bug report logs - #76359
[PATCH] gnu: supertuxkart: Split assets into separate package.

Previous Next

Package: guix-patches;

Reported by: Eric Bavier <bavier <at> posteo.net>

Date: Mon, 17 Feb 2025 05:47:03 UTC

Severity: normal

Tags: patch

Done: Eric Bavier <bavier <at> posteo.net>

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 76359 in the body.
You can then email your comments to 76359 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 adam.faiz <at> disroot.org, liliana.prikler <at> gmail.com, iyzsong <at> envs.net, guix-patches <at> gnu.org:
bug#76359; Package guix-patches. (Mon, 17 Feb 2025 05:47:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Eric Bavier <bavier <at> posteo.net>:
New bug report received and forwarded. Copy sent to adam.faiz <at> disroot.org, liliana.prikler <at> gmail.com, iyzsong <at> envs.net, guix-patches <at> gnu.org. (Mon, 17 Feb 2025 05:47:03 GMT) Full text and rfc822 format available.

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

From: Eric Bavier <bavier <at> posteo.net>
To: guix-patches <at> gnu.org
Cc: Eric Bavier <bavier <at> posteo.net>
Subject: [PATCH] gnu: supertuxkart: Split assets into separate package.
Date: Mon, 17 Feb 2025 05:45:57 +0000
This allows smaller substitutes in case of updated dependencies.

* gnu/packages/games.scm (%supertuxkart-version): New variable.
(supertuxkart-source): Separate from supertuxkart in order to use in...
(supertuxkart-data): ... this new package.
(supertuxkart)[origin]: Use supertuxkart-source.
[arguments]: Add configure-flags to embed reference to supertuxkart-data.
[inputs]: Use new style.

Change-Id: I7777574bf11fdc28047ad238468e5ec4094caeab
---
 gnu/packages/games.scm | 138 +++++++++++++++++++++++++++++------------
 1 file changed, 98 insertions(+), 40 deletions(-)

diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
index 843771b2fa..e58dd29199 100644
--- a/gnu/packages/games.scm
+++ b/gnu/packages/games.scm
@@ -4697,19 +4697,17 @@ (define-public exult
     (home-page "http://exult.info/")
     (license license:gpl2+)))
 
-(define-public supertuxkart
-  (package
-    (name "supertuxkart")
-    (version "1.4")
-    (source
-     (origin
-       (method url-fetch)
-       (uri (string-append "https://github.com/supertuxkart/stk-code/"
-                           "releases/download/"
-                           version "/SuperTuxKart-" version "-src.tar.xz"))
+(define %supertuxkart-version "1.4")
+(define supertuxkart-source
+  (origin
+    (method git-fetch)
+    (uri (git-reference
+          (url "https://github.com/supertuxkart/stk-code")
+          (commit %supertuxkart-version)))
        (sha256
         (base32
-         "00qg5i9y4i5gdiiq1dbfsgp7dwj60zb5lkgi2d9p3x5s34j3k44q"))
+         "1hv4p0430zw6qm5fgsmayhj8hdxx7qpzggwks5w26z0dz1b5m9w2"))
+       (file-name (git-file-name "supertuxkart" %supertuxkart-version))
        (modules '((guix build utils)))
        (snippet
         ;; Delete bundled library sources
@@ -4723,38 +4721,98 @@ (define-public supertuxkart
                        "lib/enet"
                        "lib/mcpp"
                        "lib/mojoal"
-                       "lib/wiiuse"))
-           #t))))
+                       "lib/wiiuse"))))))
+
+(define supertuxkart-data
+  ;; There are no tags or releases for the stk-assets data, nor indication of
+  ;; which revision is bundled into the released SuperTuxKart-*-src tarball;
+  ;; use the latest SVN revision available.
+  (let ((commit "18593")
+        (revision "0"))
+    (hidden-package
+     (package
+       (name "supertuxkart-data")
+       ;; The package produced is a merger of supertuxkart's "stk-assets"
+       ;; repository and the "stk-code" repository's "data" directory, so
+       ;; include the code version as well.
+       (version (string-append %supertuxkart-version "-" commit))
+       (source
+        (origin
+          (method svn-fetch)
+          (uri (svn-reference
+                (url "https://svn.code.sf.net/p/supertuxkart/code/stk-assets")
+                (revision (string->number commit))))
+          (file-name (string-append name "-" commit "-checkout"))
+          (sha256
+           (base32
+            "0x2l45w1ahgkw9mrbcxzwdlqs7rams6rsga9m40qjapfiqmvlvbg"))))
+       (build-system copy-build-system)
+       (arguments
+        (list #:install-plan
+              #~'(("." "share/supertuxkart/data"
+                   #:exclude-regexp ("wip-.*")))
+              #:phases
+              #~(modify-phases %standard-phases
+                  (add-after 'unpack 'copy-code-data
+                    (lambda _
+                      (copy-recursively
+                       (string-append #$supertuxkart-source "/data/")
+                       "."))))))
+       (home-page "https://supertuxkart.net/Main_Page")
+       (synopsis "Data files for SuperTuxKart")
+       (description "This package contains data files for SuperTuxKart.")
+       (license (list license:gpl3+
+                      license:cc-by-sa3.0
+                      license:cc-by-sa4.0
+                      license:cc0))))))
+
+(define-public supertuxkart
+  (package
+    (name "supertuxkart")
+    (version %supertuxkart-version)
+    (source supertuxkart-source)
     (build-system cmake-build-system)
     (arguments
-     `(#:tests? #f ; no check target
-       #:configure-flags
-       (list "-DUSE_WIIUSE=0"
-             "-DUSE_SYSTEM_ENET=TRUE"
-             "-DUSE_CRYPTO_OPENSSL=TRUE"
-             ;; In order to use the system ENet library, IPv6 support (added in
-             ;; SuperTuxKart version 1.1) must be disabled.
-             "-DUSE_IPV6=FALSE")))
+     (list #:tests? #f                  ; no check target
+           #:configure-flags
+           #~(list "-DCHECK_ASSETS=FALSE" ; assets are out-of-tree
+                   (string-append "-DSTK_INSTALL_DATA_DIR_ABSOLUTE="
+                                  #$(this-package-input "supertuxkart-data")
+                                  "/share/supertuxkart")
+                   "-DUSE_WIIUSE=0"
+                   "-DUSE_SYSTEM_ENET=TRUE"
+                   "-DUSE_CRYPTO_OPENSSL=TRUE"
+                   ;; In order to use the system ENet library, IPv6 support
+                   ;; (added in SuperTuxKart version 1.1) must be disabled.
+                   "-DUSE_IPV6=FALSE")
+           #:phases
+           #~(modify-phases %standard-phases
+               (add-before 'configure 'disable-data-install
+                 (lambda _
+                   (substitute* "CMakeLists.txt"
+                     (("^install\\(.*STK_DATA_DIR" &)
+                      (string-append "# " &))))))))
     (inputs
-     `(("curl" ,curl)
-       ("freetype" ,freetype)
-       ("fribidi" ,fribidi)
-       ("glew" ,glew)
-       ("harfbuzz" ,harfbuzz)
-       ("libopenglrecorder" ,libopenglrecorder)
-       ("libvorbis" ,libvorbis)
-       ("libx11" ,libx11)
-       ("libxrandr" ,libxrandr)
-       ("mesa" ,mesa)
-       ("openal" ,openal)
-       ("sdl2" ,sdl2)
-       ("sqlite" ,sqlite)
-       ("zlib" ,zlib)
-       ;; The following input is needed to build the bundled and modified
-       ;; version of irrlicht.
-       ("enet" ,enet)
-       ("libjpeg" ,libjpeg-turbo)
-       ("openssl" ,openssl)))
+     (list curl
+           freetype
+           fribidi
+           glew
+           harfbuzz
+           libopenglrecorder
+           libvorbis
+           libx11
+           libxrandr
+           mesa
+           openal
+           sdl2
+           sqlite
+           supertuxkart-data
+           zlib
+           ;; The following input is needed to build the bundled and modified
+           ;; version of irrlicht.
+           enet
+           libjpeg-turbo
+           openssl))
     (native-inputs (list mcpp pkg-config python))
     (home-page "https://supertuxkart.net/Main_Page")
     (synopsis "3D kart racing game")

base-commit: 61440f9c64e64eb8dbe29b8b94decdf85ef4b605
prerequisite-patch-id: 44e80fdef3b037e716a24124be2d8baadf1f071a
-- 
2.48.1





Information forwarded to guix-patches <at> gnu.org:
bug#76359; Package guix-patches. (Sat, 01 Mar 2025 14:36:01 GMT) Full text and rfc822 format available.

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

From: Ludovic Courtès <ludo <at> gnu.org>
To: Eric Bavier <bavier <at> posteo.net>
Cc: 宋文武 <iyzsong <at> envs.net>,
 Liliana Marie Prikler <liliana.prikler <at> gmail.com>,
 Adam Faiz <adam.faiz <at> disroot.org>, 76359 <at> debbugs.gnu.org
Subject: Re: [bug#76359] [PATCH] gnu: supertuxkart: Split assets into
 separate package.
Date: Sat, 01 Mar 2025 15:35:13 +0100
Hi Eric,

Eric Bavier <bavier <at> posteo.net> skribis:

> This allows smaller substitutes in case of updated dependencies.
>
> * gnu/packages/games.scm (%supertuxkart-version): New variable.
> (supertuxkart-source): Separate from supertuxkart in order to use in...
> (supertuxkart-data): ... this new package.
> (supertuxkart)[origin]: Use supertuxkart-source.
> [arguments]: Add configure-flags to embed reference to supertuxkart-data.
> [inputs]: Use new style.
>
> Change-Id: I7777574bf11fdc28047ad238468e5ec4094caeab

Overall LGTM.  One question:

> -       (uri (string-append "https://github.com/supertuxkart/stk-code/"
> -                           "releases/download/"
> -                           version "/SuperTuxKart-" version "-src.tar.xz"))

[...]

> +          (uri (svn-reference
> +                (url "https://svn.code.sf.net/p/supertuxkart/code/stk-assets")
> +                (revision (string->number commit))))

How come the assets are at sf.net, in an svn repo, when the rest is in
Git at github.com?

> +              #~(modify-phases %standard-phases
> +                  (add-after 'unpack 'copy-code-data
> +                    (lambda _
> +                      (copy-recursively
> +                       (string-append #$supertuxkart-source "/data/")
> +                       "."))))))

I’d suggest adding ‘supertuxkart-source’ to the ‘inputs’ field and, in
the phase above, do:

  (copy-recursively
    #$(this-package-input (git-file-name "supertuxkart" %supertuxkart-version))
    ".")

It’s more verbose, but more transparent: code the traverses the package
grafts “sees” this.

Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#76359; Package guix-patches. (Sun, 02 Mar 2025 04:48:02 GMT) Full text and rfc822 format available.

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

From: Eric Bavier <bavier <at> posteo.net>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 宋文武 <iyzsong <at> envs.net>,
 Liliana Marie Prikler <liliana.prikler <at> gmail.com>,
 Adam Faiz <adam.faiz <at> disroot.org>, 76359 <at> debbugs.gnu.org
Subject: Re: [bug#76359] [PATCH] gnu: supertuxkart: Split assets into separate
 package.
Date: Sun,  2 Mar 2025 04:47:39 +0000
[Message part 1 (text/plain, inline)]
Hi Ludovic,

Thank you for the review.

On 3/1/25 08:35, Ludovic Courtès wrote:
>> +          (uri (svn-reference
>> +                (url "https://svn.code.sf.net/p/supertuxkart/code/stk-assets")
>> +                (revision (string->number commit))))
> How come the assets are at sf.net, in an svn repo, when the rest is in
> Git at github.com?

Their https://supertuxkart.net/Source_control page states simply:

  "SupertTuxKart uses Git for source code, and SVN for data files."

I don't know of any rationale beyond that.

>> +              #~(modify-phases %standard-phases
>> +                  (add-after 'unpack 'copy-code-data
>> +                    (lambda _
>> +                      (copy-recursively
>> +                       (string-append #$supertuxkart-source "/data/")
>> +                       "."))))))
> I’d suggest adding ‘supertuxkart-source’ to the ‘inputs’ field and, in
> the phase above, do:
>
>    (copy-recursively
>      #$(this-package-input (git-file-name "supertuxkart" %supertuxkart-version))
>      ".")

Thank you for the suggestion.  This is indeed better.

Revised patch attached.

`~Eric
[0001-gnu-supertuxkart-Split-assets-into-separate-package.patch (text/x-patch, attachment)]

Information forwarded to guix-patches <at> gnu.org:
bug#76359; Package guix-patches. (Tue, 04 Mar 2025 14:27:02 GMT) Full text and rfc822 format available.

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

From: Ludovic Courtès <ludo <at> gnu.org>
To: Eric Bavier <bavier <at> posteo.net>
Cc: 宋文武 <iyzsong <at> envs.net>,
 Liliana Marie Prikler <liliana.prikler <at> gmail.com>,
 Adam Faiz <adam.faiz <at> disroot.org>, 76359 <at> debbugs.gnu.org
Subject: Re: [bug#76359] [PATCH] gnu: supertuxkart: Split assets into
 separate package.
Date: Tue, 04 Mar 2025 15:26:33 +0100
Eric Bavier <bavier <at> posteo.net> skribis:

> From 0764a51a3e35165a77ef4ba16f4400b3e8e1e908 Mon Sep 17 00:00:00 2001
> Message-ID: <0764a51a3e35165a77ef4ba16f4400b3e8e1e908.1740889876.git.bavier <at> posteo.net>
> From: Eric Bavier <bavier <at> posteo.net>
> Date: Sun, 16 Feb 2025 23:32:07 -0600
> Subject: [PATCH] gnu: supertuxkart: Split assets into separate package.
>
> This allows smaller substitutes in case of updated dependencies.
>
> * gnu/packages/games.scm (%supertuxkart-version): New variable.
> (supertuxkart-source): Separate from supertuxkart in order to use in...
> (supertuxkart-data): ... this new package.
> (supertuxkart)[origin]: Use supertuxkart-source.
> [arguments]: Add configure-flags to embed reference to supertuxkart-data.
> [inputs]: Use new style.
>
> Change-Id: I7777574bf11fdc28047ad238468e5ec4094caeab

LGTM, thanks!




Reply sent to Eric Bavier <bavier <at> posteo.net>:
You have taken responsibility. (Wed, 05 Mar 2025 04:52:02 GMT) Full text and rfc822 format available.

Notification sent to Eric Bavier <bavier <at> posteo.net>:
bug acknowledged by developer. (Wed, 05 Mar 2025 04:52:02 GMT) Full text and rfc822 format available.

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

From: Eric Bavier <bavier <at> posteo.net>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 宋文武 <iyzsong <at> envs.net>, 76359-done <at> debbugs.gnu.org,
 Liliana Marie Prikler <liliana.prikler <at> gmail.com>,
 Adam Faiz <adam.faiz <at> disroot.org>
Subject: Re: [bug#76359] [PATCH] gnu: supertuxkart: Split assets into separate
 package.
Date: Wed,  5 Mar 2025 04:51:22 +0000
On 3/4/25 08:26, Ludovic Courtès wrote:
> Eric Bavier <bavier <at> posteo.net> skribis:
>
>>  From 0764a51a3e35165a77ef4ba16f4400b3e8e1e908 Mon Sep 17 00:00:00 2001
>> Message-ID: <0764a51a3e35165a77ef4ba16f4400b3e8e1e908.1740889876.git.bavier <at> posteo.net>
>> From: Eric Bavier <bavier <at> posteo.net>
>> Date: Sun, 16 Feb 2025 23:32:07 -0600
>> Subject: [PATCH] gnu: supertuxkart: Split assets into separate package.
>>
>> This allows smaller substitutes in case of updated dependencies.
>>
>> * gnu/packages/games.scm (%supertuxkart-version): New variable.
>> (supertuxkart-source): Separate from supertuxkart in order to use in...
>> (supertuxkart-data): ... this new package.
>> (supertuxkart)[origin]: Use supertuxkart-source.
>> [arguments]: Add configure-flags to embed reference to supertuxkart-data.
>> [inputs]: Use new style.
>>
>> Change-Id: I7777574bf11fdc28047ad238468e5ec4094caeab
> LGTM, thanks!

Thanks for the review!  I've pushed this patch in 
7b33214d80e3e07421626449415e14bf120d93c9.

`~Eric





bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 02 Apr 2025 11:24:28 GMT) Full text and rfc822 format available.

This bug report was last modified 137 days ago.

Previous Next


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