Package Details: powder-toy 97.0.352-2

Git Clone URL: https://aur.archlinux.org/powder-toy.git (read-only, click to copy)
Package Base: powder-toy
Description: Desktop version of the classic falling sand physics sandbox, simulates air pressure, velocity & heat!
Upstream URL: https://powdertoy.co.uk/
Licenses: GPL3
Submitter: farseerfc
Maintainer: dmitmel
Last Packager: dmitmel
Votes: 47
Popularity: 0.108120
First Submitted: 2015-08-10 10:26 (UTC)
Last Updated: 2023-12-13 20:26 (UTC)

Latest Comments

1 2 Next › Last »

simona commented on 2023-12-13 23:42 (UTC)

perfect. thx.

dmitmel commented on 2023-12-13 20:27 (UTC)

Alfred456654, simona: somehow missed your comments, sorry, pushed an update which includes a patch for this error.

simona commented on 2023-12-13 18:15 (UTC)

same like me

Alfred456654 commented on 2023-08-02 13:21 (UTC)

I can't build anymore...

==> Starting build()...
  -> building powder-toy with the following extra flags: -Dignore_updates=true -Dinstall_check=false -Dapp_exe=powder-toy -Dapp_id=uk.co.powdertoy.tpt -Dapp_vendor=powdertoy -Dlua=luajit -Dx86_sse=sse3
+ exec meson setup --prefix /usr --libexecdir lib --sbindir bin --buildtype plain --auto-features enabled --wrap-mode nodownload -D b_lto=true -D b_pie=true -D python.bytecompile=1 --buildtype=release build -Dignore_updates=true -Dinstall_check=false -Dapp_exe=powder-toy -Dapp_id=uk.co.powdertoy.tpt -Dapp_vendor=powdertoy -Dlua=luajit -Dx86_sse=sse3
Directory already configured.

Just run your build command (e.g. ninja) and Meson will regenerate as necessary.
If ninja fails, run "ninja reconfigure" or "meson setup --reconfigure"
to force Meson to regenerate.

