Skip to content

Commit

Permalink
libdispatch: update to 6.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
ognevny authored Dec 13, 2024
1 parent 492eafd commit a9a6b2a
Showing 1 changed file with 9 additions and 20 deletions.
29 changes: 9 additions & 20 deletions mingw-w64-libdispatch/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ _realname=libdispatch
pkgbase=mingw-w64-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}"
"${MINGW_PACKAGE_PREFIX}-libblocksruntime-swift")
pkgver=5.10
pkgver=6.0.3
pkgrel=1
arch=('any')
mingw_arch=('mingw64' 'ucrt64' 'clang64')
Expand All @@ -16,33 +16,24 @@ makedepends=("${MINGW_PACKAGE_PREFIX}-cmake"
"${MINGW_PACKAGE_PREFIX}-clang"
"${MINGW_PACKAGE_PREFIX}-lld")
source=("https://github.com/apple/swift-corelibs-libdispatch/archive/swift-${pkgver}-RELEASE.tar.gz"
# Support compiling on MinGW
"https://github.com/apple/swift-corelibs-libdispatch/commit/5460cefb493c88f577b8504de5c9718759e04a1b.patch"
"001-link-libBlocksRuntime.patch")
sha256sums=('16e088cf12654d22658879710b9694a6fad1c94d5e5d0c597741b71fbcb3e034'
'8f6da4c8029bfa661a92a3d129625720162faad1ceaa1b37e66fbc545860b569'
sha256sums=('444c0de5fe18e148548a3f3b60b3bac3d4d586285c21064346c7ca17ed1d4fac'
'2b249f8478f9e63c6beb90d679d07102d0903d3ddfd28a265310d6a015b7d802')

prepare() {
cd ${srcdir}/swift-corelibs-${_realname}-swift-${pkgver}-RELEASE/
cd swift-corelibs-${_realname}-swift-${pkgver}-RELEASE

patch -Np1 -i ${srcdir}/001-link-libBlocksRuntime.patch
patch -Np1 -i ${srcdir}/5460cefb493c88f577b8504de5c9718759e04a1b.patch
}

build() {
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")
else
extra_config+=("-DCMAKE_BUILD_TYPE=Debug")
fi

export CXXFLAGS+=" -Wno-macro-redefined"
export CFLAGS+=" -Wno-macro-redefined"

MSYS2_ARG_CONV_EXCL="-DCMAKE_INSTALL_PREFIX=" \
LDFLAGS+=" -fuse-ld=lld" \
"${MINGW_PREFIX}"/bin/cmake.exe \
Expand All @@ -51,26 +42,26 @@ build() {
-DCMAKE_C_COMPILER="clang" \
-DCMAKE_CXX_COMPILER="clang++" \
"${extra_config[@]}" \
../swift-corelibs-${_realname}-swift-${pkgver}-RELEASE
-S "swift-corelibs-${_realname}-swift-${pkgver}-RELEASE" \
-B "build-${MSYSTEM}"

"${MINGW_PREFIX}"/bin/cmake.exe --build .
"${MINGW_PREFIX}"/bin/cmake.exe --build "build-${MSYSTEM}"
}

package_libdispatch() {
pkgdesc="The libdispatch Project, (a.k.a. Grand Central Dispatch), for concurrency on multicore hardware (mingw-w64)"
depends=("${MINGW_PACKAGE_PREFIX}-libblocksruntime-swift"
"${MINGW_PACKAGE_PREFIX}-libwinpthread"
$([[ $MINGW_PACKAGE_PREFIX == *-clang-* ]] || echo "${MINGW_PACKAGE_PREFIX}-gcc-libs"))
cd "${srcdir}/build-${MSYSTEM}"

DESTDIR="${pkgdir}" "${MINGW_PREFIX}"/bin/cmake.exe --install .
DESTDIR="${pkgdir}" "${MINGW_PREFIX}"/bin/cmake.exe --install "build-${MSYSTEM}"

mkdir -p dest${MINGW_PREFIX}/{bin,lib,include}
mv "${pkgdir}${MINGW_PREFIX}/bin/libBlocksRuntime.dll" "dest${MINGW_PREFIX}/bin/libBlocksRuntime.dll"
mv "${pkgdir}${MINGW_PREFIX}/lib/libBlocksRuntime.dll.a" "dest${MINGW_PREFIX}/lib/libBlocksRuntime.dll.a"
mv "${pkgdir}${MINGW_PREFIX}/include/Block.h" "dest${MINGW_PREFIX}/include/Block.h"

install -Dm644 "${srcdir}/swift-corelibs-${_realname}-swift-${pkgver}-RELEASE/LICENSE" "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/LICENSE"
install -Dm644 "swift-corelibs-${_realname}-swift-${pkgver}-RELEASE/LICENSE" "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/LICENSE"
}

package_libblocksruntime-swift() {
Expand All @@ -79,11 +70,9 @@ package_libblocksruntime-swift() {
replaces=("${MINGW_PACKAGE_PREFIX}-libblocksruntime")
provides=("${MINGW_PACKAGE_PREFIX}-libblocksruntime")

cd "${srcdir}/build-${MSYSTEM}"

mv dest/* "${pkgdir}"

install -Dm644 "${srcdir}/swift-corelibs-${_realname}-swift-${pkgver}-RELEASE/LICENSE" "${pkgdir}${MINGW_PREFIX}/share/licenses/libblocksruntime-swift/LICENSE"
install -Dm644 "swift-corelibs-${_realname}-swift-${pkgver}-RELEASE/LICENSE" "${pkgdir}${MINGW_PREFIX}/share/licenses/libblocksruntime-swift/LICENSE"
}

# template start; name=mingw-w64-splitpkg-wrappers; version=1.0;
Expand Down

0 comments on commit a9a6b2a

Please sign in to comment.