unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#74336] [PATCH] gnu: minetest: Update to 5.10.0.
       [not found] <f5997e8e14f7d9232f804c785e8157e83073dc5e.1731493615.git.poomklao.ref@yahoo.com>
@ 2024-11-13 10:33 ` Parnikkapore via Guix-patches via
  2024-11-13 12:05   ` Parnikkapore via Guix-patches via
                     ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Parnikkapore via Guix-patches via @ 2024-11-13 10:33 UTC (permalink / raw)
  To: 74336
  Cc: Adam Faiz, Liliana Marie Prikler,
	宋文武

* gnu/packages/minetest.scm (minetest): Update to 5.10.0.
[source] <snippet>: Fix unbundling.
[arguments] <#:configure-flags>: Remove redundant flags.
[arguments] <#:phases>: Remove patches to nonexistent code (or that
breaks stuff).
[inputs]: Remove coreutils and libxxf86vm.

Change-Id: If8720bb51309d7c251e76a1885695851f3a03255
---

Hi Guix!

This is an update + cleanup of Minetest^WLuanti. Some of the
highlights:

- Apparently, the old unbundling code is broken and deleted nothing.
  A few packages (catch2 and tiniergltf) are assumed by the CMake files
  to be bundled - I don't have time to work around that yet, but it
  shouldn't be too difficult.
- Removed substitute*-s for code that no longer exist (+ one that's
  now causing a build failure) and unused/redundant dependencies. Also,
  redundant CMake flags.

Known issues:
- Will segfault upon exit somewhere within IrrlichtMT
- Incomplete unbundling

As mentioned earlier, [Minetest has been renamed to Luanti][1]. This
would've been a simple rename + deprecated-package job... if not for
the fact that the word "minetest" appears in several places in Guix.
We need to figure out how to handle that...

[1]: https://blog.minetest.net/2024/10/13/Introducing-Our-New-Name/

 gnu/packages/minetest.scm | 54 ++++++++++++---------------------------
 1 file changed, 16 insertions(+), 38 deletions(-)

