# Template file for 'rocksndiamonds'
pkgname=rocksndiamonds
version=4.0.0.2
revision=1
build_style=gnu-makefile
hostmakedepends="pkg-config"
# XXX: switch to SDL2
makedepends="SDL_image-devel SDL_mixer-devel SDL_net-devel"
short_desc="Arcade style game"
maintainer="Jürgen Buchmüller <pullmoll@t-online.de>"
license="GPL-2"
homepage="http://www.artsoft.org/rocksndiamonds"
distfiles="http://www.artsoft.org/RELEASES/unix/${pkgname}/${pkgname}-${version}.tar.gz"
checksum=64dd10e8e543a2ff111475243c8360f4009bcf186af34f4c95d36eafe836f637

do_build() {
	CFLAGS+=" -DTARGET_SDL"
	CFLAGS+=" $(sdl-config --cflags)"
	CFLAGS+=" -DRO_GAME_DIR='\"/usr/share/${pkgname}\"'"
	CFLAGS+=" -DRW_GAME_DIR='\"/var/lib/${pkgname}\"'"
	LDFLAGS+=" $(sdl-config --libs)"
	LDFLAGS+=" -lSDL_image -lSDL_mixer -lSDL_net -lm"
	make CC="${CC}" CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" ${makejobs} sdl
}

do_install() {
	vmkdir usr/share/${pkgname}
	cp -aR graphics levels music sounds ${DESTDIR}/usr/share/${pkgname}
	vbin rocksndiamonds
	# Manual page is no longer supplied (WTF)
	# vman rocksndiamonds.1
	vinstall ${FILESDIR}/${pkgname}.desktop 644 usr/share/applications
	vinstall ${FILESDIR}/${pkgname}.png 644 usr/share/pixmaps
}
