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

# source: james
TARBALL=dosbox-x-v${PKGVER}.tar.gz
MD5SUM=39b8ffbdeb5e731ac37d98b0f978811a
SRC_URL=https://github.com/joncampbell123/dosbox-x/archive/$TARBALL
BUNDLE=

SLACKREQ='libpng' # internal libSDL and libSDL-net
SLACKDESC="dosbox-x: dosbox-x $PKGVER (DOS emulator)
dosbox-x: 
dosbox-x: Dosbox-X is a Jon Campbell fork of Dosbox with focus on accurate 
dosbox-x: emulation and retro-development. It features fine-grained control 
dosbox-x: over the emulated machine and in-emulator menu support. This is a 
dosbox-x: minimal build-debug build, there is no menu item or documentation. 
dosbox-x: Start is from terminal as dosbox-x.
dosbox-x: 
dosbox-x: http://dosbox-x.com/
dosbox-x: https://github.com/joncampbell123/dosbox-x/
dosbox-x: 
"

### default pkg_download
### default pkg_prepare
### default pkg_package
### build
pkg_build() {
	unset CFLAGS CXXFLAGS # build with default CFLAGS, not -Os
	LDFLAGS="$LDFLAGS -Wl,--as-needed"
	CONFFLAGS="$CONFFLAGS --enable-core-inline --enable-avcodec"
	
	cd /tmp/dosbox-x* &&
	sed -i -e 's|F11|F12|g' src/shell/shell.cpp && # default host key in Linux is F12
	# use build-debug instaed	
	#./autogen.sh &&
	#pkg_build_autoconf &&
	./build-debug &&
	make install &&
	
	pkg_build_slackdesc &&

	# desktop
	#mkdir -p /usr/share/applications /usr/share/pixmaps &&
	#install -m644 /tmp/pkg/dosbox.desktop /usr/share/applications &&
	#install -m644 /tmp/pkg/dosbox48.png /usr/share/icons &&

	# docs
	#install -dm755 /usr/share/dosbox &&
	#install -m644 README docs/README.video /usr/share/dosbox

	true
}
