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

# Note: requireq CMAKE to build
TARBALL=openal-soft-$PKGVER.tar.bz2
MD5SUM=1f59accf1a187384e155e82663aa3f9a
SRC_URL=http://kcat.strangesoft.net/openal-releases/$TARBALL
BUNDLE=

SLACKREQ='qt5-common libSDL2'
SLACKDESC="openal: openal $PKGVER (OpenAL 3D Audio library)
openal: 
openal: OpenAL Soft is an LGPL-licensed, cross-platform, software 
openal: implementation of the OpenAL 3D audio API. OpenAL provides 
openal: capabilities for playing audio in a virtual 3D environment. Distance 
openal: attenuation, doppler shift, and directional sound emitters are among 
openal: the features handled by the API. More advanced effects, including air 
openal: absorption, occlusion, and environmental reverb, are available 
openal: through the EFX extension. It also facilitates streaming audio, 
openal: multi-channel buffers, and audio capture.
openal: http://kcat.strangesoft.net/openal.html
"

### default pkg_download
### default pkg_prepare
### default pkg_package
### build
pkg_build() {
    cd /tmp/openal*

	# qt5	
	export PATH="$PATH:/opt/qt5/bin"
	export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/opt/qt5/$LIBDIR"
	export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/opt/qt5/$LIBDIR/pkgconfig"
	export QT5_PATH="/opt/qt5/bin"
	export QT5_LD_LIBRARY_PATH="/opt/qt5/$LIBDIR"
	export QT5_PKG_CONFIG_PATH="/opt/qt5/$LIBDIR/pkgconfig"
	export QT5_CPLUS_INCLUDE_PATH="/opt/qt5/include" 
    
    rm -r build
    CMAKEFLAGS="$CMAKEFLAGS -DLIB_SUFFIX=64"
	pkg_build_cmake && pkg_build_slackdesc &&
	install -dm755 /etc/openal &&
	install -m644 ../alsoftrc.sample /etc/openal/alsoft.conf &&
	
	# multilib
	mv -v /usr/bin/openal-info{,-64} &&
	ln -sfv multiarch_wrapper /usr/bin/openal-info
}


