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

# source: james
TARBALL=SDL2-$PKGVER.tar.gz
MD5SUM=783b6f2df8ff02b19bb5ce492b99c8ff
SRC_URL=http://www.libsdl.org/release/$TARBALL
BUNDLE=

SLACKREQ='alsa-lib libX11' # and a few others, dynamically loaded
SLACKDESC="libSDL2: libSDL2 $PKGVER (Simple DirectMedia Layer)  
libSDL2:  
libSDL2: Simple DirectMedia Layer is a cross-platform development library 
libSDL2: designed to provide low level access to audio, keyboard, mouse, 
libSDL2: joystick, and graphics hardware via OpenGL and Direct3D. It is used 
libSDL2: by video playback software, emulators, and popular games. 
libSDL2: 
libSDL2: This is version 2 of SDL. It can be installed side-by-side with
libSDL2: version 1. Newer applications depends on this library.
libSDL2: 
libSDL2:
"

### default pkg_download
### default pkg_prepare
### default pkg_package
### build
pkg_build() {
	#CONFFLAGS="$CONFFLAGS --disable-static" && # doesn't work for now
	pkg_build_autoconf && 
	pkg_build_slackdesc &&

	# build and install controller map
	cd test &&
	sed -i -e 's|controllermap.bmp|/usr/share/data/&|' \
		-e 's|button.bmp|/usr/share/data/&|' \
		-e 's|axis.bmp|/usr/share/data/&|' \
		controllermap.c &&

	./configure $CONFFLAGS &&
	make controllermap &&
	install -m755 controllermap /usr/bin/sdl2-controllermap &&
	mkdir -p /usr/share/data &&
	install -m644 controllermap.bmp axis.bmp button.bmp /usr/share/data &&
	
	# multi-lib
	mv -v /usr/bin/sdl2-config{,-64} &&
	ln -sfv multiarch_wrapper /usr/bin/sdl2-config
}


