maintainer="Bart Ribbers <bribbers@disroot.org>"
pkgname=allegro
pkgver=5.2.10.0
pkgrel=0
arch="all"
url="https://liballeg.org"
pkgdesc="Portable library mainly aimed at video game and multimedia programming"
license="BSD-3-Clause"
makedepends="
	alsa-lib-dev
	cmake
	flac-dev
	glu-dev
	gtk+3.0-dev
	libjpeg-turbo-dev
	libtheora-dev
	libvorbis-dev
	libwebp-dev
	libxcursor-dev
	libxi-dev
	mesa-dev
	pulseaudio-dev
	samurai
	xorg-server-dev
	"
source="https://github.com/liballeg/allegro5/releases/download/$pkgver/allegro-$pkgver.tar.gz"
subpackages="$pkgname-dev"

build() {
	# sdl2 is disabled for now as it's experimental still
	# and the tests are crashing on it
	# https://github.com/liballeg/allegro5/issues/1229
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=MinSizeRel \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DALLEGRO_SDL=OFF \
		-DWANT_TESTS=ON \
		-DWANT_EXAMPLES=OFF \
		-DWANT_DEMO=OFF
	cmake --build build
}

check() {
	cd build
	tests/test_driver --no-display ../tests/test_*.ini
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
0bb1c63ddbb622ffe7c4987aaaa48a0f12a09304ad3a07da0b7d981f027b7f1de98fb454b5f9bdabdbf7b6a89eed763643f2fe03b5a1bc818e4506e210c86d2a  allegro-5.2.10.0.tar.gz
"
