From 8ee40a95a6ce6eb654306c0a482ed78dcf1aad21 Mon Sep 17 00:00:00 2001 From: Maxime Devos Date: Sat, 22 Jan 2022 13:40:44 +0000 Subject: [PATCH 2/3] gnu: minetest: Remove input labels. Converting the phases from a S-exp to a G-exp is strictly speaking not necessary, but it seemed nice for consistency with #:configure-flags. Likewise for the origin snippet. * gnu/packages/minetest.scm (minetest)[arguments]: Remove labels. (minetest)[source]{snippet}: Remove trailing #t and convert to G-exp. --- gnu/packages/minetest.scm | 73 +++++++++++++++++++-------------------- 1 file changed, 35 insertions(+), 38 deletions(-) diff --git a/gnu/packages/minetest.scm b/gnu/packages/minetest.scm index c6762bb1f2..c3ca443395 100644 --- a/gnu/packages/minetest.scm +++ b/gnu/packages/minetest.scm @@ -42,6 +42,7 @@ (define-module (gnu packages minetest) #:use-module (gnu packages xorg) #:use-module (guix packages) #:use-module (guix git-download) + #:use-module (guix gexp) #:use-module (guix build-system cmake) #:use-module (guix build-system copy) #:use-module (guix build-system trivial) @@ -66,48 +67,44 @@ (define-public minetest (search-patches "minetest-add-MINETEST_MOD_PATH.patch")) (snippet - '(begin - ;; Delete bundled libraries. - (delete-file-recursively "lib") - #t)))) + ;; Delete bundled libraries. + #~(delete-file-recursively "lib")))) (build-system cmake-build-system) (arguments `(#:configure-flags - (list "-DRUN_IN_PLACE=0" - "-DENABLE_FREETYPE=1" - "-DENABLE_GETTEXT=1" - "-DENABLE_SYSTEM_JSONCPP=TRUE" - (string-append "-DIRRLICHT_INCLUDE_DIR=" - (assoc-ref %build-inputs "irrlicht") - "/include/irrlicht") - (string-append "-DCURL_INCLUDE_DIR=" - (assoc-ref %build-inputs "curl") - "/include/curl")) + ,#~(let ((irrlicht #$(lookup-package-input this-package "irrlicht")) + (curl #$(lookup-package-input this-package "curl"))) + (list "-DRUN_IN_PLACE=0" + "-DENABLE_FREETYPE=1" + "-DENABLE_GETTEXT=1" + "-DENABLE_SYSTEM_JSONCPP=TRUE" + (string-append "-DIRRLICHT_INCLUDE_DIR=" irrlicht + "/include/irrlicht") + (string-append "-DCURL_INCLUDE_DIR=" curl "/include/curl"))) #: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\"") - (string-append "\"" (assoc-ref inputs "coreutils") "/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_SUBGAME_PATH - (("(un)?setenv\\(\"MINETEST_SUBGAME_PATH\".*\\);") - "(void)0;")) - (setenv "MINETEST_SUBGAME_PATH" - (string-append (getcwd) "/games")) ; for check - #t)) - (replace 'check - (lambda* (#:key tests? #:allow-other-keys) - ;; Thanks to our substitutions, the tests should also run - ;; when invoked on the target outside of `guix build'. - (when tests? - (setenv "HOME" "/tmp") - (invoke "src/minetest" "--run-unittests"))))))) + ,#~(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\"") + (string-append "\"" (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_SUBGAME_PATH + (("(un)?setenv\\(\"MINETEST_SUBGAME_PATH\".*\\);") + "(void)0;")) + (setenv "MINETEST_SUBGAME_PATH" + (string-append (getcwd) "/games")))) ; for check + (replace 'check + (lambda* (#:key tests? #:allow-other-keys) + ;; Thanks to our substitutions, the tests should also run + ;; when invoked on the target outside of `guix build'. + (when tests? + (setenv "HOME" "/tmp") + (invoke "src/minetest" "--run-unittests"))))))) (native-search-paths (append (list (search-path-specification (variable "MINETEST_SUBGAME_PATH") -- 2.34.0