# Maintainer: Antoni Aloy <aaloytorrens@gmail.com>
pkgname=lbreakouthd
pkgver=1.1.9
pkgrel=0
pkgdesc="Ball-and-paddle game (LBreakout2 successor)"
url="https://lgames.sourceforge.io/LBreakoutHD/"
arch="all"
license="GPL-2.0-or-later"
depends="$pkgname-data"
makedepends="
	gettext-dev
	sdl2-dev
	sdl2_image-dev
	sdl2_mixer-dev
	sdl2_ttf-dev
	"
subpackages="$pkgname-lang $pkgname-data::noarch"
source="https://sourceforge.net/projects/lgames/files/lbreakouthd/lbreakouthd-$pkgver.tar.gz
	0001-fix-undeclared-uint.patch
	format-security.patch
	gcc14-implicit-function-declaration.patch
	"
options="!check" # No test suite

prepare() {
	default_prepare
	update_config_sub
}

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

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

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

sha512sums="
c3a51cd0c57c87133423912de2b4e9411bc8eff5220288d484851db30299cdfec8c6b044b90702896bbd374678da1cf6e663ab9a75555ff58323149b55169ec3  lbreakouthd-1.1.9.tar.gz
4de6934a7840153354f54c5c6a9c14d22e3d5a76030cd33131c2511d97c363d73912d53d3581fd756ff42dec9c7d4e819056e5a2eee5d92064a88a9337abe5eb  0001-fix-undeclared-uint.patch
1600c7cb2c655d775b08961e7752979367c218917f628682e598816e33233cea7c3450c6f03005186dc8f6411d256733da4ed93284d4517608db9167bd189ce5  format-security.patch
f70dcddbd776e5fd37e2fd63f6fbbd35dde982e14e0fd03cdf02aa126e912965613701738bcf7da1427030d0e4e41c6c871b7fa7fdd066c9f64dc78518ff047c  gcc14-implicit-function-declaration.patch
"
