# Template file for 'SMC'.
pkgname=SMC
version=1.9
revision=4
wrksrc=${pkgname,,}-${version}
build_style=gnu-configure
hostmakedepends="automake libtool gettext-devel pkg-config unzip"
makedepends="MesaLib-devel boost-devel cegui07-devel gettext-devel
 SDL_image-devel SDL_mixer-devel SDL_ttf-devel"
depends="SMC-data>=${version}"
short_desc="Two-dimensional platform game similar to Super Mario"
maintainer="Jürgen Buchmüller <pullmoll@t-online.de>"
license="GPL-3"
homepage="http://www.secretmaryo.org/"
distfiles="
 ${SOURCEFORGE_SITE}/smclone/${wrksrc}.tar.bz2
 ${SOURCEFORGE_SITE}/smclone/SMC_Music_5.0_high.zip"
checksum="
 b4194e70d3f1de3da884dd1a11e4f5cec25a205f66a3b85cc9fc1c86289b237d
 c5bb2e1830c7cbe499c93851f5a02b2b900b4730d2c7a133a44a7b43a297dab8"

CXXFLAGS="-fpermissive -std=c++11"
LDFLAGS="-Wl,--no-as-needed -lX11 -lboost_system"

post_extract() {
	# remove CRs from end of line
	find ${wrksrc}/src -type f -exec sed -i "{}" -e "s;\r$;;" \;
	mv ${XBPS_BUILDDIR}/data/music/* ${wrksrc}/data/music
}
pre_configure() {
	NOCONFIGURE=1 ./autogen.sh
}
post_install() {
	vinstall ${FILESDIR}/smc.desktop 644 usr/share/applications
	vinstall ${FILESDIR}/smc.png 644 usr/share/pixmaps
}

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