# Template file for 'gdash'
pkgname=gdash
version=20180129
revision=1
wrksrc=${pkgname}-${version}unstable
build_style=gnu-configure
hostmakedepends="gettext-devel glib-devel gtk+-devel SDL2-devel pkg-config"
makedepends="glu-devel gtk+-devel SDL2_image-devel SDL2_mixer-devel"
depends="gdash-data>=${version}_${revision}"
configure_args="--with-sdl-prefix=${XBPS_CROSS_BASE}/usr"

short_desc="Boulder Dash clone close to the original"
maintainer="Jürgen Buchmüller <pullmoll@t-online.de>"
license="MIT"
homepage="https://bitbucket.org/czirkoszoltan/gdash"
distfiles="https://bitbucket.org/czirkoszoltan/${pkgname}/downloads/${pkgname}-${version}unstable.tar.gz"
checksum=7d4bc188d26b6cfce2c94c17dada22282a7108482c5a0f87d37f6ac6db76298e

if [ -n "$CROSS_BUILD" ]; then
	# Make sure SDL_opengl.h finds GL/gl.h
	CXXFLAGS="-I${XBPS_CROSS_BASE}/usr/include"
fi

pre_build() {
	if [ "$CROSS_BUILD" ]; then
		cd ${wrksrc}/include
		g++ -O2 -o files2c files2c.cpp
		sed -i Makefile -e "s; files2c;;"
	fi
}

post_install() {
	vlicense COPYING
}

gdash-data_package() {
	short_desc+=" - data files"
	noarch=yes
	pkg_install() {
		vmove usr/share/gdash
	}
}
