guix-commits
[Top][All Lists]
Advanced

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

05/05: gnu: the-powder-toy: Enable building on more architectures.


From: guix-commits
Subject: 05/05: gnu: the-powder-toy: Enable building on more architectures.
Date: Tue, 26 Nov 2024 04:16:18 -0500 (EST)

efraim pushed a commit to branch master
in repository guix.

commit 5ff9e51e2c4dae0dc74f5c85ec553e89fe1824fd
Author: Efraim Flashner <efraim@flashner.co.il>
AuthorDate: Tue Nov 26 10:44:33 2024 +0200

    gnu: the-powder-toy: Enable building on more architectures.
    
    * gnu/packages/games.scm (the-powder-toy)[source]: Add a snippet to
    identify more machines as 64-bit.
    [arguments]: Add configure-flags when building with lua.  Add a phase to
    correctly use lua when necessary.
    [inputs]: Build with luajit or lua-5.2 depending on platform support.
    
    Change-Id: I7c1fda2d45f3e6c74475e33ec2a23f9accd6964f
---
 gnu/packages/games.scm | 42 +++++++++++++++++++++++++++++++-----------
 1 file changed, 31 insertions(+), 11 deletions(-)

diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
index 44dff4fe54..6d29f7ac00 100644
--- a/gnu/packages/games.scm
+++ b/gnu/packages/games.scm
@@ -8175,15 +8175,31 @@ elements to achieve a simple goal in the most complex 
way possible.")
              (commit (string-append "v" version))))
        (file-name (git-file-name name version))
        (sha256
-        (base32 "06l39w3ggrzn8799dqll606by4f88kjr60r879w8j26csx1py76g"))))
+        (base32 "06l39w3ggrzn8799dqll606by4f88kjr60r879w8j26csx1py76g"))
+       (snippet
+        #~(begin (use-modules (guix build utils))
+                 (substitute* "meson.build"
+                   (("'aarch64', 'x86_64'")
+                    (string-append "'aarch64', 'loongarch64', 'mips64', 
'ppc64', "
+                                   "'riscv64', 'sparc64', 'x86_64'")))))))
     (build-system meson-build-system)
     (arguments
      `(#:configure-flags (list (string-append
                                 "-Dworkaround_elusive_bzip2_include_dir="
-                                (assoc-ref %build-inputs "bzip2")))
-       ;; No install target
+                                (assoc-ref %build-inputs "bzip2"))
+                               ,@(if (this-package-input "lua")
+                                     `("-Dlua=lua-5.2"
+                                       "-Dworkaround_noncpp_lua=true")
+                                     '()))
        #:phases
        (modify-phases %standard-phases
+         ;; Our lua variants are named lua-<version>, not lua<version>.
+         (add-after 'unpack 'adjust-lua-variant-names
+           (lambda _
+             (substitute* '("meson.build"
+                            "meson_options.txt")
+               (("lua5\\.") "lua-5."))))
+         ;; No install target
          (replace 'install
            (lambda _
              (let* ((output (assoc-ref %outputs "out"))
@@ -8205,14 +8221,18 @@ elements to achieve a simple goal in the most complex 
way possible.")
                                 (string-append dir "/powdertoy-powder.png"))))
                  '("16" "32" "48"))))))))
     (native-inputs (list pkg-config))
-    (inputs (list bzip2
-                  curl
-                  fftwf
-                  jsoncpp
-                  libpng
-                  luajit
-                  sdl2
-                  zlib))
+    (inputs
+     (append
+       (list bzip2
+             curl
+             fftwf
+             jsoncpp
+             libpng)
+       (if (supported-package? luajit)
+           (list luajit)
+           (list lua-5.2))
+       (list sdl2
+             zlib)))
     (synopsis "Free physics sandbox game")
     (description
      "The Powder Toy is a free physics sandbox game, which simulates air



reply via email to

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