Skip to content

Commit

Permalink
portaudio: move to cmake
Browse files Browse the repository at this point in the history
  • Loading branch information
lazka committed Jul 23, 2021
1 parent eb6bb0e commit bb00e67
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 13,723 deletions.
95 changes: 33 additions & 62 deletions mingw-w64-portaudio/PKGBUILD
Expand Up @@ -3,83 +3,54 @@
_realname=portaudio
pkgbase=mingw-w64-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=190700_20210406
pkgrel=1
epoch=1
pkgver=19.7.0
_tarver=190700_20210406
pkgrel=2
pkgdesc="A free, cross-platform, open source, audio I/O library (mingw-w64)"
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32')
url="http://www.portaudio.com"
license=("custom")
makedepends=("${MINGW_PACKAGE_PREFIX}-gcc" "${MINGW_PACKAGE_PREFIX}-pkg-config")
makedepends=(
"${MINGW_PACKAGE_PREFIX}-gcc"
"${MINGW_PACKAGE_PREFIX}-pkg-config"
"${MINGW_PACKAGE_PREFIX}-cmake"
"${MINGW_PACKAGE_PREFIX}-ninja"
)
depends=("${MINGW_PACKAGE_PREFIX}-gcc-libs")
options=(!libtool strip staticlibs)
source=("http://files.portaudio.com/archives/pa_stable_v${pkgver}.tgz"
"fix-build.patch"
"wdmks-wasapi-dsound.patch"
"uuid-no-dep.patch")
sha256sums=('47efbf42c77c19a05d22e627d42873e991ec0c1357219c0d74ce6a2948cb2def'
'77e8438d482ad03baa5c23afbe293e8cbdb95287ff6a489515bde61231e78525'
'a316ad73ef712a87d2ada2c6b891cb9e33d753dc8a59ef8f00df2152b32246f6'
'6b22fd42f0199f9b22fbc64ca5875c76d2a1de6c17ee63992d86359a92f87b1d')
source=("http://files.portaudio.com/archives/pa_stable_v${_tarver}.tgz")
sha256sums=('47efbf42c77c19a05d22e627d42873e991ec0c1357219c0d74ce6a2948cb2def')

prepare() {
cd ${srcdir}/${_realname}

patch -p0 -i ${srcdir}/fix-build.patch
patch -p0 -i ${srcdir}/wdmks-wasapi-dsound.patch
patch -p0 -i ${srcdir}/uuid-no-dep.patch

autoconf
}

# In order to build with ASIO-support, download the ASIOSDK2.3 from Steinberg, add
# the path below and add "asio" to --with-winapi. Both for shared and static, e.g:
# --with-asiodir=${HOME}/ASIOSDK2.3 \
# --with-winapi=wmme,directx,wasapi,wdmks,asio
# Unfortunately each build creates artefacts in the ASIO-SDK (.libs) that conflict
# with the subsequent build (shared/static, 32-/64-bit. You may need to clean out
# manually or replace the SDK with a fresh copy. You may also need to provice two
# separate copies for asiodir in the shared and static build.

build() {
export lt_cv_deplibs_check_method='pass_all'

[[ -d "build-static-${MINGW_CHOST}" ]] && rm -rf "build-static-${MINGW_CHOST}"
mkdir -p "${srcdir}/build-static-${MINGW_CHOST}"
cd "${srcdir}/build-static-${MINGW_CHOST}"

../${_realname}/configure \
--prefix=${MINGW_PREFIX} \
--build=${MINGW_CHOST} \
--host=${MINGW_CHOST} \
--target=${MINGW_CHOST} \
--disable-shared \
--enable-static \
--with-dxdir=${MINGW_PREFIX}/${MINGW_CHOST} \
--with-winapi=wmme,directx,wasapi,wdmks

make

[[ -d "build-shared-${MINGW_CHOST}" ]] && rm -rf "build-shared-${MINGW_CHOST}"
mkdir -p "${srcdir}/build-shared-${MINGW_CHOST}"
cd "${srcdir}/build-shared-${MINGW_CHOST}"

../${_realname}/configure \
--prefix=${MINGW_PREFIX} \
--build=${MINGW_CHOST} \
--host=${MINGW_CHOST} \
--target=${MINGW_CHOST} \
--enable-shared \
--with-dxdir=${MINGW_PREFIX}/${MINGW_CHOST} \
--with-winapi=wmme,directx,wasapi,wdmks

make
[[ -d "build-static-${MINGW_CHOST}" ]] && rm -rf "build-${MINGW_CHOST}"
mkdir -p "${srcdir}/build-${MINGW_CHOST}"
cd "${srcdir}/build-${MINGW_CHOST}"

declare -a extra_config
if check_option "debug" "n"; then
extra_config+=("-DCMAKE_BUILD_TYPE=Release")
else
extra_config+=("-DCMAKE_BUILD_TYPE=Debug")
fi

MSYS2_ARG_CONV_EXCL="-DCMAKE_INSTALL_PREFIX=" \
${MINGW_PREFIX}/bin/cmake \
-GNinja \
-DCMAKE_INSTALL_PREFIX=${MINGW_PREFIX} \
"${extra_config[@]}" \
../${_realname}

${MINGW_PREFIX}/bin/cmake --build .
}

package() {
cd "${srcdir}/build-static-${MINGW_CHOST}"
make DESTDIR="${pkgdir}" install
cd "${srcdir}/build-${MINGW_CHOST}"

cd "${srcdir}/build-shared-${MINGW_CHOST}"
make DESTDIR="${pkgdir}" install
DESTDIR="${pkgdir}" ${MINGW_PREFIX}/bin/cmake --build . --target install
}
12 changes: 0 additions & 12 deletions mingw-w64-portaudio/fix-build.patch

This file was deleted.

42 changes: 0 additions & 42 deletions mingw-w64-portaudio/uuid-no-dep.patch

This file was deleted.

0 comments on commit bb00e67

Please sign in to comment.