# Maintainer: Antoni Aloy <aaloytorrens@gmail.com>
pkgname=lpairs2
pkgver=2.3.1
pkgrel=0
pkgdesc="Classical memory game"
url="https://lgames.sourceforge.io/LPairs/"
arch="all"
license="GPL-2.0-or-later"
depends="$pkgname-data"
makedepends="sdl2-dev sdl2_image-dev sdl2_mixer-dev sdl2_ttf-dev"
subpackages="$pkgname-data::noarch"
source="https://downloads.sourceforge.net/project/lgames/lpairs/lpairs2-$pkgver.tar.gz
	fix-undeclared-uint.patch
	"

prepare() {
	default_prepare
	update_config_guess
	update_config_sub
	chmod +x install-sh
}

build() {
	LIBS="-lintl" \
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--sysconfdir=/etc \
		--prefix=/usr
	make
}

check() {
	make check
}

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

data() {
	pkgdesc="$pkgdesc (data files)"
	amove usr/share/lpairs2
}

sha512sums="
499eec1e7446f91852d68fde3e931c810b9c0d84b79ae7f8d8c8468de272ca107945da10e66190788cca9422bbe4894f0a2bf3f0305a0819662b504a256e5b11  lpairs2-2.3.1.tar.gz
4de6934a7840153354f54c5c6a9c14d22e3d5a76030cd33131c2511d97c363d73912d53d3581fd756ff42dec9c7d4e819056e5a2eee5d92064a88a9337abe5eb  fix-undeclared-uint.patch
"
