guix-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug#64362] [PATCH 3/3] gnu: Add mc2mt.


From: Adam Faiz
Subject: [bug#64362] [PATCH 3/3] gnu: Add mc2mt.
Date: Fri, 30 Jun 2023 17:34:13 +0800

>From 0555ce12cecf1f5244d9ca973a7686b3d9d5bc3d Mon Sep 17 00:00:00 2001
Message-Id: 
<0555ce12cecf1f5244d9ca973a7686b3d9d5bc3d.1688116740.git.adam.faiz@disroot.org>
In-Reply-To: <cover.1688116740.git.adam.faiz@disroot.org>
References: <cover.1688116740.git.adam.faiz@disroot.org>
From: AwesomeAdam54321 <adam.faiz@disroot.org>
Date: Fri, 30 Jun 2023 16:56:23 +0800
Subject: [PATCH 3/3] gnu: Add mc2mt.

* gnu/packages/game-development.scm (mc2mt): New variable.
---
 gnu/packages/game-development.scm | 68 +++++++++++++++++++++++++++++++
 1 file changed, 68 insertions(+)

diff --git a/gnu/packages/game-development.scm 
b/gnu/packages/game-development.scm
index 52f8a3787d..6a5656e3f3 100644
--- a/gnu/packages/game-development.scm
+++ b/gnu/packages/game-development.scm
@@ -56,6 +56,7 @@ (define-module (gnu packages game-development)
   #:use-module (guix utils)
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system gnu)
+  #:use-module (guix build-system pyproject)
   #:use-module (guix build-system python)
   #:use-module (guix build-system scons)
   #:use-module (gnu packages)
@@ -1744,6 +1745,73 @@ (define-public ois
     (home-page "https://github.com/wgois/OIS";)
     (license license:zlib)))
 
+(define-public mc2mt
+  (let ((commit "039dbc26466a430e03c646dc5a9bd0822637a87a")
+        (revision "0"))
+  (package
+    (name "mc2mt")
+    (version (git-version "0.1" revision commit))
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/listia/mc2mt";)
+             (commit commit)))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "1vnaznwgm87x0n5dp14363p2h54lpzalynrrd6lbs6wgrqq7fq9i"))
+       (modules '((guix build utils)))
+       (snippet
+        #~(begin
+            (copy-recursively "mc2mt.py" "mc2mtlib/mc2mt.py")
+            (substitute* "mc2mtlib/__init__.py"
+              (("from . import minetest_world" all)
+               (string-append "from . import mc2mt\n"
+                              all)))
+            (substitute* "mc2mtlib/argument_parser.py"
+              (("mineclone2") "mineclone"))
+            (substitute* "mc2mtlib/mc2mt.py"
+              (("if __name__ == '__main__':")
+               "def mc2mt():")
+              (("(from mc2mtlib import )\\*" all import)
+               (string-append
+                import "argument_parser\n"
+                import "minetest_world\n"
+                import "blob_writer\n"
+                import "block_functions\n"
+                import "block_conversion\n"
+                import "section_conversion\n\n"
+                "parse_args = argument_parser.parser.parse_args")))
+            (with-output-to-file "MANIFEST.in"
+              (lambda _
+                (format #t
+                        "\
+include mc2mtlib/mods/*.json~%")))
+            (with-output-to-file "pyproject.toml"
+              (lambda _
+                (format #t
+                        "\
+[build-system]~@
+requires = ['setuptools']~@
+build-backend = 'setuptools.build_meta'~@
+~@
+[project]~@
+name = 'mc2mt'~@
+version = '0.1'~@
+dependencies = ['anvil-parser']~@
+~@
+[project.scripts]~@
+mc2mt = 'mc2mtlib:mc2mt.mc2mt'~%")))))))
+    (build-system pyproject-build-system)
+    (propagated-inputs (list python-anvil-parser))
+    (arguments
+     (list #:tests? #f)) ; no tests
+    (synopsis "Minecraft to Minetest world converter")
+    (description "@code{mc2mt} is a Minecraft to Minetest world converter.
+It can convert worlds from Minecraft 1.9 and later.")
+    (home-page "https://github.com/listia/mc2mt";)
+    (license license:expat))))
+
 (define-public mygui
   (package
     (name "mygui")
-- 
2.40.1





reply via email to

[Prev in Thread] Current Thread [Next in Thread]