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

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

SLACKREQ=
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: This contains 32-bit version of the library
"

### default pkg_download
### default pkg_prepare
### package - only collect the libraries
pkg_package() {
	rm -rf bin sbin usr/bin usr/sbin usr/include usr/share
	mkdir -p usr/bin &&
	mv -v tmp/*-info-32 usr/bin
}

### build
pkg_build() {
    cd /tmp/openal*
    rm -r build

    # we cannot build makehrtf, it will result in trigger an odd compiler bug
    # all these will not be used anyway, we will use 64-bit version
    sed -i -e '/ADD_EXECUTABLE(makehrtf/d' \
		-e '/TARGET_COMPILE_DEFINITIONS(makehrtf/d' \
		-e '/TARGET_COMPILE_OPTIONS(makehrtf/d' \
		-e '/TARGET_LINK_LIBRARIES(makehrtf/d'  \
		-e 's|INSTALL(TARGETS openal-info makehrtf|INSTALL(TARGETS openal-info|' \
		CMakeLists.txt &&
	pkg_build_cmake && pkg_build_slackdesc &&
	
	# multilib
	mv /usr/bin/openal-info /tmp/openal-info-32
}