diff --git a/gnu/packages/minetest.scm b/gnu/packages/minetest.scm
index 2552596ef8..241fe8588c 100644
--- a/gnu/packages/minetest.scm
+++ b/gnu/packages/minetest.scm
@@ -54,7 +54,7 @@ (define-module (gnu packages minetest)
 (define-public minetest
   (package
     (name "minetest")
-    (version "5.9.0")
+    (version "5.10.0")
     (source
      (origin
        (method git-fetch)
@@ -63,20 +63,25 @@ (define-public minetest
              (commit version)))
        (file-name (git-file-name name version))
        (sha256
-        (base32 "1h4yn4k0wpjr1h24aiqcnc9xsxgxj4bq757pla2pa9zmh2xf45kk"))
+        (base32 "1nsnsf1axiazb8zz51c0742kh0qx2b298pr5mr91m0l9r6dv1sdj"))
        (modules '((guix build utils)))
        ;; Delete bundled libraries, keep lib/sha256 because there's no good
        ;; upstream, see:
        ;; https://github.com/openssl/openssl/blob/master/crypto/sha/sha512.c
        ;; "SHA512 low level APIs are deprecated for public use,
        ;; but still ok for internal use." Also asked MT devs on IRC for this.
+       ;; TODO: catch2 should be unbundled (but may need to have its version
+       ;;       pinned); tiniergltf is separate but Minetest-specific so could
+       ;;       go either way.
        (snippet
         '(begin
-           (with-directory-excursion "lib"
-             (for-each (lambda (file)
-                         (if (not (string=? file "sha256"))
-                             (delete-file-recursively file)))
-                       (find-files (string-append "lib") #:directories? #t)))
+           (rename-file "lib" "_lib")
+           (mkdir "lib")
+           (for-each (lambda (lib)
+                       (rename-file (format #f "_lib/~a" lib)
+                                    (format #f "lib/~a" lib)))
+                     '(sha256 catch2 tiniergltf))
+           (delete-file-recursively "_lib")
            #t))))
     (build-system cmake-build-system)
     (arguments
@@ -84,35 +89,9 @@ (define-public minetest
       #:configure-flags
       #~(list "-DENABLE_LTO=ON"
               "-DENABLE_UPDATE_CHECKER=FALSE"
-              (string-append "-DCURL_INCLUDE_DIR="
-                             (search-input-directory
-                              %build-inputs "include/curl"))
-              (string-append "-DZSTD_INCLUDE_DIR="
-                             (dirname (search-input-file
-                                       %build-inputs
-                                       "include/zstd.h")))
-              (string-append "-DZSTD_LIBRARY="
-                             (search-input-file
-                              %build-inputs "lib/libzstd.so")))
+              "-DINSTALL_DEVTEST=TRUE") ; Required for tests
       #:phases
       #~(modify-phases %standard-phases
-          (add-after 'unpack 'patch-sources
-            (lambda* (#:key inputs #:allow-other-keys)
-              (substitute* "src/filesys.cpp"
-                ;; Use store-path for "rm" instead of non-existing FHS path.
-                (("\"/bin/rm\"")
-                 (format #f "~s"
-                         (search-input-file inputs "bin/rm"))))
-              (substitute* "src/CMakeLists.txt"
-                ;; Let minetest binary remain in build directory.
-                (("set\\(EXECUTABLE_OUTPUT_PATH .*\\)")
-                 ""))
-              (substitute* "src/unittest/test_servermodmanager.cpp"
-                ;; do no override MINETEST_GAME_PATH
-                (("(un)?setenv\\(\"MINETEST_GAME_PATH\".*\\);")
-                 "(void)0;"))
-              (setenv "MINETEST_GAME_PATH" ;for check
-                      (string-append (getcwd) "/games"))))
           (delete 'check)
           (add-after 'install 'check
             (lambda* (#:key tests? #:allow-other-keys)
@@ -120,7 +99,7 @@ (define-public minetest
               ;; when invoked on the target outside of `guix build'.
               (when tests?
                 (setenv "HOME" "/tmp")
-                (invoke "src/minetest" "--run-unittests")))))))
+                (invoke "../source/bin/luanti" "--run-unittests")))))))
     (native-search-paths
      (list (search-path-specification
             (variable "MINETEST_GAME_PATH")
@@ -129,8 +108,7 @@ (define-public minetest
             (variable "MINETEST_MOD_PATH")
             (files '("share/minetest/mods")))))
     (native-inputs (list pkg-config))
-    (inputs (list coreutils
-                  curl
+    (inputs (list curl
                   freetype
                   gettext-minimal
                   gmp
@@ -139,7 +117,6 @@ (define-public minetest
                   libpng
                   libogg
                   libvorbis
-                  libxxf86vm
                   libxi
                   luajit
                   mesa
@@ -147,6 +124,7 @@ (define-public minetest
                   openal
                   sqlite
                   `(,zstd "lib")))
+    (outputs '("out" "debug"))
     (synopsis "Voxel game engine")
     (description
      "Minetest is a voxel game engine that supports modding and game creation

base-commit: 1f057603ef59c7b9c32f610a897321fd75dc4dad
-- 
2.43.0





^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [bug#74336] [PATCH] gnu: minetest: Update to 5.10.0.
  2024-11-13 10:33 ` [bug#74336] [PATCH] gnu: minetest: Update to 5.10.0 Parnikkapore via Guix-patches via
@ 2024-11-13 12:05   ` Parnikkapore via Guix-patches via
  2024-11-15 18:10   ` Liliana Marie Prikler
  2024-11-17  5:41   ` [bug#74336] [PATCH v3] " Parnikkapore via Guix-patches via
  2 siblings, 0 replies; 6+ messages in thread
From: Parnikkapore via Guix-patches via @ 2024-11-13 12:05 UTC (permalink / raw)
  To: 74336
  Cc: Parnikkapore, Adam Faiz, Liliana Marie Prikler,
	宋文武

* gnu/packages/minetest.scm (minetest): Update to 5.10.0.
[source] <snippet>: Fix unbundling.
[arguments] <#:configure-flags>: Remove redundant flags.
[arguments] <#:phases>: Remove all patches no longer applicable.
[inputs]: Remove coreutils and libxxf86vm.

Change-Id: If8720bb51309d7c251e76a1885695851f3a03255
---

Small update as I found out how the old package definition made the tests pass.

 gnu/packages/minetest.scm | 57 +++++++++++++--------------------------
 1 file changed, 18 insertions(+), 39 deletions(-)

diff --git a/gnu/packages/minetest.scm b/gnu/packages/minetest.scm
index 2552596ef8..64acdc6a98 100644
--- a/gnu/packages/minetest.scm
+++ b/gnu/packages/minetest.scm
@@ -54,7 +54,7 @@ (define-module (gnu packages minetest)
 (define-public minetest
   (package
     (name "minetest")
-    (version "5.9.0")
+    (version "5.10.0")
     (source
      (origin
        (method git-fetch)
@@ -63,56 +63,34 @@ (define-public minetest
              (commit version)))
        (file-name (git-file-name name version))
        (sha256
-        (base32 "1h4yn4k0wpjr1h24aiqcnc9xsxgxj4bq757pla2pa9zmh2xf45kk"))
+        (base32 "1nsnsf1axiazb8zz51c0742kh0qx2b298pr5mr91m0l9r6dv1sdj"))
        (modules '((guix build utils)))
        ;; Delete bundled libraries, keep lib/sha256 because there's no good
        ;; upstream, see:
        ;; https://github.com/openssl/openssl/blob/master/crypto/sha/sha512.c
        ;; "SHA512 low level APIs are deprecated for public use,
        ;; but still ok for internal use." Also asked MT devs on IRC for this.
+       ;; TODO: catch2 should be unbundled (but may need to have its version
+       ;;       pinned); tiniergltf is separate but Minetest-specific so could
+       ;;       go either way.
        (snippet
         '(begin
-           (with-directory-excursion "lib"
-             (for-each (lambda (file)
-                         (if (not (string=? file "sha256"))
-                             (delete-file-recursively file)))
-                       (find-files (string-append "lib") #:directories? #t)))
+           (rename-file "lib" "_lib")
+           (mkdir "lib")
+           (for-each (lambda (lib)
+                       (rename-file (format #f "_lib/~a" lib)
+                                    (format #f "lib/~a" lib)))
+                     '(sha256 catch2 tiniergltf))
+           (delete-file-recursively "_lib")
            #t))))
     (build-system cmake-build-system)
     (arguments
      (list
       #:configure-flags
       #~(list "-DENABLE_LTO=ON"
-              "-DENABLE_UPDATE_CHECKER=FALSE"
-              (string-append "-DCURL_INCLUDE_DIR="
-                             (search-input-directory
-                              %build-inputs "include/curl"))
-              (string-append "-DZSTD_INCLUDE_DIR="
-                             (dirname (search-input-file
-                                       %build-inputs
-                                       "include/zstd.h")))
-              (string-append "-DZSTD_LIBRARY="
-                             (search-input-file
-                              %build-inputs "lib/libzstd.so")))
+              "-DENABLE_UPDATE_CHECKER=FALSE")
       #:phases
       #~(modify-phases %standard-phases
-          (add-after 'unpack 'patch-sources
-            (lambda* (#:key inputs #:allow-other-keys)
-              (substitute* "src/filesys.cpp"
-                ;; Use store-path for "rm" instead of non-existing FHS path.
-                (("\"/bin/rm\"")
-                 (format #f "~s"
-                         (search-input-file inputs "bin/rm"))))
-              (substitute* "src/CMakeLists.txt"
-                ;; Let minetest binary remain in build directory.
-                (("set\\(EXECUTABLE_OUTPUT_PATH .*\\)")
-                 ""))
-              (substitute* "src/unittest/test_servermodmanager.cpp"
-                ;; do no override MINETEST_GAME_PATH
-                (("(un)?setenv\\(\"MINETEST_GAME_PATH\".*\\);")
-                 "(void)0;"))
-              (setenv "MINETEST_GAME_PATH" ;for check
-                      (string-append (getcwd) "/games"))))
           (delete 'check)
           (add-after 'install 'check
             (lambda* (#:key tests? #:allow-other-keys)
@@ -120,7 +98,9 @@ (define-public minetest
               ;; when invoked on the target outside of `guix build'.
               (when tests?
                 (setenv "HOME" "/tmp")
-                (invoke "src/minetest" "--run-unittests")))))))
+                (setenv "MINETEST_GAME_PATH"
+                        (string-append (getcwd) "/../source/games"))
+                (invoke "../source/bin/luanti" "--run-unittests")))))))
     (native-search-paths
      (list (search-path-specification
             (variable "MINETEST_GAME_PATH")
@@ -129,8 +109,7 @@ (define-public minetest
             (variable "MINETEST_MOD_PATH")
             (files '("share/minetest/mods")))))
     (native-inputs (list pkg-config))
-    (inputs (list coreutils
-                  curl
+    (inputs (list curl
                   freetype
                   gettext-minimal
                   gmp
@@ -139,7 +118,6 @@ (define-public minetest
                   libpng
                   libogg
                   libvorbis
-                  libxxf86vm
                   libxi
                   luajit
                   mesa
@@ -147,6 +125,7 @@ (define-public minetest
                   openal
                   sqlite
                   `(,zstd "lib")))
+    (outputs '("out" "debug"))
     (synopsis "Voxel game engine")
     (description
      "Minetest is a voxel game engine that supports modding and game creation

base-commit: 1f057603ef59c7b9c32f610a897321fd75dc4dad
-- 
2.46.0





^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [bug#74336] [PATCH] gnu: minetest: Update to 5.10.0.
  2024-11-13 10:33 ` [bug#74336] [PATCH] gnu: minetest: Update to 5.10.0 Parnikkapore via Guix-patches via
  2024-11-13 12:05   ` Parnikkapore via Guix-patches via
@ 2024-11-15 18:10   ` Liliana Marie Prikler
  2024-11-17  5:41   ` [bug#74336] [PATCH v3] " Parnikkapore via Guix-patches via
  2 siblings, 0 replies; 6+ messages in thread
From: Liliana Marie Prikler @ 2024-11-15 18:10 UTC (permalink / raw)
  To: Parnikkapore, 74336; +Cc: iyzsong, Adam Faiz

Hi,

Am Mittwoch, dem 13.11.2024 um 18:33 +0800 schrieb Parnikkapore:
> * gnu/packages/minetest.scm (minetest): Update to 5.10.0.
> [source] <snippet>: Fix unbundling.
> [arguments] <#:configure-flags>: Remove redundant flags.
> [arguments] <#:phases>: Remove patches to nonexistent code (or that
> breaks stuff).
> [inputs]: Remove coreutils and libxxf86vm.
> 
> Change-Id: If8720bb51309d7c251e76a1885695851f3a03255
> ---
> 
> Hi Guix!
> 
> This is an update + cleanup of Minetest^WLuanti. Some of the
> highlights:
> 
> - Apparently, the old unbundling code is broken and deleted nothing.
>   A few packages (catch2 and tiniergltf) are assumed by the CMake
> files
>   to be bundled - I don't have time to work around that yet, but it
>   shouldn't be too difficult.
> - Removed substitute*-s for code that no longer exist (+ one that's
>   now causing a build failure) and unused/redundant dependencies.
> Also,
>   redundant CMake flags.
> 
> Known issues:
> - Will segfault upon exit somewhere within IrrlichtMT
> - Incomplete unbundling
> 
> As mentioned earlier, [Minetest has been renamed to Luanti][1]. This
> would've been a simple rename + deprecated-package job... if not for
> the fact that the word "minetest" appears in several places in Guix.
> We need to figure out how to handle that...
You can define minetest-build-system as a deprecated alias and change
all mentions of it.  Likewise for the importer.  All of those would be
one patch each, I suppose.

> [1]: https://blog.minetest.net/2024/10/13/Introducing-Our-New-Name/
> 
>  gnu/packages/minetest.scm | 54 ++++++++++++-------------------------
> --
>  1 file changed, 16 insertions(+), 38 deletions(-)
> 
> diff --git a/gnu/packages/minetest.scm b/gnu/packages/minetest.scm
> index 2552596ef8..241fe8588c 100644
> --- a/gnu/packages/minetest.scm
> +++ b/gnu/packages/minetest.scm
> @@ -54,7 +54,7 @@ (define-module (gnu packages minetest)
>  (define-public minetest
>    (package
>      (name "minetest")
> -    (version "5.9.0")
> +    (version "5.10.0")
>      (source
>       (origin
>         (method git-fetch)
> @@ -63,20 +63,25 @@ (define-public minetest
>               (commit version)))
>         (file-name (git-file-name name version))
>         (sha256
> -        (base32
> "1h4yn4k0wpjr1h24aiqcnc9xsxgxj4bq757pla2pa9zmh2xf45kk"))
> +        (base32
> "1nsnsf1axiazb8zz51c0742kh0qx2b298pr5mr91m0l9r6dv1sdj"))
>         (modules '((guix build utils)))
>         ;; Delete bundled libraries, keep lib/sha256 because there's
> no good
>         ;; upstream, see:
>         ;;
> https://github.com/openssl/openssl/blob/master/crypto/sha/sha512.c
>         ;; "SHA512 low level APIs are deprecated for public use,
>         ;; but still ok for internal use." Also asked MT devs on IRC
> for this.
> +       ;; TODO: catch2 should be unbundled (but may need to have its
> version
> +       ;;       pinned); tiniergltf is separate but Minetest-
> specific so could
> +       ;;       go either way.
>         (snippet
>          '(begin
> -           (with-directory-excursion "lib"
> -             (for-each (lambda (file)
> -                         (if (not (string=? file "sha256"))
> -                             (delete-file-recursively file)))
> -                       (find-files (string-append "lib")
> #:directories? #t)))
> +           (rename-file "lib" "_lib")
> +           (mkdir "lib")
> +           (for-each (lambda (lib)
> +                       (rename-file (format #f "_lib/~a" lib)
> +                                    (format #f "lib/~a" lib)))
> +                     '(sha256 catch2 tiniergltf))
> +           (delete-file-recursively "_lib")
We typically use scandir and 
  (unless (member file '("." ".." other exceptions))
    …)
to delete those files.  Nice catch on the find-files abuse, however. 
>             #t))))
>      (build-system cmake-build-system)
>      (arguments
> @@ -84,35 +89,9 @@ (define-public minetest
>        #:configure-flags
>        #~(list "-DENABLE_LTO=ON"
>                "-DENABLE_UPDATE_CHECKER=FALSE"
> -              (string-append "-DCURL_INCLUDE_DIR="
> -                             (search-input-directory
> -                              %build-inputs "include/curl"))
> -              (string-append "-DZSTD_INCLUDE_DIR="
> -                             (dirname (search-input-file
> -                                       %build-inputs
> -                                       "include/zstd.h")))
> -              (string-append "-DZSTD_LIBRARY="
> -                             (search-input-file
> -                              %build-inputs "lib/libzstd.so")))
> +              "-DINSTALL_DEVTEST=TRUE") ; Required for tests
>        #:phases
>        #~(modify-phases %standard-phases
> -          (add-after 'unpack 'patch-sources
> -            (lambda* (#:key inputs #:allow-other-keys)
> -              (substitute* "src/filesys.cpp"
> -                ;; Use store-path for "rm" instead of non-existing
> FHS path.
> -                (("\"/bin/rm\"")
> -                 (format #f "~s"
> -                         (search-input-file inputs "bin/rm"))))
> -              (substitute* "src/CMakeLists.txt"
> -                ;; Let minetest binary remain in build directory.
> -                (("set\\(EXECUTABLE_OUTPUT_PATH .*\\)")
> -                 ""))
> -              (substitute* "src/unittest/test_servermodmanager.cpp"
> -                ;; do no override MINETEST_GAME_PATH
> -                (("(un)?setenv\\(\"MINETEST_GAME_PATH\".*\\);")
> -                 "(void)0;"))
> -              (setenv "MINETEST_GAME_PATH" ;for check
> -                      (string-append (getcwd) "/games"))))
>            (delete 'check)
>            (add-after 'install 'check
>              (lambda* (#:key tests? #:allow-other-keys)
> @@ -120,7 +99,7 @@ (define-public minetest
>                ;; when invoked on the target outside of `guix build'.
>                (when tests?
>                  (setenv "HOME" "/tmp")
> -                (invoke "src/minetest" "--run-unittests")))))))
> +                (invoke "../source/bin/luanti" "--run-
> unittests")))))))
Uhm… why does the build install to ../source? D:
>      (native-search-paths
>       (list (search-path-specification
>              (variable "MINETEST_GAME_PATH")
> @@ -129,8 +108,7 @@ (define-public minetest
>              (variable "MINETEST_MOD_PATH")
>              (files '("share/minetest/mods")))))
>      (native-inputs (list pkg-config))
> -    (inputs (list coreutils
> -                  curl
> +    (inputs (list curl
>                    freetype
>                    gettext-minimal
>                    gmp
> @@ -139,7 +117,6 @@ (define-public minetest
>                    libpng
>                    libogg
>                    libvorbis
> -                  libxxf86vm
>                    libxi
>                    luajit
>                    mesa
> @@ -147,6 +124,7 @@ (define-public minetest
>                    openal
>                    sqlite
>                    `(,zstd "lib")))
> +    (outputs '("out" "debug"))
>      (synopsis "Voxel game engine")
>      (description
>       "Minetest is a voxel game engine that supports modding and game
> creation
Cheers


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [bug#74336] [PATCH v3] gnu: minetest: Update to 5.10.0.
  2024-11-13 10:33 ` [bug#74336] [PATCH] gnu: minetest: Update to 5.10.0 Parnikkapore via Guix-patches via
  2024-11-13 12:05   ` Parnikkapore via Guix-patches via
  2024-11-15 18:10   ` Liliana Marie Prikler
@ 2024-11-17  5:41   ` Parnikkapore via Guix-patches via
  2024-11-17  6:39     ` Poomklao T via Guix-patches via
  2 siblings, 1 reply; 6+ messages in thread
From: Parnikkapore via Guix-patches via @ 2024-11-17  5:41 UTC (permalink / raw)
  To: 74336
  Cc: Parnikkapore, Liliana Marie Prikler, Adam Faiz,
	宋文武

* gnu/packages/minetest.scm (minetest): Update to 5.10.0.
[source] <snippet>: Fix unbundling and unbundle catch2.
[arguments] <#:configure-flags>: Remove redundant flags.
[arguments] <#:phases>: Remove all patches no longer applicable.
[inputs]: Add catch2@3. Remove coreutils and libxxf86vm.

Change-Id: If8720bb51309d7c251e76a1885695851f3a03255
---

This patch performs additional devendoring, adds another test run by upstream's CI, and
cleans up a few more things. Thanks Liliana for the tip about scandir!

> Uhm… why does the build install to ../source? D:

The upstream build system does that, even when compiled normally. The original package
definition also used the in-tree copy, so I kept it that way.

 gnu/packages/minetest.scm | 79 ++++++++++++++++-----------------------
 1 file changed, 33 insertions(+), 46 deletions(-)

diff --git a/gnu/packages/minetest.scm b/gnu/packages/minetest.scm
index 2552596ef8..3c184028ce 100644
--- a/gnu/packages/minetest.scm
+++ b/gnu/packages/minetest.scm
@@ -28,6 +28,7 @@ (define-module (gnu packages minetest)
   #:use-module (gnu packages)
   #:use-module (gnu packages audio)
   #:use-module (gnu packages base)
+  #:use-module (gnu packages check)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages curl)
   #:use-module (gnu packages fontutils)
@@ -54,7 +55,7 @@ (define-module (gnu packages minetest)
 (define-public minetest
   (package
     (name "minetest")
-    (version "5.9.0")
+    (version "5.10.0")
     (source
      (origin
        (method git-fetch)
@@ -63,56 +64,39 @@ (define-public minetest
              (commit version)))
        (file-name (git-file-name name version))
        (sha256
-        (base32 "1h4yn4k0wpjr1h24aiqcnc9xsxgxj4bq757pla2pa9zmh2xf45kk"))
-       (modules '((guix build utils)))
-       ;; Delete bundled libraries, keep lib/sha256 because there's no good
-       ;; upstream, see:
-       ;; https://github.com/openssl/openssl/blob/master/crypto/sha/sha512.c
-       ;; "SHA512 low level APIs are deprecated for public use,
-       ;; but still ok for internal use." Also asked MT devs on IRC for this.
+        (base32 "1nsnsf1axiazb8zz51c0742kh0qx2b298pr5mr91m0l9r6dv1sdj"))
+       (modules '((guix build utils)
+                  (srfi srfi-26)
+                  (ice-9 ftw)))
+       ;; Delete bundled libraries.
+       ;; - Keep lib/sha256 because there's no good upstream, see:
+       ;;   https://github.com/openssl/openssl/blob/master/crypto/sha/sha512.c
+       ;;   "SHA512 low level APIs are deprecated for public use,
+       ;;   but still ok for internal use." Also asked MT devs on IRC for this.
+       ;; - tiniergltf is intended for Minetest and diverged from upstream.
        (snippet
-        '(begin
+        '(let ((libs-to-keep '("." ".." "sha256" "tiniergltf")))
            (with-directory-excursion "lib"
-             (for-each (lambda (file)
-                         (if (not (string=? file "sha256"))
-                             (delete-file-recursively file)))
-                       (find-files (string-append "lib") #:directories? #t)))
-           #t))))
+             (for-each delete-file-recursively
+                       (scandir "." (negate (cut member <> libs-to-keep)))))
+           ;; IrrlichtMT includes
+           (delete-file-recursively "irr/include/KHR")
+           (delete-file-recursively "irr/src/vendor")
+           (substitute* "irr/src/COpenGLCommon.h"
+             (("\"vendor/gl.h\"") "<GL/gl.h>"))
+           ;; Catch2
+           (substitute* "CMakeLists.txt"
+             (("add_subdirectory\\(lib/catch2\\)") "find_package(Catch2 3 REQUIRED)"))
+           (substitute* "src/catch.h"
+             (("catch_amalgamated.hpp") "catch2/catch_all.hpp"))))))
     (build-system cmake-build-system)
     (arguments
      (list
       #:configure-flags
       #~(list "-DENABLE_LTO=ON"
-              "-DENABLE_UPDATE_CHECKER=FALSE"
-              (string-append "-DCURL_INCLUDE_DIR="
-                             (search-input-directory
-                              %build-inputs "include/curl"))
-              (string-append "-DZSTD_INCLUDE_DIR="
-                             (dirname (search-input-file
-                                       %build-inputs
-                                       "include/zstd.h")))
-              (string-append "-DZSTD_LIBRARY="
-                             (search-input-file
-                              %build-inputs "lib/libzstd.so")))
+              "-DENABLE_UPDATE_CHECKER=FALSE")
       #:phases
       #~(modify-phases %standard-phases
-          (add-after 'unpack 'patch-sources
-            (lambda* (#:key inputs #:allow-other-keys)
-              (substitute* "src/filesys.cpp"
-                ;; Use store-path for "rm" instead of non-existing FHS path.
-                (("\"/bin/rm\"")
-                 (format #f "~s"
-                         (search-input-file inputs "bin/rm"))))
-              (substitute* "src/CMakeLists.txt"
-                ;; Let minetest binary remain in build directory.
-                (("set\\(EXECUTABLE_OUTPUT_PATH .*\\)")
-                 ""))
-              (substitute* "src/unittest/test_servermodmanager.cpp"
-                ;; do no override MINETEST_GAME_PATH
-                (("(un)?setenv\\(\"MINETEST_GAME_PATH\".*\\);")
-                 "(void)0;"))
-              (setenv "MINETEST_GAME_PATH" ;for check
-                      (string-append (getcwd) "/games"))))
           (delete 'check)
           (add-after 'install 'check
             (lambda* (#:key tests? #:allow-other-keys)
@@ -120,7 +104,10 @@ (define-public minetest
               ;; when invoked on the target outside of `guix build'.
               (when tests?
                 (setenv "HOME" "/tmp")
-                (invoke "src/minetest" "--run-unittests")))))))
+                (setenv "MINETEST_GAME_PATH"
+                        (string-append (getcwd) "/../source/games"))
+                (invoke "../source/bin/luanti" "--run-unittests")
+                (invoke "../source/util/test_multiplayer.sh")))))))
     (native-search-paths
      (list (search-path-specification
             (variable "MINETEST_GAME_PATH")
@@ -129,8 +116,8 @@ (define-public minetest
             (variable "MINETEST_MOD_PATH")
             (files '("share/minetest/mods")))))
     (native-inputs (list pkg-config))
-    (inputs (list coreutils
-                  curl
+    (inputs (list curl
+                  catch2-3
                   freetype
                   gettext-minimal
                   gmp
@@ -139,7 +126,6 @@ (define-public minetest
                   libpng
                   libogg
                   libvorbis
-                  libxxf86vm
                   libxi
                   luajit
                   mesa
@@ -147,6 +133,7 @@ (define-public minetest
                   openal
                   sqlite
                   `(,zstd "lib")))
+    (outputs '("out" "debug"))
     (synopsis "Voxel game engine")
     (description
      "Minetest is a voxel game engine that supports modding and game creation

base-commit: 0e1ffbc7f5f060f89c890472377a6102f27f6e9b
-- 
2.46.0





^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [bug#74336] [PATCH v3] gnu: minetest: Update to 5.10.0.
  2024-11-17  5:41   ` [bug#74336] [PATCH v3] " Parnikkapore via Guix-patches via
@ 2024-11-17  6:39     ` Poomklao T via Guix-patches via
  2024-11-28 10:24       ` bug#74336: " Parnikkapore via Guix-patches via
  0 siblings, 1 reply; 6+ messages in thread
From: Poomklao T via Guix-patches via @ 2024-11-17  6:39 UTC (permalink / raw)
  To: 74336

[-- Attachment #1: Type: text/plain, Size: 233 bytes --]

Forgot to say, but: The Catch2 used in Luanti is customized slightly and is intended to be built with CATCH_CONFIG_NOSTDOUT. It builds and works fine without those two, but a proper packaging may have to do it slightly differently.

[-- Attachment #2: Type: text/html, Size: 240 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#74336: [PATCH v3] gnu: minetest: Update to 5.10.0.
  2024-11-17  6:39     ` Poomklao T via Guix-patches via
@ 2024-11-28 10:24       ` Parnikkapore via Guix-patches via
  0 siblings, 0 replies; 6+ messages in thread
From: Parnikkapore via Guix-patches via @ 2024-11-28 10:24 UTC (permalink / raw)
  To: 74336-done

[-- Attachment #1: Type: text/plain, Size: 93 bytes --]

Found it merged as 79510f5e6295342f864d21b38869d215ac99a213. Thanks for the merge, Liliana!

[-- Attachment #2: Type: text/html, Size: 100 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-11-28 10:25 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <f5997e8e14f7d9232f804c785e8157e83073dc5e.1731493615.git.poomklao.ref@yahoo.com>
2024-11-13 10:33 ` [bug#74336] [PATCH] gnu: minetest: Update to 5.10.0 Parnikkapore via Guix-patches via
2024-11-13 12:05   ` Parnikkapore via Guix-patches via
2024-11-15 18:10   ` Liliana Marie Prikler
2024-11-17  5:41   ` [bug#74336] [PATCH v3] " Parnikkapore via Guix-patches via
2024-11-17  6:39     ` Poomklao T via Guix-patches via
2024-11-28 10:24       ` bug#74336: " Parnikkapore via Guix-patches via

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).