# Template file for 'cdogs'
pkgname=cdogs-sdl
version=0.6.3
revision=1
build_style=cmake
makedepends="physfs-devel SDL2-devel SDL2_mixer-devel SDL2_image-devel SDL2_net-devel yajl-devel"
short_desc="A classic overhead run-and-gun game"
maintainer="Enno Boland <gottox@voidlinux.eu>"
homepage="http://cxong.github.io/cdogs-sdl/"
license="GPL2"
distfiles="https://github.com/cxong/cdogs-sdl/archive/$version.tar.gz"
checksum=4497e88be7ef462e1839b4396fccdf880b612074c4091956e39cd86ea15fdd03
configure_args="-DCDOGS_DATA_DIR=/usr/share/cdogs/"

CFLAGS="-Wno-error=deprecated-declarations"

pre_configure() {
	# Install data to /usr/share/cdogs/ instead of cwd.
	sed -i '/^set(INSTALL_PREFIX/ s#.*#set(INSTALL_PREFIX "/usr/share/cdogs/")#' CMakeLists.txt
	# Do not build shipped yajl.
	sed -i '/add_subdirectory(yajl)/d' src/cdogs/CMakeLists.txt
}

post_install() {
	mv $DESTDIR/usr/share/cdogs/bin $DESTDIR/usr/bin
}
