diff --git a/mingw-w64-libaribcaption/PKGBUILD b/mingw-w64-libaribcaption/PKGBUILD index 13db27901d16d..df6991272417b 100644 --- a/mingw-w64-libaribcaption/PKGBUILD +++ b/mingw-w64-libaribcaption/PKGBUILD @@ -5,7 +5,7 @@ _realname=libaribcaption pkgbase=mingw-w64-${_realname} pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}") pkgver=1.1.1 -pkgrel=1 +pkgrel=2 pkgdesc="Portable ARIB STD-B24 Caption Decoder/Renderer (mingw-w64)" arch=('any') mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32' 'clangarm64') @@ -23,9 +23,6 @@ source=("https://github.com/xqq/libaribcaption/archive/refs/tags/v${pkgver}.tar. sha256sums=('278d03a0a662d00a46178afc64f32535ede2d78c603842b6fd1c55fa9cd44683') build() { - cd "${srcdir}/${_realname}-${pkgver}" - mkdir -p "${srcdir}/build-${MSYSTEM}" && cd "${srcdir}/build-${MSYSTEM}" - declare -a extra_config if check_option "debug" "n"; then extra_config+=("-DCMAKE_BUILD_TYPE=Release") @@ -33,6 +30,24 @@ build() { extra_config+=("-DCMAKE_BUILD_TYPE=Debug") fi + msg2 "Building static library" + [[ -d "${srcdir}"/build-${MSYSTEM}-static ]] && rm -rf "${srcdir}"/build-${MSYSTEM}-static + mkdir -p "${srcdir}"/build-${MSYSTEM}-static && cd "${srcdir}"/build-${MSYSTEM}-static + + MSYS2_ARG_CONV_EXCL="-DCMAKE_INSTALL_PREFIX=" \ + "${MINGW_PREFIX}"/bin/cmake.exe \ + -GNinja \ + -DCMAKE_INSTALL_PREFIX="${MINGW_PREFIX}" \ + "${extra_config[@]}" \ + -DBUILD_SHARED_LIBS=OFF \ + ../${_realname}-${pkgver} + + "${MINGW_PREFIX}"/bin/cmake.exe --build . + + msg2 "Building shared library" + [[ -d "${srcdir}"/build-${MSYSTEM}-shared ]] && rm -rf "${srcdir}"/build-${MSYSTEM}-shared + mkdir -p "${srcdir}"/build-${MSYSTEM}-shared && cd "${srcdir}"/build-${MSYSTEM}-shared + MSYS2_ARG_CONV_EXCL="-DCMAKE_INSTALL_PREFIX=" \ "${MINGW_PREFIX}"/bin/cmake.exe \ -GNinja \ @@ -45,8 +60,10 @@ build() { } package() { - cd "${srcdir}/build-${MSYSTEM}" + cd "${srcdir}"/build-${MSYSTEM}-static + DESTDIR="${pkgdir}" "${MINGW_PREFIX}"/bin/cmake.exe --install . + cd "${srcdir}"/build-${MSYSTEM}-shared DESTDIR="${pkgdir}" "${MINGW_PREFIX}"/bin/cmake.exe --install . install -Dm644 "${srcdir}/${_realname}-${pkgver}/LICENSE" "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/LICENSE"