aboutsummaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authorEfraim Flashner <efraim@flashner.co.il>2024-11-26 10:44:33 +0200
committerEfraim Flashner <efraim@flashner.co.il>2024-11-26 11:12:25 +0200
commit5ff9e51e2c4dae0dc74f5c85ec553e89fe1824fd (patch)
treea3d61bc0244c923ce89e441af49101c010233f1e /gnu
parent276744f3d6a8a8d1a6227f393db5794616ec4b86 (diff)
downloadguix-5ff9e51e2c4dae0dc74f5c85ec553e89fe1824fd.tar.gz
guix-5ff9e51e2c4dae0dc74f5c85ec553e89fe1824fd.zip
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
Diffstat (limited to 'gnu')
-rw-r--r--gnu/packages/games.scm42
1 files 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