makedeb
Desktop version of the classic falling sand physics sandbox, simulates air pressure, velocity & heat!
Click here to go back to the commit logs for powder-toy.
Hash: fc44d52bc281452d6b2ad0c697eeae639408234d
Message: v95.0
diff --git a/.SRCINFO b/.SRCINFO
index c796747..d3283b7 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
+ pkgver = 95.0
pkgrel = 1
url = http://powdertoy.co.uk/
- arch = i686
arch = x86_64
+ arch = i686
license = GPL3
- makedepends = python2
makedepends = scons
+ makedepends = libicns
+ depends = glibc
+ depends = libx11
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 = hicolor-icon-theme
+ source = powder-toy-95.0.tar.gz::http://github.com/ThePowderToy/The-Powder-Toy/archive/v95.0.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 = f60c3dc93e4ceddeda92b768e75a2d218f8df3da4a569b7d7cb57fff5515e15b
+ sha256sums = 4b75d58bfff9278bceb27fa14738e9a1abef6fe60680bb9f5eb0592f3d69a02a
+ sha256sums = b5d181c3141715b7dced8813cae6d07d2adc03bca2a7efe527592740de2d45e2
+ sha256sums = 265f530be7597fcc7bbaf2690fd517fe4f8f18372c808a90ddef49a604c8d455
+ sha256sums = 398f6d068dd37e12989f4132ea5966886b14036bac07a589991b283d242b4ca5
+ sha256sums = fcbf035d286d805dced55f147d649aa0bc74d3be873d5430de92d175d9f59431
pkgname = powder-toy
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..84863c5
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,5 @@
+/src/
+/pkg/
+/powder-toy-*.pkg.tar.*
+
+/powder-toy-*.tar.gz
diff --git a/PKGBUILD b/PKGBUILD
index b389213..91b31c2 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,77 +1,93 @@
-# Maintainer: farseerfc <farseerfc@archlinuxcn.org>
+# Maintainer: Dmytro Meleshko <dmytro.meleshko@gmail.com>
+# Contributor: 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
-
-
+# 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
+pkgver=95.0
pkgrel=1
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=('glibc' 'libx11' 'sdl2' $_lua 'fftw' 'bzip2' 'zlib' 'hicolor-icon-theme')
+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=('f60c3dc93e4ceddeda92b768e75a2d218f8df3da4a569b7d7cb57fff5515e15b'
+ '4b75d58bfff9278bceb27fa14738e9a1abef6fe60680bb9f5eb0592f3d69a02a'
+ 'b5d181c3141715b7dced8813cae6d07d2adc03bca2a7efe527592740de2d45e2'
+ '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 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..9a5630e
--- /dev/null
+++ b/powder-toy.patch
@@ -0,0 +1,24 @@
+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..db640fb
--- /dev/null
+++ b/powder-toy.sh
@@ -0,0 +1,9 @@
+#!/usr/bin/env sh
+set -eu
+
+pkgname=powder-toy
+data_home="${XDG_DATA_HOME:-${HOME}/.local/share}/${pkgname}"
+
+mkdir -p "${data_home}"
+cd "${data_home}"
+exec "/usr/lib/${pkgname}/${pkgname}" "$@"