# Contributor: Thomas Kienlen <kommander@laposte.net>
# Maintainer: Thomas Kienlen <kommander@laposte.net>
pkgname=tuxpaint
pkgver=0.9.32
pkgrel=1
pkgdesc="Drawing program designed for young children"
# useless on s390x
arch="all !s390x"
url="https://tuxpaint.org/"
license="GPL-2.0-or-later"
depends="
	hicolor-icon-theme
	xdg-utils
	"
makedepends="
	gperf
	imagemagick
	libimagequant-dev
	libpaper-dev
	librsvg-dev
	sdl2-dev
	sdl2_gfx-dev
	sdl2_image-dev
	sdl2_mixer-dev
	sdl2_pango-dev
	sdl2_ttf-dev
	"
subpackages="$pkgname-doc $pkgname-lang"
source="$pkgname-$pkgver.tar.gz::https://sourceforge.net/projects/tuxpaint/files/tuxpaint/$pkgver/tuxpaint-$pkgver.tar.gz/download"
options="!check" # no test suite

prepare() {
	default_prepare

	# Set fullscreen native resolution by default
	sed -i \
		-e 's/# fullscreen=.*/fullscreen=yes/' \
		-e 's/# native=.*/native=yes/' \
		src/tuxpaint.conf
}

build() {
	make -j1 \
		CFLAGS="$CFLAGS $(pkg-config --cflags pango) -D_POSIX_PRIORITY_SCHEDULING -Wno-implicit-function-declaration" \
		PREFIX=/usr
}

package() {
	make -j1 \
		PREFIX=/usr \
		GNOME_PREFIX=/usr \
		X11_ICON_PREFIX="$pkgdir"/usr/share/pixmaps \
		DESTDIR="$pkgdir" \
		install

	install -Dm644 src/$pkgname.desktop \
		"$pkgdir"/usr/share/applications/$pkgname.desktop
}

sha512sums="
3fc3225d97a7a7f5c9b450323f5f236ee69c572993d56e0483cf4854f63ee5fa301fd391333eba494c379c0926688d2c1d3080ad0ab22d93e1dc3188c1441cd7  tuxpaint-0.9.32.tar.gz
"
