# Template file for 'The-Powder-Toy'
pkgname=The-Powder-Toy
version=96.2.350
revision=1
build_style=meson
configure_args="-Dx86_sse=sse2 -Dworkaround_gcc_no_pie=false
 -Dlua=$(vopt_if luajit luajit lua5.1)"
hostmakedepends="pkg-config"
makedepends="SDL2-devel fftw-devel zlib-devel libcurl-devel
 $(vopt_if luajit LuaJIT-devel lua51-devel)"
short_desc="Falling sand physics sandbox, simulates air pressure, velocity & heat"
maintainer="0x5c <dev@0x5c.io>"
license="GPL-3.0-or-later"
homepage="https://powdertoy.co.uk/"
distfiles="https://github.com/The-Powder-Toy/${pkgname}/archive/v${version}.tar.gz"
checksum=d95cbadee22632687661e8fc488bd64405d81c0dca737e16420f26e93ea5bf58

build_options="luajit"

if [ "$XBPS_WORDSIZE" = "$XBPS_TARGET_WORDSIZE" ] ; then
	build_options_default="luajit"
fi

do_install() {
	vbin build/powder
	vdoc README.md
	vinstall resources/powder.desktop 644 /usr/share/applications/
	for size in 16 24 32 48 128 256 ; do
		vinstall resources/icon/powder-${size}.png 644 /usr/share/icons/hicolor/${size}x${size}/apps powder.png
	done
}