If build failures persist, run "meson setup --wipe" to rebuild from scratch
using the same options as passed when configuring the build.
To change option values, run "meson configure" instead.
INFO: autodetecting backend as ninja
INFO: calculating backend command to run: /usr/bin/ninja -C /tmp/trizen-giraudan/powder-toy/src/The-Powder-Toy-97.0.352/build
ninja: Entering directory `/tmp/trizen-giraudan/powder-toy/src/The-Powder-Toy-97.0.352/build'
[7/279] Compiling C++ object powder-toy.p/src_graphics_FontReader.cpp.o
FAILED: powder-toy.p/src_graphics_FontReader.cpp.o 
c++ -Ipowder-toy.p -I. -I.. -Isrc -I../src -Iresources -I../resources -Isrc/config/powder -I../src/config/powder -I/usr/include -I/usr/include/libpng16 -I/usr/include/SDL2 -I/usr/include/luajit-2.1 -flto=auto -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -std=c++17 -fno-rtti -O3 -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -Wp,-D_GLIBCXX_ASSERTIONS -fPIE -D_REENTRANT -pthread -msse3 -ftree-vectorize -funsafe-math-optimizations -ffast-math -fomit-frame-pointer -Wno-invalid-offsetof -Wno-unused-result -Wno-missing-field-initializers -Wno-unused-parameter -MD -MQ powder-toy.p/src_graphics_FontReader.cpp.o -MF powder-toy.p/src_graphics_FontReader.cpp.o.d -o powder-toy.p/src_graphics_FontReader.cpp.o -c ../src/graphics/FontReader.cpp
../src/graphics/FontReader.cpp: In function ‘bool InitFontData()’:
../src/graphics/FontReader.cpp:40:52: error: ‘uint32_t’ does not name a type
   40 |                 auto codePoint = *reinterpret_cast<uint32_t *>(ptr) & 0xFFFFFFU;
      |                                                    ^~~~~~~~
../src/graphics/FontReader.cpp:5:1: note: ‘uint32_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
    4 | #include "font.bz2.h"
  +++ |+#include <cstdint>
    5 | 
../src/graphics/FontReader.cpp:40:61: error: expected ‘>’ before ‘*’ token
   40 |                 auto codePoint = *reinterpret_cast<uint32_t *>(ptr) & 0xFFFFFFU;
      |                                                             ^
../src/graphics/FontReader.cpp:40:61: error: expected ‘(’ before ‘*’ token
   40 |                 auto codePoint = *reinterpret_cast<uint32_t *>(ptr) & 0xFFFFFFU;
      |                                                             ^
      |                                                             (
../src/graphics/FontReader.cpp:40:62: error: expected primary-expression before ‘>’ token
   40 |                 auto codePoint = *reinterpret_cast<uint32_t *>(ptr) & 0xFFFFFFU;
      |                                                              ^
../src/graphics/FontReader.cpp:40:80: error: expected ‘)’ before ‘;’ token
   40 |                 auto codePoint = *reinterpret_cast<uint32_t *>(ptr) & 0xFFFFFFU;
      |                                                                                ^
      |                                                                                )
../src/graphics/FontReader.cpp:45:48: error: ‘uint8_t’ does not name a type
   45 |                 auto width = *reinterpret_cast<uint8_t *>(ptr + 3);
      |                                                ^~~~~~~
../src/graphics/FontReader.cpp:45:48: note: ‘uint8_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
../src/graphics/FontReader.cpp:45:56: error: expected ‘>’ before ‘*’ token
   45 |                 auto width = *reinterpret_cast<uint8_t *>(ptr + 3);
      |                                                        ^
../src/graphics/FontReader.cpp:45:56: error: expected ‘(’ before ‘*’ token
   45 |                 auto width = *reinterpret_cast<uint8_t *>(ptr + 3);
      |                                                        ^
      |                                                        (
../src/graphics/FontReader.cpp:45:57: error: expected primary-expression before ‘>’ token
   45 |                 auto width = *reinterpret_cast<uint8_t *>(ptr + 3);
      |                                                         ^
../src/graphics/FontReader.cpp:45:67: error: expected ‘)’ before ‘;’ token
   45 |                 auto width = *reinterpret_cast<uint8_t *>(ptr + 3);
      |                                                                   ^
      |                                                                   )
[28/279] Compiling C++ object powder-toy.p/src_gui_interface_Label.cpp.o
ninja: build stopped: subcommand failed.
==> ERROR: A failure occurred in build().
    Aborting...
:: Unable to build powder-toy - makepkg exited with code: 4

dmitmel commented on 2021-07-04 07:23 (UTC)

I have uploaded the beta version 96.0.346 to powder-toy-beta and snapshots are, as usual, in powder-toy-snapshot.

JP-Ellis commented on 2020-08-11 05:31 (UTC)

@dmitmel It appears this package may have been abandoned. It was flagged out of date over 3 months ago and still haven't been updated. You should request to orphan it so you can adopt it and become the new maintainer.

dmitmel commented on 2019-10-06 06:45 (UTC) (edited on 2019-10-06 09:09 (UTC) by dmitmel)

Hi! I've rewritten the PKGBUILD. This is what I've done:

  1. Removed obsolete code
    • NATIVE_OPTIMIZATIONS - SConscrpit works fine if -march=native is present in /etc/makepkg.conf
    • scons options --save-version, --minor-version, --build-number - they're already included in the upstream src/Config.h
  2. Added a variable ($_lua) to choose the Lua version.
  3. Used as much metafiles from upstream as possible
    • .desktop files were extracted from the installation routine (Client::DoInstallation() in src/client/Client.cpp), although had to be modified a bit so I moved them in the AUR package directory
    • different sizes of application icons are now installed from the upstream
    • also I extract document icons from the .icns file at build time and install them as well
    • misc files like MIME data files and AppStream appdata are installed too
  4. Added a wrapper script which runs Powder Toy inside a data directory located at $XDG_DATA_HOME/powder-toy
  5. Rewritten the code according to the modern ArchWiki recommendations

Here is the patch:

diff --git a/.SRCINFO b/.SRCINFO
index c796747..14d5290 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,24 +1,33 @@
 pkgbase = powder-toy
    pkgdesc = Desktop version of the classic falling sand physics sandbox, simulates air pressure, velocity & heat!
    pkgver = 94.1
-   pkgrel = 1
+   pkgrel = 2
    url = http://powdertoy.co.uk/
-   arch = i686
    arch = x86_64
+   arch = i686
    license = GPL3
-   makedepends = python2
    makedepends = scons
+   makedepends = libicns
    depends = sdl2
-   depends = lua52
+   depends = luajit
    depends = fftw
    depends = bzip2
    depends = zlib
-   source = powder-toy-94.1-340.tar.gz::http://github.com/ThePowderToy/The-Powder-Toy/archive/v94.1.tar.gz
+   depends = desktop-file-utils
+   depends = hicolor-icon-theme
+   depends = shared-mime-info
+   source = powder-toy-94.1.tar.gz::http://github.com/ThePowderToy/The-Powder-Toy/archive/v94.1.tar.gz
+   source = powder-toy.patch
+   source = powder-toy.sh
    source = powder-toy.desktop
-   source = powder-toy.png
-   md5sums = 7e55a347df49c5df23dc977fb719c208
-   md5sums = e223e1d622f11c03af26ba3e60c7d500
-   md5sums = bb40bf9c2fa3982e2872b5d32de3b006
+   source = powder-toy-open.desktop
+   source = powder-toy-ptsave.desktop
+   sha256sums = 9770c0732c97e4e89a1e53330c969e9675595f78e6673c519c3724d6df591e72
+   sha256sums = fc3ce245ce37dea006aa84e93ab9df7dbe398a5dd6669f2cd5f1638691c8b84e
+   sha256sums = 694cf4c9cb85b47d9b777b9a9b23ca44b8ce3c9539515eb495ee2a056e3f9756
+   sha256sums = 265f530be7597fcc7bbaf2690fd517fe4f8f18372c808a90ddef49a604c8d455
+   sha256sums = 398f6d068dd37e12989f4132ea5966886b14036bac07a589991b283d242b4ca5
+   sha256sums = fcbf035d286d805dced55f147d649aa0bc74d3be873d5430de92d175d9f59431

 pkgname = powder-toy

diff --git a/PKGBUILD b/PKGBUILD
index b389213..d5f7aff 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,77 +1,94 @@
 # Maintainer: farseerfc <farseerfc@archlinuxcn.org>
-# Contributor: refujee     <gmail.com: refujee>
-# Contributor: sausageandeggs  <archlinux.us: sausageandeggs>
-# Contributor: Jesse Jaara <gmail.com: jesse.jaara>
-
-# Set to 'y' if you want native optimizations (-march=native)
-# based on your hardware. Enabled automatically if -march
-# is set to native in makepkg.conf.
-NATIVE_OPTIMIZATIONS=n
-
+# Contributor: Dmytro Meleshko <dmytro.meleshko@gmail.com>
+# Contributor: refujee <gmail.com: refujee>
+# Contributor: sausageandeggs <archlinux.us: sausageandeggs>
+# Contributor: Jesse Jaara <gmail.com: jesse.jaara>

+# Select version of Lua. Possible values are luajit, lua51, lua52 and an empty
+# string to disable Lua support. luajit is used in the official builds.
+_lua=luajit

 pkgname=powder-toy
-#pkgver=${_sver}.${_mver}
 pkgver=94.1
-_sver=${pkgver/.*/}
-_mver=${pkgver/*./}
-_build=340
-pkgrel=1
+pkgrel=2
 pkgdesc="Desktop version of the classic falling sand physics sandbox, simulates air pressure, velocity & heat!"
-arch=(i686 x86_64)
-depends=('sdl2' 'lua52' 'fftw' 'bzip2' 'zlib')
-makedepends=('python2' 'scons')
+arch=(x86_64 i686)
+depends=('sdl2' $_lua 'fftw' 'bzip2' 'zlib' 'desktop-file-utils' 'hicolor-icon-theme' 'shared-mime-info')
+makedepends=('scons' 'libicns')
 url="http://powdertoy.co.uk/"
 license=('GPL3')
-source=("${pkgname}-${pkgver}-${_build}.tar.gz::http://github.com/ThePowderToy/The-Powder-Toy/archive/v${pkgver}.tar.gz"
-   ${pkgname}.desktop ${pkgname}.png)
+source=("${pkgname}-${pkgver}.tar.gz::http://github.com/ThePowderToy/The-Powder-Toy/archive/v${pkgver}.tar.gz"
+        ${pkgname}.patch
+        ${pkgname}.sh
+        ${pkgname}.desktop
+        ${pkgname}-open.desktop
+        ${pkgname}-ptsave.desktop)
+sha256sums=('9770c0732c97e4e89a1e53330c969e9675595f78e6673c519c3724d6df591e72'
+            'fc3ce245ce37dea006aa84e93ab9df7dbe398a5dd6669f2cd5f1638691c8b84e'
+            '694cf4c9cb85b47d9b777b9a9b23ca44b8ce3c9539515eb495ee2a056e3f9756'
+            '265f530be7597fcc7bbaf2690fd517fe4f8f18372c808a90ddef49a604c8d455'
+            '398f6d068dd37e12989f4132ea5966886b14036bac07a589991b283d242b4ca5'
+            'fcbf035d286d805dced55f147d649aa0bc74d3be873d5430de92d175d9f59431')

 prepare() {
-  cd "${srcdir}/The-Powder-Toy-${pkgver}"
-
-  #Disable the updates. I cant get the buildsystem to not compile a beta version.
-  #Also I do not know the logic behind the generated snapshotids.
-  sed 's|//#define I|#define I|' -i src/Config.h
-
-  sed "s|Version=.*|Version=$pkgver|" -i ../${pkgname}.desktop
+  cd "The-Powder-Toy-${pkgver}"
+  patch --forward --strip=1 --input="${srcdir}/${pkgname}.patch"
 }

 build() {
-  unset _xarch _ssever _native
-  cd "${srcdir}/The-Powder-Toy-${pkgver}"
+  cd "The-Powder-Toy-${pkgver}"

-  if $(grep -q 'pni' -i /proc/cpuinfo); then
-    _ssever="sse3"
-  elif $(grep -q sse2 -i /proc/cpuinfo); then
-    _ssever="sse2"
-  elif $(grep -q sse -i /proc/cpuinfo); then
-    _ssever="sse"
-  else
-    _ssever="no-sse"
-  fi
+  # extract document icons from macOS .icns files
+  cd "$resources"
+  icns2png -x resources/document.icns

-#  if [ NATIVE_OPTIMIZATIONS == "y"  ] || $(echo ${CXXFLAGS} | grep -q -- "-march=native"); then
-#    _native="--native"
-#  fi
+  local extra_flags=()

-  if [ "${CARCH}" == "x86_64" ]; then
-    _xarch="--64bit"
+  case "$CARCH" in
+    x86_64) extra_flags+=(--64bit) ;;
+      i686) extra_flags+=(--32bit) ;;
+  esac
+
+  if   grep -q -i pni  /proc/cpuinfo; then
+    extra_flags+=(--sse3)
+  elif grep -q -i sse2 /proc/cpuinfo; then
+    extra_flags+=(--sse2)
+  elif grep -q -i sse  /proc/cpuinfo; then
+    extra_flags+=(--sse)
+  else
+    extra_flags+=(--no-sse)
   fi

-  msg2 "building powder with options with following extra flags ${_xarch} --${_ssever} ${_native}"
-  scons --lin ${_xarch} --release --${_ssever} ${_native} --save-version=${_sver} \
-   --minor-version=${_mver} --build-number=${_build} ${MAKEFLAGS} \
-    --lua52
+  case "$_lua" in
+    luajit) extra_flags+=(--luajit) ;;
+     lua51)                         ;; # lua51 support is enabled by default
+     lua52) extra_flags+=(--lua52)  ;;
+        "") extra_flags+=(--nolua)  ;;
+  esac

-  mv build/{powder*,binary}
+  msg2 "building ${pkgname} with the following extra flags: ${extra_flags[*]}"
+  scons --lin --release --output="${pkgname}" ${MAKEFLAGS} "${extra_flags[@]}"
 }

 package() {
-  install -Dm 755 "${srcdir}/The-Powder-Toy-${pkgver}/build/binary" "${pkgdir}/usr/bin/powder-toy"
-  install -Dm 644 "${srcdir}/${pkgname}.desktop" "${pkgdir}/usr/share/applications/${pkgname}.desktop"
-  install -Dm 644 "${srcdir}/${pkgname}.png" "${pkgdir}/usr/share/pixmaps/${pkgname}.png"
-}
+  install -Dm755 "${pkgname}.sh" "${pkgdir}/usr/bin/${pkgname}"
+  install -Dm644 "${pkgname}.desktop" "${pkgdir}/usr/share/applications/${pkgname}.desktop"
+  install -Dm644 "${pkgname}-open.desktop" "${pkgdir}/usr/share/applications/${pkgname}-open.desktop"
+  install -Dm644 "${pkgname}-ptsave.desktop" "${pkgdir}/usr/share/applications/${pkgname}-ptsave.desktop"

-md5sums=('7e55a347df49c5df23dc977fb719c208'
-         'e223e1d622f11c03af26ba3e60c7d500'
-         'bb40bf9c2fa3982e2872b5d32de3b006')
+  cd "The-Powder-Toy-${pkgver}"
+
+  install -Dm755 "build/${pkgname}" "${pkgdir}/usr/lib/${pkgname}/${pkgname}"
+  install -Dm644 "resources/powdertoy-save.xml" "${pkgdir}/usr/share/mime/packages/${pkgname}-save.xml"
+  install -Dm644 "resources/powder.appdata.xml" "${pkgdir}/usr/share/metainfo/${pkgname}.appdata.xml"
+
+  local icon_size
+  for icon_size in 16 24 32 48 128 256; do
+    install -Dm644 "resources/icon/powder-${icon_size}.png" \
+      "${pkgdir}/usr/share/icons/hicolor/${icon_size}x${icon_size}/apps/${pkgname}.png"
+  done
+  for icon_size in 16 32 128 256 512; do
+    install -Dm644 "resources/document_${icon_size}x${icon_size}x32.png" \
+      "${pkgdir}/usr/share/icons/hicolor/${icon_size}x${icon_size}/mimetypes/application-vnd.${pkgname}.save.png"
+  done
+}
diff --git a/powder-toy-open.desktop b/powder-toy-open.desktop
new file mode 100644
index 0000000..715a38e
--- /dev/null
+++ b/powder-toy-open.desktop
@@ -0,0 +1,12 @@
+[Desktop Entry]
+Type=Application
+Version=1.0
+Name=Powder Toy
+NoDisplay=true
+Comment=Physics sandbox game
+Icon=powder-toy
+Exec=powder-toy open %f
+Terminal=false
+MimeType=application/vnd.powder-toy.save;
+Categories=Game;Simulation;
+StartupNotify=false
diff --git a/powder-toy-ptsave.desktop b/powder-toy-ptsave.desktop
new file mode 100644
index 0000000..bf90bb5
--- /dev/null
+++ b/powder-toy-ptsave.desktop
@@ -0,0 +1,12 @@
+[Desktop Entry]
+Type=Application
+Version=1.0
+Name=Powder Toy
+NoDisplay=true
+Comment=Physics sandbox game
+Icon=powder-toy
+Exec=powder-toy ptsave %u
+Terminal=false
+MimeType=x-scheme-handler/ptsave;
+Categories=Game;Simulation;
+StartupNotify=false
diff --git a/powder-toy.desktop b/powder-toy.desktop
index 0350a06..5aa0180 100644
--- a/powder-toy.desktop
+++ b/powder-toy.desktop
@@ -1,12 +1,10 @@
-
 [Desktop Entry]
 Type=Application
-Version=94.1
-Encoding=UTF-8
+Version=1.0
 Name=Powder Toy
-Comment=A physics simulation game.
-Exec=powder-toy
+Comment=Physics sandbox game
 Icon=powder-toy
+Exec=powder-toy
 Terminal=false
+Categories=Game;Simulation;
 StartupNotify=false
-Categories=Game;
diff --git a/powder-toy.patch b/powder-toy.patch
new file mode 100644
index 0000000..7ccb251
--- /dev/null
+++ b/powder-toy.patch
@@ -0,0 +1,35 @@
+diff --unified --recursive --text --color The-Powder-Toy-94.1.orig/resources/powder.appdata.xml The-Powder-Toy-94.1/resources/powder.appdata.xml
+--- The-Powder-Toy-94.1.orig/resources/powder.appdata.xml  2019-02-21 07:23:45.000000000 +0200
++++ The-Powder-Toy-94.1/resources/powder.appdata.xml   2019-10-06 00:21:18.550019454 +0300
+@@ -1,6 +1,6 @@
+ <?xml version="1.0" encoding="UTF-8"?>
+ <component type="desktop">
+-  <id>powder.desktop</id>
++  <id>powder-toy.desktop</id>
+   <metadata_license>CC0-1.0</metadata_license>
+   <project_license>GPL-3.0</project_license>
+   <name>Powder Toy</name>
+diff --unified --recursive --text --color The-Powder-Toy-94.1.orig/resources/powdertoy-save.xml The-Powder-Toy-94.1/resources/powdertoy-save.xml
+--- The-Powder-Toy-94.1.orig/resources/powdertoy-save.xml  2019-02-21 07:23:45.000000000 +0200
++++ The-Powder-Toy-94.1/resources/powdertoy-save.xml   2019-10-06 00:21:51.080019592 +0300
+@@ -1,6 +1,6 @@
+ <?xml version="1.0"?>
+ <mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>
+-  <mime-type type="application/vnd.powdertoy.save">
++  <mime-type type="application/vnd.powder-toy.save">
+       <comment>Powder Toy save</comment>
+       <glob pattern="*.cps"/>
+       <glob pattern="*.stm"/>
+diff --unified --recursive --text --color The-Powder-Toy-94.1.orig/src/Config.h The-Powder-Toy-94.1/src/Config.h
+--- The-Powder-Toy-94.1.orig/src/Config.h  2019-02-21 07:23:45.000000000 +0200
++++ The-Powder-Toy-94.1/src/Config.h   2019-10-06 01:33:00.610003177 +0300
+@@ -40,7 +40,8 @@
+ #endif
+ //VersionInfoEnd
+
+-//#define IGNORE_UPDATES //uncomment this for mods, to not get any update notifications
++#define IGNORE_UPDATES
++#define NO_INSTALL_CHECK
+
+ #if !(defined(MACOSX) && defined(DEBUG))
+ #define HIGH_QUALITY_RESAMPLE         //High quality image resampling, slower but much higher quality than my terribad linear interpolation
diff --git a/powder-toy.png b/powder-toy.png
deleted file mode 100644
index 02ebd59..0000000
Binary files a/powder-toy.png and /dev/null differ
diff --git a/powder-toy.sh b/powder-toy.sh
new file mode 100755
index 0000000..50f4c68
--- /dev/null
+++ b/powder-toy.sh
@@ -0,0 +1,5 @@
+#!/bin/sh
+pkgname=powder-toy
+data_home="${XDG_DATA_HOME:-${HOME}/.local/share}/${pkgname}"
+mkdir -p "${data_home}" && cd "${data_home}" || exit 1
+exec "/usr/lib/${pkgname}/${pkgname}" "$@"

Also, I'm not sure if I have to post this kind of comment here. Should I send patches to maintainer's email?

jadenPete commented on 2019-02-28 04:26 (UTC) (edited on 2019-02-28 04:27 (UTC) by jadenPete)

Please change "Exec=/usr/bin/powder-toy" to "Exec=powder-toy"

It doesn't allow for wrapper scripts

MarcinWieczorek commented on 2018-07-26 12:09 (UTC)

Hello, please rename the tarball so it doesn't cause conflicts for common source directories. Thank you.

eisterman commented on 2018-04-23 09:16 (UTC)

Change PKGBUILD version to 93.3 Change the first MD5 to 16c5751f9b9c7a6283f423365fe73b1a (The-Powder-Toy-93.3.tar.gz)

Do this changes in your PKGBUILD for updating the software