Subject: [bug#50425] [PATCH] gnu: Add minetest-advtrains.

From: Vivien Kraus <[email-masked]>
Date: Thu, 16 Sep 2021 10:36:10 +0200

Hello,

Le jeudi 16 septembre 2021 à 10:03 +0200, Xinglu Chen a écrit :
> > +This modpack contains the trains which were the \"default\" trains
> in
> > +advtrains up to version 2.2.1.")
> 
> I would use ``default'', which is the correct Texinfo syntax,
> instead of "default".  See the Texinfo manual for more details:
> https://www.gnu.org/software/texinfo/manual/texinfo/html_node/Inserting-Quotation-Marks.html
> 
You are correct, I changed it. Guix lint does not like it that much,
because it thinks it is a lazy shortcut for @code{}, but I guess guix
lint can be wrong sometimes.

> > +(define-public minetest-advtrains
> > +  (package
> > +    (name "minetest-advtrains")
> > +    (version "2.3.1")
> > +    (source
> > +     (origin
> > +       (method git-fetch)
> > +       (uri (git-reference
> > +             (url "https://git.bananach.space/advtrains.git")
> > +             (commit "release-2.3.1")))
> 
> This would preferably be (commit (string-append "release-" version)),
> that means that you only have to update the ‘version’ field and the
> hash
> when updating the package (assuming it doesn’t need additional
> dependencies or change build system, etc.).

This is a temporary fix because the contentdb importer (and future
updater) should get the commit ID from the minetest contentdb. For
minetest-advtrains, it is broken right now, so I had to guess which
commit it is, but it may be fixed soon. I added your change because it
makes more sense, but I don’t know if it will be relevant for long.

Vivien
From 4a50fc1af3698ae13e855fb859eb98455a6d29a9 Mon Sep 17 00:00:00 2001
From: Vivien Kraus <[email-masked]>
Date: Fri, 10 Sep 2021 14:21:47 +0200
Subject: [PATCH 4/4] gnu: add minetest-basic-trains

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

diff --git a/gnu/packages/minetest.scm b/gnu/packages/minetest.scm
index 1e2ee54800..7ddff52925 100644
--- a/gnu/packages/minetest.scm
+++ b/gnu/packages/minetest.scm
@@ -668,3 +668,35 @@ stopping before signals.
      (list license:cc-by-sa3.0 license:agpl3+))
     (properties
      `((upstream-name . "orwell/advtrains")))))
+
+(define-public minetest-basic-trains
+  (package
+    (name "minetest-basic-trains")
+    (version "1.0.1")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "http://git.bananach.space/basic_trains.git/")
+             (commit
+              "d44c410f7c2a7202ee68b66fc50febae89e0c5dc")))
+       (sha256
+        (base32
+         "0vvzndj48kgdz2bfgivfm217sbmc2lmxpp2mispcy7byn4i26prx"))
+       (file-name (git-file-name name version))))
+    (build-system minetest-mod-build-system)
+    (propagated-inputs
+     `(("minetest-advtrains" ,minetest-advtrains)))
+    (home-page
+     "http://advtrains.de/wiki/doku.php?id=usage:trains:basic_trains")
+    (synopsis
+     "\
+Collection of basic trains for the Advanced Trains mod")
+    (description
+     "\
+This modpack contains the trains which were the ``default'' trains in
+advtrains up to version 2.2.1.")
+    (license
+     (list license:cc-by-sa3.0 license:agpl3+))
+    (properties
+     `((upstream-name . "orwell/basic_trains")))))
-- 
2.33.0

From 556c240d5cdfc1f009c6f2e45c8a435ad1123ca8 Mon Sep 17 00:00:00 2001
From: Vivien Kraus <[email-masked]>
Date: Sun, 5 Sep 2021 15:21:35 +0200
Subject: [PATCH 3/4] gnu: add minetest-advtrains

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

diff --git a/gnu/packages/minetest.scm b/gnu/packages/minetest.scm
index 9e48d5c69c..1e2ee54800 100644
--- a/gnu/packages/minetest.scm
+++ b/gnu/packages/minetest.scm
@@ -624,3 +624,47 @@ track of important locations.")
                    license:cc-by4.0 license:cc-by-sa3.0 license:public-domain
                    license:cc0 license:fdl1.2+))
     (properties `((upstream-name . "RealBadAngel/unified_inventory")))))
+
+(define-public minetest-advtrains
+  (package
+    (name "minetest-advtrains")
+    (version "2.3.1")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://git.bananach.space/advtrains.git")
+             (commit (string-append "release-" "2.3.1"))))
+       (sha256
+        (base32 "1ijqlchh269jpvmgmdmdvy3nsnk0bszkvvcqk6vaysvxam695ggw"))
+       (file-name (git-file-name name version))))
+    (build-system minetest-mod-build-system)
+    (home-page "http://advtrains.de/")
+    (synopsis
+     "Adds good-looking, realistic trains with realistic rails")
+    (description
+     "\
+This mod features realistic trains and various equipment for railways, with a
+focus on automated train operation.  This package contains no actual trains,
+please use minetest-basic-trains.
+
+Main features:
+
+@itemize
+@item
+almost-realistic tracks with actual curves and switches;
+@item
+railway signals, controllable by various means;
+@item
+ATC: simple, command-like automatic train control;
+@item
+LuaATC: Powerful Lua-scripted automatic train operation (requires some
+programming knowledge);
+@item
+an interlocking system, featuring track sections, routes and automatic
+stopping before signals.
+@end itemize")
+    (license
+     (list license:cc-by-sa3.0 license:agpl3+))
+    (properties
+     `((upstream-name . "orwell/advtrains")))))
-- 
2.33.0

From c7ef72b8648d5800935f9b353d3c03807de08d11 Mon Sep 17 00:00:00 2001
From: Vivien Kraus <[email-masked]>
Date: Tue, 7 Sep 2021 12:28:35 +0200
Subject: [PATCH 2/4] gnu: minetest-mesecons: Fix indentation.

* gnu/packages/minetest.scm (minetest-mesecons): Fix indentation.
---
 gnu/packages/minetest.scm | 50 +++++++++++++++++++--------------------
 1 file changed, 25 insertions(+), 25 deletions(-)

diff --git a/gnu/packages/minetest.scm b/gnu/packages/minetest.scm
index 6f4682ba47..9e48d5c69c 100644
--- a/gnu/packages/minetest.scm
+++ b/gnu/packages/minetest.scm
@@ -304,37 +304,37 @@ and a variety of other stuff.")
   ;; The release on ContentDB does not have its own version number.
   (let ((commit "db5879706d04d3480bc4863ce0c03fa73e5f10c7")
         (revision "0"))
-  (package
-    (name "minetest-mesecons")
-    (version (git-version "1.2.1" revision commit))
-    (source
-     (origin
-       (method git-fetch)
-       (uri (git-reference
-             (url "https://github.com/minetest-mods/mesecons")
-             (commit commit)))
-       (sha256
-        (base32 "04m9s9l3frw1lgki41hgvjsw2zkrvfv0sy750b6j12arzb3lv645"))
-       (file-name (git-file-name name version))))
-    (build-system minetest-mod-build-system)
-    (home-page "https://mesecons.net")
-    (synopsis
-     "Digital circuitry for Minetest, including wires, buttons and lights")
-    (description
-     "Mesecons is a mod for Minetest implementing various items related
+    (package
+      (name "minetest-mesecons")
+      (version (git-version "1.2.1" revision commit))
+      (source
+       (origin
+         (method git-fetch)
+         (uri (git-reference
+               (url "https://github.com/minetest-mods/mesecons")
+               (commit commit)))
+         (sha256
+          (base32 "04m9s9l3frw1lgki41hgvjsw2zkrvfv0sy750b6j12arzb3lv645"))
+         (file-name (git-file-name name version))))
+      (build-system minetest-mod-build-system)
+      (home-page "https://mesecons.net")
+      (synopsis
+       "Digital circuitry for Minetest, including wires, buttons and lights")
+      (description
+       "Mesecons is a mod for Minetest implementing various items related
 to digital circuitry, such as wires, buttons, lights and programmable
 controllers.  Among other things, there are also pistons, solar panels,
 pressure plates and note blocks.
 
 Mesecons has a similar goal to Redstone in Minecraft, but works in its own way,
 with different rules and mechanics.")
-    ;; LGPL for code, CC-BY-SA for textures.
-    ;; The README.md and COPYING.txt disagree about the "+" in license:lgpl3+.
-    ;; For now, assume README.md is correct.  Upstream has been asked to
-    ;; correct the inconsistency:
-    ;; <https://github.com/minetest-mods/mesecons/issues/575>.
-    (license (list license:lgpl3+ license:cc-by-sa3.0))
-    (properties `((upstream-name . "Jeija/mesecons"))))))
+      ;; LGPL for code, CC-BY-SA for textures.
+      ;; The README.md and COPYING.txt disagree about the "+" in license:lgpl3+.
+      ;; For now, assume README.md is correct.  Upstream has been asked to
+      ;; correct the inconsistency:
+      ;; <https://github.com/minetest-mods/mesecons/issues/575>.
+      (license (list license:lgpl3+ license:cc-by-sa3.0))
+      (properties `((upstream-name . "Jeija/mesecons"))))))
 
 (define-public minetest-mineclone
   (package
-- 
2.33.0

From 04d842a8355b9b9dedcfc51b78c3baccdcdb1e64 Mon Sep 17 00:00:00 2001
From: Vivien Kraus <[email-masked]>
Date: Tue, 7 Sep 2021 12:27:59 +0200
Subject: [PATCH 1/4] gnu: minetest-data: Fix indentation.

* gnu/packages/minetest.scm (minetest-data): Fix indentation.
---
 gnu/packages/minetest.scm | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/gnu/packages/minetest.scm b/gnu/packages/minetest.scm
index 5453f4d16a..6f4682ba47 100644
--- a/gnu/packages/minetest.scm
+++ b/gnu/packages/minetest.scm
@@ -154,8 +154,8 @@ in different ways.")
     (source (origin
               (method git-fetch)
               (uri (git-reference
-                     (url "https://github.com/minetest/minetest_game")
-                     (commit version)))
+                    (url "https://github.com/minetest/minetest_game")
+                    (commit version)))
               (file-name (git-file-name name version))
               (sha256
                (base32
@@ -172,8 +172,8 @@ in different ways.")
                                        "/share/minetest/games/minetest_game")))
                      (mkdir-p install-dir)
                      (copy-recursively
-                       (assoc-ref %build-inputs "source")
-                       install-dir)
+                      (assoc-ref %build-inputs "source")
+                      install-dir)
                      #t))))
     (synopsis "Main game data for the Minetest game engine")
     (description
-- 
2.33.0