# Maintainer: Antoni Aloy <aaloytorrens@gmail.com>
pkgname=edgar
pkgver=1.36
pkgrel=0
pkgdesc="2D platform game with a persistent world"
url="https://github.com/riksweeney/edgar"
arch="all"
license="GPL-2.0-or-later"
makedepends="sdl2-dev sdl2_image-dev sdl2_mixer-dev sdl2_ttf-dev gettext-dev"
depends="$pkgname-data"
subpackages="$pkgname-doc $pkgname-lang $pkgname-data::noarch"
options="!check" # No testsuite
source="https://github.com/riksweeney/edgar/releases/download/$pkgver/edgar-$pkgver-1.tar.gz
	0001-no-native-compression.patch
	0002-change-hardcoded-installation-directories.patch
	"

build() {
	# This game does not run with -Os optimizations
	unset CXXFLAGS;
	CFLAGS="$CFLAGS -O3"

	make PREFIX=/usr
}

package() {
	make DESTDIR="$pkgdir" install
}

data() {
	mkdir -p "$subpkgdir"/usr/share/edgar
	mv "$pkgdir"/usr/share/edgar/data \
		"$subpkgdir"/usr/share/edgar
}

sha512sums="
f701b15fe02b85f07ebe7474fade88de67c3bd47f2593cf8f8d9060860b3ecb931565cb24dfdf7ac332975fd6531b9790c58e1392d4663bbfd826bfb679cbf24  edgar-1.36-1.tar.gz
abbacc15cb11d847f939ecc97e17b51330d4a93ea3c877347be0cad2fb965696eb539de4d8c3b1dfd90ec9c2ba818e3e5fb38deba2f7974f18ca1b2691a031b6  0001-no-native-compression.patch
92d9484f004532aad7f475e57f0cf9c6ebd99d707548059119b2982db5c58434b76cf0115b6ffc0f232b5d9ffc858f0e5fea9a064e4202d9b58ddb82c10edb20  0002-change-hardcoded-installation-directories.patch
"
