summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Whatson2018-12-09 23:51:37 +1000
committerAndrew Whatson2018-12-09 23:51:37 +1000
commitec2bffd7c2ee889c23cdcbb095322376250487e6 (patch)
tree649b07089e430ea7179d63fec82185b4f0d4a874
parentde70e62e2491e30b2e83079a4142d05c2d080f81 (diff)
downloadaur-ec2bffd7c2ee889c23cdcbb095322376250487e6.tar.gz
Update for CMake build
-rw-r--r--.SRCINFO7
-rw-r--r--PKGBUILD51
-rw-r--r--force-lib32-sdl2.patch13
3 files changed, 56 insertions, 15 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 32db2c55ea6..2f4cae1473b 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,19 +1,22 @@
pkgbase = lib32-faudio-git
pkgdesc = Accuracy-focused XAudio reimplementation for open platforms
- pkgver = r949.acc1aaa
- pkgrel = 2
+ pkgver = r979.a98be73
+ pkgrel = 1
url = https://github.com/FNA-XNA/FAudio
arch = x86_64
license = custom
makedepends = git
+ makedepends = cmake
depends = faudio
depends = lib32-sdl2
depends = lib32-ffmpeg
provides = lib32-faudio
source = git+https://github.com/FNA-XNA/FAudio
source = faudio.pc
+ source = force-lib32-sdl2.patch
sha256sums = SKIP
sha256sums = 371d1dfdfa335a354f41376807848ba0cc448890d6da60d0b5c9478033b7e54c
+ sha256sums = 18de1716de0c71dfbb17c9f0bc7137592f25fa040b185011221bbce91734983e
pkgname = lib32-faudio-git
diff --git a/PKGBUILD b/PKGBUILD
index 2c84f61ced1..b08e5980b0e 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -4,19 +4,21 @@ _pkgbase=faudio
_pkgname=lib32-${_pkgbase}
_gitname=FAudio
pkgname=${_pkgname}-git
-pkgver=r949.acc1aaa
-pkgrel=2
+pkgver=r979.a98be73
+pkgrel=1
pkgdesc="Accuracy-focused XAudio reimplementation for open platforms"
arch=('x86_64')
url='https://github.com/FNA-XNA/FAudio'
license=('custom')
provides=("${_pkgname}")
depends=("${_pkgbase}" 'lib32-sdl2' 'lib32-ffmpeg')
-makedepends=('git')
+makedepends=('git' 'cmake')
source=('git+https://github.com/FNA-XNA/FAudio'
- 'faudio.pc')
+ 'faudio.pc'
+ 'force-lib32-sdl2.patch')
sha256sums=('SKIP'
- '371d1dfdfa335a354f41376807848ba0cc448890d6da60d0b5c9478033b7e54c')
+ '371d1dfdfa335a354f41376807848ba0cc448890d6da60d0b5c9478033b7e54c'
+ '18de1716de0c71dfbb17c9f0bc7137592f25fa040b185011221bbce91734983e')
pkgver() {
cd "$srcdir/${_gitname}"
@@ -25,16 +27,39 @@ pkgver() {
build() {
cd "$srcdir/${_gitname}"
- CFLAGS="${CFLAGS} -m32" FAUDIO_RELEASE=1 FAUDIO_FFMPEG=1 make
+
+ patch -p1 -i ../force-lib32-sdl2.patch
+
+ mkdir -p build
+ cd build
+
+ export CFLAGS="${CFLAGS} -m32"
+
+ cmake .. \
+ -DCMAKE_BUILD_TYPE=Release \
+ -DCMAKE_INSTALL_PREFIX="${pkgdir}/usr" \
+ -DFFMPEG=ON \
+ -DFFmpeg_LIBRARY_DIRS=/usr/lib32
+
+ make
}
package() {
- cd "$srcdir/${_gitname}"
- _tmpdir="${pkgdir}/temp"
- CFLAGS="${CFLAGS} -m32" FAUDIO_RELEASE=1 FAUDIO_FFMPEG=1 INSTALL_PREFIX="${_tmpdir}" make install
- install -D -t "${pkgdir}/usr/lib32" "${_tmpdir}/lib"/*
- install -D -m644 -t "${pkgdir}/usr/lib32/pkgconfig" ../faudio.pc
- install -d "${pkgdir}/usr/share/licenses"
+ cd "$srcdir/${_gitname}/build"
+
+ make install
+
+ rm -r "${pkgdir}/usr/include"
+ mv "${pkgdir}/usr/lib" "${pkgdir}/usr/lib32"
+
+ sed -i 's!"${_IMPORT_PREFIX}/include"!"${_IMPORT_PREFIX}/include/FAudio"!' \
+ "${pkgdir}/usr/lib32/cmake/FAudio/FAudio-targets.cmake"
+
+ sed -i 's!"${_IMPORT_PREFIX}/lib/libFAudio.so"!"${_IMPORT_PREFIX}/lib32/libFAudio.so"!' \
+ "${pkgdir}/usr/lib32/cmake/FAudio/FAudio-targets-release.cmake"
+
+ mkdir -p "${pkgdir}/usr/share/licenses"
ln -s "${_pkgbase}" "${pkgdir}/usr/share/licenses/${_pkgname}"
- rm -rf "${_tmpdir}"
+
+ install -D -m644 -t "${pkgdir}/usr/lib32/pkgconfig" ../../faudio.pc
}
diff --git a/force-lib32-sdl2.patch b/force-lib32-sdl2.patch
new file mode 100644
index 00000000000..01a8aee82ca
--- /dev/null
+++ b/force-lib32-sdl2.patch
@@ -0,0 +1,13 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 588c72a..21191a2 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -133,7 +133,7 @@ if(FFMPEG)
+ endif(FFMPEG)
+
+ # SDL2 Dependency
+-find_package(SDL2 CONFIG REQUIRED)
++include(/usr/lib32/cmake/SDL2/SDL2Config.cmake)
+ if (TARGET SDL2::SDL2)
+ message(STATUS "using TARGET SDL2::SDL2")
+ target_link_libraries(FAudio PUBLIC SDL2::SDL2)