### this file is sourced not run
PKGVER=17.0
PKGBUILD=1
PKGARCH=x86_64

# source: james
TARBALL=PCemV17Linux.tar.gz
MD5SUM=6348bc47fcc7346e3d2b2ec79e0d7be5
SRC_URL=https://www.pcem-emulator.co.uk/files/$TARBALL
BUNDLE=

SLACKREQ='wxwidgets openal'
SLACKDESC="pcem: pcem $PKGVER (PC Emulator)
pcem: 
pcem: A PC Emulator accurately emulating many different kinds of PC 
pcem: platforms.
pcem: 
pcem: https://www.pcem-emulator.co.uk/
pcem: https://github.com/sarah-walker-pcem/pcem
pcem: 
pcem: 
pcem: 
pcem: 
"

### default pkg_download
### prepare
pkg_prepare() {
	if pkg_download; then
		echo extracting $TARBALL ...
		mkdir -p tmp/pcem &&
		tar -xf $SRC_DIR/$TARBALL -C tmp/pcem
	else
		return 1
	fi
}

### default pkg_package
### build
pkg_build() {
	unset CFLAGS CXXFLAGS # build with default CFLAGS, not -Os
	export LDFLAGS="$LDFLAGS -Wl,--as-needed"
	CONFFLAGS="$CONFFLAGS --enable-release-build --enable-networking --enable-alsa"
	
	pkg_build_autoconf &&
	pkg_build_slackdesc &&

	# templates for roms/nvr/docs
	mkdir -p /usr/share/doc/pcem &&
	cp -r configs nvr roms README* readme* tested* TESTED* /usr/share/doc/pcem &&
	true
}
 
