all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Timotej Lazar <timotej.lazar@araneo.si>
To: 70106@debbugs.gnu.org
Cc: "Timotej Lazar" <timotej.lazar@araneo.si>,
	"Adam Faiz" <adam.faiz@disroot.org>,
	"Liliana Marie Prikler" <liliana.prikler@gmail.com>,
	宋文武 <iyzsong@envs.net>
Subject: [bug#70106] [PATCH] gnu: Add the-powder-toy.
Date: Sun, 31 Mar 2024 16:15:13 +0200	[thread overview]
Message-ID: <e6d963ade854ebb91cc8a7f5adaf94b891dd5b3a.1711894513.git.timotej.lazar@araneo.si> (raw)

* gnu/packages/games.scm (the-powder-toy): New variable.

Change-Id: I4c11fa48ef2b92222029e082d472c8157eb1f25f
---
This adds the Powder Toy 2D physics simulation game. Most of the package
deals with installing resources because the install target doesn’t. The
desktop and related files seem to function OK after installation.

Thanks!

 gnu/packages/games.scm | 82 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 82 insertions(+)

diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
index 223449af17..02c1b9df96 100644
--- a/gnu/packages/games.scm
+++ b/gnu/packages/games.scm
@@ -165,6 +165,7 @@ (define-module (gnu packages games)
   #:use-module (gnu packages icu4c)
   #:use-module (gnu packages image)
   #:use-module (gnu packages imagemagick)
+  #:use-module (gnu packages inkscape)
   #:use-module (gnu packages javascript)
   #:use-module (gnu packages less)
   #:use-module (gnu packages lesstif)
@@ -7895,6 +7896,87 @@ (define-public the-butterfly-effect
     (license (list license:gpl2 license:public-domain license:expat
                    license:cc-by-sa3.0 license:gpl3+ license:wtfpl2))))
 
+(define-public the-powder-toy
+  (package
+    (name "the-powder-toy")
+    (version "98.0.363")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/The-Powder-Toy/The-Powder-Toy")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "01phwjv9wj28fs87h6m3fzhsjldp87j5h3zajamlrvf28ck34gwm"))))
+    (build-system meson-build-system)
+    (arguments
+     (list #:configure-flags
+           #~(list "-Dcan_install=no" ; don’t set up file associations at runtime
+                   "-Dignore_updates=true" ; don’t notify about updates
+                   "-Drender_icons_with_inkscape=enabled" ; regenerate icons during build
+                   (string-append"-Dworkaround_elusive_bzip2_lib_dir="
+                                 #$(this-package-input "bzip2") "/lib")
+                   (string-append"-Dworkaround_elusive_bzip2_include_dir="
+                                 #$(this-package-input "bzip2") "/include"))
+           #:phases
+           #~(modify-phases %standard-phases
+               (add-after 'unpack 'fix-xdg-open-path
+                 (lambda* (#:key inputs #:allow-other-keys)
+                   (substitute* "src/common/platform/Linux.cpp"
+                     (("xdg-open") (search-input-file inputs "bin/xdg-open")))))
+               (add-after 'install 'install-resources
+                 (lambda _
+                   (let* ((app-id "uk.co.powdertoy.tpt")
+                          (mimetype "application-vnd.powdertoy.save")
+                          (share (string-append #$output "/share"))
+                          (icons (string-append share "/icons/hicolor"))
+                          (icons/png (string-append icons "/256x256"))
+                          (icons/svg (string-append icons "/scalable"))
+                          (apps (string-append share "/applications"))
+                          (man (string-append share "/man/man6"))
+                          (metainfo (string-append share "/metainfo"))
+                          (mime (string-append share "/mime/packages")))
+                     ;; SVG icons.
+                     (mkdir-p (string-append icons/svg "/apps"))
+                     (mkdir-p (string-append icons/svg "/mimetypes"))
+                     (copy-file "../source/resources/icon_exe.svg"
+                                (string-append icons/svg "/apps/powdertoy-powder.svg"))
+                     (copy-file "../source/resources/icon_cps.svg"
+                                (string-append icons/svg "/mimetypes/" mimetype ".svg"))
+                     ;; PNG icons.
+                     (mkdir-p (string-append icons/png "/apps"))
+                     (mkdir-p (string-append icons/png "/mimetypes"))
+                     (copy-file "resources/icon_exe.png"
+                                (string-append icons/png "/apps/powdertoy-powder.png"))
+                     (copy-file "resources/icon_cps.png"
+                                (string-append icons/png "/mimetypes/" mimetype ".png"))
+                     ;; Resources.
+                     (for-each mkdir-p (list man apps metainfo mime))
+                     (copy-file "../source/resources/powder.man"
+                                (string-append man "/powder.6"))
+                     (copy-file "resources/powder.desktop"
+                                (string-append apps "/" app-id ".desktop"))
+                     (copy-file "resources/appdata.xml"
+                                (string-append metainfo "/" app-id ".appdata.xml"))
+                     (copy-file "../source/resources/save.xml"
+                                (string-append mime "/powdertoy-save.xml"))))))))
+    (inputs
+     (list bzip2 curl fftwf jsoncpp libpng luajit sdl2 xdg-utils zlib))
+    (native-inputs
+     (list inkscape pkg-config))
+    (home-page "https://powdertoy.co.uk")
+    (synopsis "2D physics sandbox game")
+    (description
+     "The Powder Toy simulates air pressure and velocity, heat, gravity and a
+countless number of interactions between different substances.  The game
+provides various building materials, liquids, gases and electronic components
+used to construct complex machines, realistic terrains and almost anything
+else.  Scripting and plugins are supported through a Lua API.")
+    (license (list license:asl2.0 ; src/bson
+                   license:expat ; src/lua/LuaBit.*
+                   license:gpl3+))))
+
 (define-public pioneer
   (package
     (name "pioneer")

base-commit: d747d9e2dd273ce90a441d0e4428d15a8286e465
-- 
2.41.0





                 reply	other threads:[~2024-03-31 14:26 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e6d963ade854ebb91cc8a7f5adaf94b891dd5b3a.1711894513.git.timotej.lazar@araneo.si \
    --to=timotej.lazar@araneo.si \
    --cc=70106@debbugs.gnu.org \
    --cc=adam.faiz@disroot.org \
    --cc=iyzsong@envs.net \
    --cc=liliana.prikler@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.