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

# Note: require CMAKE to build
TARBALL=openal-soft-$PKGVER.tar.bz2
MD5SUM=58a73698288d2787451b61f8f4431513
SRC_URL=https://openal-soft.org/openal-releases/$TARBALL
BUNDLE=

SLACKREQ=
SLACKDESC="openal32: openal32 $PKGVER (OpenAL 3D Audio library)
openal32: 
openal32: OpenAL Soft is an LGPL-licensed, cross-platform, software 
openal32: implementation of the OpenAL 3D audio API. OpenAL provides 
openal32: capabilities for playing audio in a virtual 3D environment. Distance 
openal32: attenuation, doppler shift, and directional sound emitters are among 
openal32: the features handled by the API. More advanced effects, including air 
openal32: absorption, occlusion, and environmental reverb, are available 
openal32: through the EFX extension. It also facilitates streaming audio, 
openal32: multi-channel buffers, and audio capture.
openal32: 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
}

### 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	
}


