diff mbox series

[bug#72569,v2,4/4] gnu: openclonk: Use gexps and new input style.

Message ID 57db55ab-980f-3512-e46e-90e68a0dbbb9@disroot.org
State New
Headers show
Series None | expand

Commit Message

Adam Faiz Aug. 28, 2024, 3:36 p.m. UTC
From 1b08445834336938d9448a452a38c5c67742ed10 Mon Sep 17 00:00:00 2001
Message-ID: <1b08445834336938d9448a452a38c5c67742ed10.1724859175.git.adam.faiz@disroot.org>
In-Reply-To: <91bf9bff2c3c365d006a0e88024db50f416cd436.1724859175.git.adam.faiz@disroot.org>
References: <91bf9bff2c3c365d006a0e88024db50f416cd436.1724859175.git.adam.faiz@disroot.org>
From: AwesomeAdam54321 <adam.faiz@disroot.org>
Date: Sun, 11 Aug 2024 12:50:34 +0800
Subject: [PATCH v2 4/4] gnu: openclonk: Use gexps and new input style.

* gnu/packages/games.scm (openclonk)[arguments]: Use gexps.
[source]: Reindent.
[native-inputs]: Drop labels.
[inputs]: Drop labels.
---
 gnu/packages/games.scm | 177 +++++++++++++++++++++--------------------
 1 file changed, 90 insertions(+), 87 deletions(-)

Comments

Liliana Marie Prikler Aug. 31, 2024, 4:32 p.m. UTC | #1
Am Mittwoch, dem 28.08.2024 um 23:36 +0800 schrieb Adam Faiz:
> * gnu/packages/games.scm (openclonk)[arguments]: Use gexps.
> [source]: Reindent.
> [native-inputs]: Drop labels.
> [inputs]: Drop labels.
> ---
Pushed as 16ba3aceecb456c71051d3bdf12af8c001d63025, just after the big
core-updates merge.  Grab your openclonk today :3

Cheers
diff mbox series

Patch

diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
index 850d40e66f..f05be5bea2 100644
--- a/gnu/packages/games.scm
+++ b/gnu/packages/games.scm
@@ -9616,97 +9616,100 @@  (define-public openclonk
   (package
     (name "openclonk")
     (version "8.1")
-    (source (origin
-              (method url-fetch)
-              (uri (string-append
-                    "https://www.openclonk.org/builds/release/" version "/"
-                    "openclonk-" version "-src.tar.bz2"))
-              (sha256
-               (base32
-                "0imkqjp8lww5p0cnqf4k4mb2v682mnsas63qmiz17rspakr7fxik"))
-              (modules '((guix build utils)))
-              (snippet
-               #~(begin
-                   (delete-file-recursively "thirdparty")
-                   (substitute* "CMakeLists.txt"
-                     (("add_subdirectory\\(thirdparty/.*\\)") "")
-                     (("set_property\\(.*Third-party.*\\)") "")
-                     (("blake2") "b2")
-                     (("thirdparty/timsort/sort\\.h") "")
-                     (("thirdparty/pcg/.*\\.hpp") ""))
-                   (substitute* '("src/lib/C4Random.cpp"
-                                  "src/landscape/C4Particles.h")
-                     (("#include <pcg/pcg_random.hpp>")
-                      "#include <pcg_random.hpp>"))
-                   (substitute* "src/script/C4ScriptLibraries.cpp"
-                     (("blake2b.hash_output.get.., raw_output_length, data, data_length, nullptr, 0.")
-                      "blake2b(hash_output.get(), (const void*)raw_output_length, data, data_length, (size_t)(0), 0)"))
-                   (substitute* '("src/script/C4AulParse.cpp"
-                                  "src/editor/C4EditCursor.cpp"
-                                  "src/gui/C4ScriptGuiWindow.cpp")
-                     (("#include .C4Include\\.h." all)
-                      (string-append "#include <limits>\n" all)))
-                   (substitute* "src/lib/StdMesh.cpp"
-                     (("#include .timsort/sort\\.h.")
-                      "#include <sort.h>"))))))
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append
+             "https://www.openclonk.org/builds/release/" version "/"
+             "openclonk-" version "-src.tar.bz2"))
+       (sha256
+        (base32
+         "0imkqjp8lww5p0cnqf4k4mb2v682mnsas63qmiz17rspakr7fxik"))
+       (modules '((guix build utils)))
+       (snippet
+        #~(begin
+            (delete-file-recursively "thirdparty")
+            (substitute* "CMakeLists.txt"
+              (("add_subdirectory\\(thirdparty/.*\\)") "")
+              (("set_property\\(.*Third-party.*\\)") "")
+              (("blake2") "b2")
+              (("thirdparty/timsort/sort\\.h") "")
+              (("thirdparty/pcg/.*\\.hpp") ""))
+            (substitute* '("src/lib/C4Random.cpp"
+                           "src/landscape/C4Particles.h")
+              (("#include <pcg/pcg_random.hpp>")
+               "#include <pcg_random.hpp>"))
+            (substitute* "src/script/C4ScriptLibraries.cpp"
+              (("blake2b.hash_output.get.., raw_output_length, data, data_length, nullptr, 0.")
+               "blake2b(hash_output.get(), (const void*)raw_output_length, data, data_length, (size_t)(0), 0)"))
+            (substitute* '("src/script/C4AulParse.cpp"
+                           "src/editor/C4EditCursor.cpp"
+                           "src/gui/C4ScriptGuiWindow.cpp")
+              (("#include .C4Include\\.h." all)
+               (string-append "#include <limits>\n" all)))
+            (substitute* "src/lib/StdMesh.cpp"
+              (("#include .timsort/sort\\.h.")
+               "#include <sort.h>"))))))
     (build-system cmake-build-system)
     (arguments
-     `(#:configure-flags '("-DAudio_TK=OpenAL")
-       #:test-target "tests"
-       #:phases
-       (modify-phases %standard-phases
-         (add-after 'unpack 'prepare-gmock
-           (lambda* (#:key inputs #:allow-other-keys)
-             (mkdir "gmock")
-             (copy-recursively (assoc-ref inputs "googlemock") "gmock")
-             (substitute* "tests/CMakeLists.txt"
-               (("/usr/src/gmock")
-                (string-append (getcwd) "/gmock/googlemock"))
-               (("/usr/src/gtest")
-                (string-append (getcwd) "/gmock/googletest"))
-               (("PATH_SUFFIXES \"src\" \"gtest\"")
-                "PATH_SUFFIXES \"src\""))
-             #t))
-         (add-after 'prepare-gmock 'lax-freealut-requirement
-           ;; TODO: We provide freealut 1.1.0, but pkg-config somehow detects
-           ;; it as 1.0.1.  Force minimal version.
-           (lambda _
-             (substitute* "cmake/FindAudio.cmake"
-               (("freealut>=1.1.0") "freealut>=1.0.1"))
-             #t))
-         (add-after 'lax-freealut-requirement 'fix-directories
-           ;; Prefer "$out/share/openclonk" over
-           ;; "$out/share/games/openclonk". Also install "openclonk"
-           ;; binary in "bin/", not "games/".
-           (lambda _
-             (substitute* "CMakeLists.txt"
-               (("share/games/openclonk") "share/openclonk")
-               (("TARGETS openclonk DESTINATION games")
-                "TARGETS openclonk DESTINATION bin"))
-             #t)))))
+     (list
+      #:configure-flags
+      #~(list "-DAudio_TK=OpenAL")
+      #:test-target "tests"
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-after 'unpack 'prepare-gmock
+            (lambda* (#:key inputs #:allow-other-keys)
+              (let ((gmock (search-input-directory inputs "/googlemock"))
+                    (gtest (search-input-directory inputs "/googletest")))
+                (mkdir "gmock")
+                (copy-recursively gmock "gmock/googlemock")
+                (copy-recursively gtest "gmock/googletest")
+                (substitute* "tests/CMakeLists.txt"
+                  (("/usr/src/gmock")
+                   (string-append (getcwd) "/gmock/googlemock"))
+                  (("/usr/src/gtest")
+                   (string-append (getcwd) "/gmock/googletest"))
+                  (("PATH_SUFFIXES \"src\" \"gtest\"")
+                   "PATH_SUFFIXES \"src\"")))))
+          (add-after 'prepare-gmock 'lax-freealut-requirement
+            ;; TODO: We provide freealut 1.1.0, but pkg-config somehow detects
+            ;; it as 1.0.1.  Force minimal version.
+            (lambda _
+              (substitute* "cmake/FindAudio.cmake"
+                (("freealut>=1.1.0") "freealut>=1.0.1"))))
+          (add-after 'lax-freealut-requirement 'fix-directories
+            ;; Prefer "$out/share/openclonk" over
+            ;; "$out/share/games/openclonk". Also install "openclonk"
+            ;; binary in "bin/", not "games/".
+            (lambda _
+              (substitute* "CMakeLists.txt"
+                (("share/games/openclonk") "share/openclonk")
+                (("TARGETS openclonk DESTINATION games")
+                 "TARGETS openclonk DESTINATION bin")))))))
     (native-inputs
-     `(("googlemock" ,(package-source googletest))
-       ("googletest" ,googletest)
-       ("pkg-config" ,pkg-config)))
+     (list (package-source googletest)
+           googletest
+           pkg-config))
     (inputs
-     `(("c-template-sort" ,c-template-sort)
-       ("freealut" ,freealut)
-       ("freetype" ,freetype)
-       ("glew" ,glew)
-       ("libb2" ,libb2)
-       ("libjpeg" ,libjpeg-turbo)
-       ("libogg" ,libogg)
-       ("libpng" ,libpng)
-       ("libvorbis" ,libvorbis)
-       ("libxrandr" ,libxrandr)
-       ("mesa" ,mesa)
-       ("miniupnpc" ,miniupnpc)
-       ("openal" ,openal)
-       ("pcg-cpp" ,pcg-cpp)
-       ("qtbase" ,qtbase-5)
-       ("readline" ,readline)
-       ("sdl" ,sdl2)
-       ("tinyxml" ,tinyxml)))
+     (list c-template-sort
+           freealut
+           freetype
+           glew
+           libb2
+           libjpeg-turbo
+           libogg
+           libpng
+           libvorbis
+           libxrandr
+           mesa
+           miniupnpc
+           openal
+           pcg-cpp
+           qtbase-5
+           readline
+           sdl2
+           tinyxml))
     (home-page "https://www.openclonk.org/")
     (synopsis
      "Multiplayer action game where you control small and nimble humanoids")