summaryrefslogtreecommitdiff
path: root/tw/packages/games.scm
diff options
context:
space:
mode:
authorTimo Wilken2023-04-15 16:12:04 +0200
committerTimo Wilken2023-04-15 16:12:04 +0200
commit774171594a5c357069e49a77aff5a74dede0cbe7 (patch)
treebc5398c976ace0b4ad4fb7f6cdcde33e184dc94b /tw/packages/games.scm
parent4f39ce4f2791e70c43b4fbd96491cbd2f7ea3d55 (diff)
Package Powder Toy
Diffstat (limited to 'tw/packages/games.scm')
-rw-r--r--tw/packages/games.scm69
1 files changed, 69 insertions, 0 deletions
diff --git a/tw/packages/games.scm b/tw/packages/games.scm
index 98c18ff4..46b88006 100644
--- a/tw/packages/games.scm
+++ b/tw/packages/games.scm
@@ -1,10 +1,13 @@
(define-module (tw packages games)
#:use-module ((srfi srfi-26) #:select (cut))
#:use-module ((ice-9 string-fun) #:select (string-replace-substring))
+ #:use-module (gnu packages algebra)
#:use-module (gnu packages audio)
#:use-module (gnu packages base)
#:use-module (gnu packages bash)
+ #:use-module (gnu packages build-tools)
#:use-module (gnu packages compression)
+ #:use-module (gnu packages curl)
#:use-module (gnu packages elf)
#:use-module (gnu packages fonts)
#:use-module (gnu packages fontutils)
@@ -16,14 +19,18 @@
#:use-module (gnu packages guile)
#:use-module (gnu packages image)
#:use-module (gnu packages linux)
+ #:use-module (gnu packages lua)
#:use-module (gnu packages pkg-config)
#:use-module (gnu packages pulseaudio)
#:use-module (gnu packages sdl)
+ #:use-module (gnu packages serialization)
#:use-module (gnu packages textutils)
+ #:use-module (gnu packages tls)
#:use-module (gnu packages xorg)
#:use-module (guix build utils)
#:use-module (guix build-system copy)
#:use-module (guix build-system gnu)
+ #:use-module (guix build-system meson)
#:use-module (guix build-system trivial)
#:use-module (guix download)
#:use-module (guix gexp)
@@ -330,3 +337,65 @@ its @samp{settings.cfg}). This means that the game will not run properly from
(license:non-copyleft
"file://LegalNotice.txt"
"Contains components licensed under various permissive licenses.")))))
+
+
+;; Powder Toy
+
+(define-public powder-toy
+ (package
+ (name "powder-toy")
+ (version "97.0.352")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append
+ "https://github.com/The-Powder-Toy/The-Powder-Toy/archive/refs/tags/v"
+ version ".tar.gz"))
+ (sha256 (base32 "0yi8ip6632yh9y9c80ghvnhir65yslm26q9f6jkivnw4k8dpxcis"))))
+ (build-system meson-build-system)
+ (arguments `(#:meson ,meson-0.63 ; Powder Toy explicitly requires meson>=0.61.0
+ #:configure-flags
+ ,#~(list "-Dstatic=none"
+ (string-append "-Dworkaround_elusive_bzip2_include_dir="
+ #$(file-append bzip2 "/include")))
+ #:phases
+ (modify-phases %standard-phases
+ ;; For some reason, ninja doesn't install the final binary properly.
+ (replace 'install
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let ((out (assoc-ref outputs "out")))
+ (install-file "powder" (string-append out "/bin"))
+ (rename-file "resources/appdata.xml" "resources/powder.appdata.xml")
+ (install-file "resources/powder.appdata.xml" (string-append out "/share/metainfo"))
+ (install-file "resources/powder.desktop" (string-append out "/share/applications"))
+ (copy-file (string-append "../The-Powder-Toy-" ,version "/resources/powder.man")
+ "resources/powder.6")
+ (install-file "resources/powder.6" (string-append out "/share/man/man6")))))
+ (add-after 'install 'compress-documentation
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (invoke (string-append (assoc-ref inputs "gzip") "/bin/gzip")
+ (string-append (assoc-ref outputs "out") "/share/man/man6/powder.6")))))))
+ ;; Guix' luajit works with lua-5.1.
+ (inputs (list bzip2 fftwf jsoncpp curl libpng lua-5.1 luajit sdl2 zlib))
+ (native-inputs (list pkg-config gzip))
+ (home-page "https://powdertoy.co.uk/")
+ (synopsis "A desktop version of the classic 'falling sand' physics sandbox")
+ (description "Have you ever wanted to blow something up? Or maybe you
+always dreamt of operating an atomic power plant? Do you have a will to
+develop your own CPU? The Powder Toy lets you to do all of these, and even
+more!
+
+The Powder Toy is a free physics sandbox game, which simulates air pressure
+and velocity, heat, gravity and a countless number of interactions between
+different substances! The game provides you with various building materials,
+liquids, gases and electronic components which can be used to construct
+complex machines, guns, bombs, realistic terrains and almost anything else.
+You can then mine them and watch cool explosions, add intricate wirings, play
+with little stickmen or operate your machine. You can browse and play
+thousands of different saves made by the community or upload your own – we
+welcome your creations!
+
+There is a Lua API – you can automate your work or even make plugins for the
+game. The Powder Toy is free and the source code is distributed under the GNU
+General Public License, so you can modify the game yourself or help with
+development.")
+ (license license:gpl3)))