From a30e5b1ecb652534392ada264c47c4f543fa56dd Mon Sep 17 00:00:00 2001 From: Vivien Kraus Date: Sun, 29 May 2022 13:37:27 +0200 Subject: [PATCH v1 1/8] gnu: minetest: Update to 5.5.1. * gnu/local.mk (dist_patch_DATA): Remove minetest-add-MINETEST_MOD_PATH.patch. * gnu/packages/patches/minetest-add-MINETEST_MOD_PATH.patch: Delete it. * gnu/packages/minetest.scm (irrlichtmt): New variable. (minetest): Update to 5.5.1. [patches]: Remove patch. [configure-flags]: find irrlichtmt and zstd. [inputs]: Replace irrlicht with irrlichtmt, add zstd. (minetest-data): Update hash. --- gnu/local.mk | 1 - gnu/packages/minetest.scm | 55 ++++-- .../minetest-add-MINETEST_MOD_PATH.patch | 156 ------------------ 3 files changed, 44 insertions(+), 168 deletions(-) delete mode 100644 gnu/packages/patches/minetest-add-MINETEST_MOD_PATH.patch diff --git a/gnu/local.mk b/gnu/local.mk index bc82c5ba9f..df5916ce70 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1488,7 +1488,6 @@ dist_patch_DATA = \ %D%/packages/patches/mesa-skip-tests.patch \ %D%/packages/patches/meson-allow-dirs-outside-of-prefix.patch \ %D%/packages/patches/mhash-keygen-test-segfault.patch \ - %D%/packages/patches/minetest-add-MINETEST_MOD_PATH.patch \ %D%/packages/patches/mingw-w64-6.0.0-gcc.patch \ %D%/packages/patches/mingw-w64-dlltool-temp-prefix.patch \ %D%/packages/patches/mingw-w64-reproducible-gendef.patch \ diff --git a/gnu/packages/minetest.scm b/gnu/packages/minetest.scm index c431942473..559d513407 100644 --- a/gnu/packages/minetest.scm +++ b/gnu/packages/minetest.scm @@ -26,6 +26,7 @@ (define-module (gnu packages minetest) #:use-module (gnu packages) #:use-module (gnu packages audio) #:use-module (gnu packages base) + #:use-module (gnu packages compression) #:use-module (gnu packages curl) #:use-module (gnu packages fontutils) #:use-module (gnu packages games) @@ -48,10 +49,38 @@ (define-module (gnu packages minetest) #:use-module (guix build-system minetest) #:use-module ((guix licenses) #:prefix license:)) +(define-public irrlichtmt + ;; irrlichtmt and minetest evolve together. This may not be the latest + ;; release, but that’s the version that was released when minetest was + ;; released. + (package + (inherit irrlicht) + (name "irrlichtmt") + (version "1.9.0mt5") + (source + (origin + (inherit (package-source irrlicht)) + (method git-fetch) + (uri (git-reference + (url "https://github.com/minetest/irrlicht") + (commit version))) + (sha256 + (base32 + "1jxk1x0f60n8lrz8a6x62aj2pqg0qnbajsld3lqncvwsfbi0xjx1")) + (patches '()) + (snippet '(begin #t)))) + (build-system cmake-build-system) + (arguments + `(#:tests? #f)) + (description + "This is a fork of irrlicht tailored for minetest.") + (home-page + "https://github.com/minetest/irrlicht"))) + (define-public minetest (package (name "minetest") - (version "5.4.1") + (version "5.5.1") (source (origin (method git-fetch) (uri (git-reference @@ -60,11 +89,8 @@ (define-public minetest (file-name (git-file-name name version)) (sha256 (base32 - "062ilb7s377q3hwfhl8q06vvcw2raydz5ljzlzwy2dmyzmdcndb8")) + "042v71gkk0xfixcsn82az2fri0n28fgf9d2zcz31bijqmg5q7imj")) (modules '((guix build utils))) - (patches - (search-patches - "minetest-add-MINETEST_MOD_PATH.patch")) (snippet '(begin ;; Delete bundled libraries. @@ -77,12 +103,18 @@ (define-public minetest "-DENABLE_FREETYPE=1" "-DENABLE_GETTEXT=1" "-DENABLE_SYSTEM_JSONCPP=TRUE" - (string-append "-DIRRLICHT_INCLUDE_DIR=" - (assoc-ref %build-inputs "irrlicht") + (string-append "-DIRRLICHTMT_INCLUDE_DIR=" + (assoc-ref %build-inputs "irrlichtmt") "/include/irrlicht") (string-append "-DCURL_INCLUDE_DIR=" (assoc-ref %build-inputs "curl") - "/include/curl")) + "/include/curl") + (string-append "-DZSTD_INCLUDE_DIR=" + (assoc-ref %build-inputs "zstd") + "/include/zstd") + (string-append "-DZSTD_LIBRARY=" + (assoc-ref %build-inputs "zstd") + "/lib/libzstd.so")) #:phases (modify-phases %standard-phases (add-after 'unpack 'patch-sources @@ -123,7 +155,7 @@ (define-public minetest ("freetype" ,freetype) ("gettext" ,gettext-minimal) ("gmp" ,gmp) - ("irrlicht" ,irrlicht) + ("irrlichtmt" ,irrlichtmt) ("jsoncpp" ,jsoncpp) ("libjpeg" ,libjpeg-turbo) ("libpng" ,libpng) @@ -134,7 +166,8 @@ (define-public minetest ("mesa" ,mesa) ("ncurses" ,ncurses) ("openal" ,openal) - ("sqlite" ,sqlite))) + ("sqlite" ,sqlite) + ("zstd" ,zstd "lib"))) (propagated-inputs (list minetest-data)) (synopsis "Infinite-world block sandbox game") @@ -159,7 +192,7 @@ (define minetest-data (file-name (git-file-name name version)) (sha256 (base32 - "0i45lbnikvgj9kxdp0yphpjjwjcgp4ibn49xkj78j5ic1s9n8jd4")))) + "12cpaiww148szvnrc8r8cffwvl33smnrl7k29sh401yv0pbqi3j8")))) (build-system trivial-build-system) (native-inputs `(("source" ,source))) diff --git a/gnu/packages/patches/minetest-add-MINETEST_MOD_PATH.patch b/gnu/packages/patches/minetest-add-MINETEST_MOD_PATH.patch deleted file mode 100644 index 41338e6e6f..0000000000 --- a/gnu/packages/patches/minetest-add-MINETEST_MOD_PATH.patch +++ /dev/null @@ -1,156 +0,0 @@ -From d10ea2ad7efc2364a8a2007b4c6d3e85511e2f84 Mon Sep 17 00:00:00 2001 -From: Maxime Devos -Date: Tue, 3 Aug 2021 01:00:23 +0200 -Subject: [PATCH] Add environment variable MINETEST_MOD_PATH - -This adds an environment variable MINETEST_MOD_PATH. -When it exists, Minetest will look there for mods -in addition to ~/.minetest/mods/. Mods can still be -installed to ~/.minetest/mods/ with the built-in installer. - -With thanks to Liliana Marie Prikler. ---- - builtin/mainmenu/pkgmgr.lua | 7 +++---- - doc/menu_lua_api.txt | 8 +++++++- - src/content/subgames.cpp | 11 +++++++++++ - src/script/lua_api/l_mainmenu.cpp | 23 +++++++++++++++++++++++ - src/script/lua_api/l_mainmenu.h | 2 ++ - 5 files changed, 46 insertions(+), 5 deletions(-) - -diff --git a/builtin/mainmenu/pkgmgr.lua b/builtin/mainmenu/pkgmgr.lua -index 787936e31..d8fba0ebe 100644 ---- a/builtin/mainmenu/pkgmgr.lua -+++ b/builtin/mainmenu/pkgmgr.lua -@@ -682,10 +682,9 @@ function pkgmgr.preparemodlist(data) - local game_mods = {} - - --read global mods -- local modpath = core.get_modpath() -- -- if modpath ~= nil and -- modpath ~= "" then -+ local modpaths = core.get_modpaths() -+ --XXX what was ‘modpath ~= ""’ and ‘modpath ~= nil’ for? -+ for _,modpath in ipairs(modpaths) do - get_mods(modpath,global_mods) - end - -diff --git a/doc/menu_lua_api.txt b/doc/menu_lua_api.txt -index b3975bc1d..132444b14 100644 ---- a/doc/menu_lua_api.txt -+++ b/doc/menu_lua_api.txt -@@ -218,7 +218,13 @@ Package - content which is downloadable from the content db, may or may not be i - * returns path to global user data, - the directory that contains user-provided mods, worlds, games, and texture packs. - * core.get_modpath() (possible in async calls) -- * returns path to global modpath -+ * returns path to global modpath, where mods can be installed -+* core.get_modpaths() (possible in async calls) -+ * returns list of paths to global modpaths, where mods have been installed -+ -+ The difference with "core.get_modpath" is that no mods should be installed in these -+ directories by Minetest -- they might be read-only. -+ - * core.get_clientmodpath() (possible in async calls) - * returns path to global client-side modpath - * core.get_gamepath() (possible in async calls) -diff --git a/src/content/subgames.cpp b/src/content/subgames.cpp -index e9dc609b0..d73f95a1f 100644 ---- a/src/content/subgames.cpp -+++ b/src/content/subgames.cpp -@@ -61,6 +61,12 @@ std::string getSubgamePathEnv() - return subgame_path ? std::string(subgame_path) : ""; - } - -+std::string getModPathEnv() -+{ -+ char *mod_path = getenv("MINETEST_MOD_PATH"); -+ return mod_path ? std::string(mod_path) : ""; -+} -+ - SubgameSpec findSubgame(const std::string &id) - { - if (id.empty()) -@@ -110,6 +116,11 @@ SubgameSpec findSubgame(const std::string &id) - std::set mods_paths; - if (!user_game) - mods_paths.insert(share + DIR_DELIM + "mods"); -+ -+ Strfnd mod_search_paths(getModPathEnv()); -+ while (!mod_search_paths.at_end()) -+ mods_paths.insert(mod_search_paths.next(PATH_DELIM)); -+ - if (user != share || user_game) - mods_paths.insert(user + DIR_DELIM + "mods"); - -diff --git a/src/script/lua_api/l_mainmenu.cpp b/src/script/lua_api/l_mainmenu.cpp -index 3e9709bde..903ac3a22 100644 ---- a/src/script/lua_api/l_mainmenu.cpp -+++ b/src/script/lua_api/l_mainmenu.cpp -@@ -21,6 +21,7 @@ with this program; if not, write to the Free Software Foundation, Inc., - #include "lua_api/l_internal.h" - #include "common/c_content.h" - #include "cpp_api/s_async.h" -+#include "util/strfnd.h" - #include "gui/guiEngine.h" - #include "gui/guiMainMenu.h" - #include "gui/guiKeyChangeMenu.h" -@@ -502,6 +503,26 @@ int ModApiMainMenu::l_get_modpath(lua_State *L) - return 1; - } - -+/******************************************************************************/ -+int ModApiMainMenu::l_get_modpaths(lua_State *L) -+{ -+ const char *c_modpath = getenv("MINETEST_MOD_PATH"); -+ if (c_modpath == NULL) -+ c_modpath = ""; -+ int index = 1; -+ lua_newtable(L); -+ Strfnd mod_search_paths{std::string(c_modpath)}; -+ while (!mod_search_paths.at_end()) { -+ std::string component = mod_search_paths.next(PATH_DELIM); -+ lua_pushstring(L, component.c_str()); -+ lua_rawseti(L, -2, index); -+ index++; -+ } -+ ModApiMainMenu::l_get_modpath(L); -+ lua_rawseti(L, -2, index); -+ return 1; -+} -+ - /******************************************************************************/ - int ModApiMainMenu::l_get_clientmodpath(lua_State *L) - { -@@ -949,6 +970,7 @@ void ModApiMainMenu::Initialize(lua_State *L, int top) - API_FCT(get_mapgen_names); - API_FCT(get_user_path); - API_FCT(get_modpath); -+ API_FCT(get_modpaths); - API_FCT(get_clientmodpath); - API_FCT(get_gamepath); - API_FCT(get_texturepath); -@@ -983,6 +1005,7 @@ void ModApiMainMenu::InitializeAsync(lua_State *L, int top) - API_FCT(get_mapgen_names); - API_FCT(get_user_path); - API_FCT(get_modpath); -+ API_FCT(get_modpaths); - API_FCT(get_clientmodpath); - API_FCT(get_gamepath); - API_FCT(get_texturepath); -diff --git a/src/script/lua_api/l_mainmenu.h b/src/script/lua_api/l_mainmenu.h -index 33ac9e721..a6a54a2cb 100644 ---- a/src/script/lua_api/l_mainmenu.h -+++ b/src/script/lua_api/l_mainmenu.h -@@ -112,6 +112,8 @@ class ModApiMainMenu: public ModApiBase - - static int l_get_modpath(lua_State *L); - -+ static int l_get_modpaths(lua_State *L); -+ - static int l_get_clientmodpath(lua_State *L); - - static int l_get_gamepath(lua_State *L); --- -2.32.0 - base-commit: e640da33f3f142f24af8c63b6e1350865096bae1 prerequisite-patch-id: 3c9c32657ad1068f7311b03b26dfb65c5f6db8e1 prerequisite-patch-id: 1f9c4dbe552048db79d69804d330fe39bf6755a0 prerequisite-patch-id: 5e408465a1d766662ee1c33a4b807a779a4c664b prerequisite-patch-id: eb8a798c6dc097419cb5bdf51641e3169e681e2e prerequisite-patch-id: ea2b7638049e23e80fe2716e78900ea14cf922cd prerequisite-patch-id: ca6164abf3d0287d49f726b3ae92b75ef94a8103 prerequisite-patch-id: 3265f90d5769feeed4b62de20c4f69c5a5e7a81d prerequisite-patch-id: f85ec750b9f798b9e41bb00d7edb82d421353b33 prerequisite-patch-id: 6b60605cbf22b6ad4eff2f0da74a74c30fe2a9c8 prerequisite-patch-id: d6051ad60e172c8f11ef40772e502d86f4333acb prerequisite-patch-id: 1dbff988e2360cb1ee029f64f300ce44c11d76e9 prerequisite-patch-id: 66ad9148ea45252dbef3037bd7a50a4ec32e2b5b prerequisite-patch-id: 0c3aa04452a6a1d3f56951aa177a174a032ff299 prerequisite-patch-id: 42948a36a16f9824c17b8e7b7294ea33e81eb238 prerequisite-patch-id: b1b2b2215d1a71bfac6239766067c34cfbb70ebb prerequisite-patch-id: 91f834615aed988f8f2d9b1655721debd65e0cdf prerequisite-patch-id: 4a5b6330f14470cc7688ba1ffabd38414d3d9860 prerequisite-patch-id: 49c8b136f2165e7fc1d5d6b137f7773836e83a6d prerequisite-patch-id: 4551ff825ddc78669180eaa1826e8b581e2726f7 prerequisite-patch-id: 0c89c6e62602aded309ea47143fea68aed8c1617 prerequisite-patch-id: 4ad64d116fb8674505d7411a296137046096c60c prerequisite-patch-id: 9939453dfc6bcac6f98aafdf60812b2bf884fb3a prerequisite-patch-id: 8c206238029371a28c49cd914d7aae780114b10c prerequisite-patch-id: f95b376c7e13855b8d3784a6cefc4800b945d502 prerequisite-patch-id: 8bf19e17210e0d93cd99a1c4a736e05d9f9df3bb prerequisite-patch-id: d9bc7451845593d839c8921801d3db8ab58f14ad prerequisite-patch-id: 836dc57a4ee4aa788d05eed45b3804c139e4f995 prerequisite-patch-id: 0b4c563142f8f5ae6ca10e34b814266310be2686 -- 2.36.1