Subject: bug#50677: [PATCH] Minetest basic_materials really depends on moreores

From: Vivien Kraus <[email-masked]>
Date: Wed, 22 Sep 2021 20:04:40 +0200

Le mercredi 22 septembre 2021 à 19:41 +0200, Maxime Devos a écrit :
> It would be more convenient
> if the output of Minetest was send to current-output-port,
OK, so it’s like the existing solution, except it should not stop just
at the first error.
From ed878447d600aabdfd80073dab4fdb77cef3801d Mon Sep 17 00:00:00 2001
From: Vivien Kraus <[email-masked]>
Date: Sun, 19 Sep 2021 17:00:45 +0200
Subject: [PATCH 4/4] gnu: minetest-basic-materials: Depend on
 minetest-moreores.

* minetest.scm (minetest-basic-materials): Add minetest-moreores as a propagated input.
---
 gnu/packages/minetest.scm | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/gnu/packages/minetest.scm b/gnu/packages/minetest.scm
index 0730de7351..189889f890 100644
--- a/gnu/packages/minetest.scm
+++ b/gnu/packages/minetest.scm
@@ -221,6 +221,10 @@ numeric identifier TOPIC-ID on the official Minetest forums."
         (base32 "0v6l3lrjgshy4sccjhfhmfxc3gk0cdy73qb02i9wd2vw506v5asx"))
        (file-name (git-file-name name version))))
     (build-system minetest-mod-build-system)
+    (propagated-inputs
+     ;; basic_materials:silver_wire cannot be crafted without
+     ;; moreores:silver_ingot.
+     `(("minetest-moreores" ,minetest-moreores)))
     (home-page (minetest-topic 21000))
     (synopsis "Some \"basic\" materials and items for other Minetest mods to use")
     (description
-- 
2.33.0

From f018ebee7972f49bfd6c3012d822432f9d97b767 Mon Sep 17 00:00:00 2001
From: Vivien Kraus <[email-masked]>
Date: Sun, 19 Sep 2021 16:58:53 +0200
Subject: [PATCH 3/4] gnu: Add minetest-moreores.

* gnu/packages/minetest.scm (minetest-moreores): New variable.
---
 gnu/packages/minetest.scm | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/gnu/packages/minetest.scm b/gnu/packages/minetest.scm
index fd1439d4d2..0730de7351 100644
--- a/gnu/packages/minetest.scm
+++ b/gnu/packages/minetest.scm
@@ -187,6 +187,25 @@ numeric identifier TOPIC-ID on the official Minetest forums."
   (string-append "https://forum.minetest.net/viewtopic.php?t="
                  (number->string topic-id)))
 
+(define-public minetest-moreores
+  (package
+    (name "minetest-moreores")
+    (version "2.1.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/minetest-mods/moreores")
+             (commit "0b6f669df4c9b7771c03e0e6ba8effb471cdfcae")))
+       (sha256 (base32 "1chfqbc6bb27aacjc67j5l5wcdvmcsvk2rfmangipd7nwini3y34"))
+       (file-name (git-file-name name version))))
+    (build-system minetest-mod-build-system)
+    (home-page (minetest-topic 549))
+    (synopsis "Adds new ore types")
+    (description "More ores for Minetest.")
+    (license license:zlib)
+    (properties `((upstream-name . "Calinou/moreores")))))
+
 (define-public minetest-basic-materials
   (package
     (name "minetest-basic-materials")
-- 
2.33.0

From 9b6a7751a3240e6363b231a50f6795aaf0433f76 Mon Sep 17 00:00:00 2001
From: Vivien Kraus <[email-masked]>
Date: Sun, 19 Sep 2021 22:42:49 +0200
Subject: [PATCH 2/4] guix: minetest-build-system: Also install config.txt and
 _config.txt

* minetest-build-system.scm (mod-install-plan): Add config.txt and _config.txt to the list of installed files.
---
 guix/build/minetest-build-system.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/guix/build/minetest-build-system.scm b/guix/build/minetest-build-system.scm
index c14c6d1fcc..5f68686067 100644
--- a/guix/build/minetest-build-system.scm
+++ b/guix/build/minetest-build-system.scm
@@ -41,7 +41,7 @@
      ;; See <https://github.com/minetest/minetest/blob/master/doc/lua_api.txt>
      ;; for an incomple list of files that can be found in mods.
      #:include ("mod.conf" "modpack.conf" "settingtypes.txt" "depends.txt"
-                "description.txt")
+                "description.txt" "config.txt" "_config.txt")
      #:include-regexp (".lua$" ".png$" ".ogg$" ".obj$" ".b3d$" ".tr$"
                        ".mts$"))))
 
-- 
2.33.0

From f1eec756c9b35442f7f2730585eb671e57ddb50c Mon Sep 17 00:00:00 2001
From: Vivien Kraus <[email-masked]>
Date: Sun, 19 Sep 2021 20:03:10 +0200
Subject: [PATCH 1/4] guix: minetest-build-system: Gather the whole output when
 a test fails

* minetest-build-system.scm (check): Gather the whole output when a test fails.
---
 guix/build/minetest-build-system.scm | 23 ++++++++++++++---------
 1 file changed, 14 insertions(+), 9 deletions(-)

diff --git a/guix/build/minetest-build-system.scm b/guix/build/minetest-build-system.scm
index 477cc3d1d0..c14c6d1fcc 100644
--- a/guix/build/minetest-build-system.scm
+++ b/guix/build/minetest-build-system.scm
@@ -23,6 +23,7 @@
   #:use-module (ice-9 rdelim)
   #:use-module (ice-9 receive)
   #:use-module (ice-9 regex)
+  #:use-module (ice-9 exceptions)
   #:use-module ((guix build gnu-build-system) #:prefix gnu:)
   #:use-module ((guix build copy-build-system) #:prefix copy:)
   #:export (%standard-phases
@@ -199,20 +200,24 @@ auth_backend = sqlite3
         (define (stop? line)
           (and (string? line)
                (string-contains line "ACTION[Server]: singleplayer [127.0.0.1] joins game.")))
-        (let loop ()
-          (match (read-line port)
-            ((? error? line)
-             (error "minetest raised an error: ~a" line))
-            ((? stop?)
+        (let loop ((has-errors? #f))
+          (match `(,(read-line port) ,has-errors?)
+            (((? error? line) _)
+             (display line)
+             (newline)
+             (loop #t))
+            (((? stop?) #f)
              (kill pid SIGINT)
              (close-port port)
              (waitpid pid))
-            ((? string? line)
+            (((? eof-object?) #f)
+             (error "minetest didn't start"))
+            (((or (? stop?) (? eof-object?)) #t)
+             (error "minetest raised an error"))
+            (((? string? line) has-error?)
              (display line)
              (newline)
-             (loop))
-            ((? eof-object?)
-             (error "minetest didn't start"))))))))
+             (loop has-error?))))))))
 
 (define %standard-phases
   (modify-phases gnu:%standard-phases
-- 
2.33.0