Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mingw-w64-clang: update to 17.0.6 #100

Merged
merged 1 commit into from
Dec 1, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 40 additions & 17 deletions mingw-w64-clang/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,15 @@ fi
_realname=clang
pkgbase=mingw-w64-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}"
"${MINGW_PACKAGE_PREFIX}-clang-libs"
"${MINGW_PACKAGE_PREFIX}-clang-analyzer"
"${MINGW_PACKAGE_PREFIX}-clang-tools-extra"
"${MINGW_PACKAGE_PREFIX}-compiler-rt"
$( (( _clangprefix )) && echo "${MINGW_PACKAGE_PREFIX}-gcc-compat" )
"${MINGW_PACKAGE_PREFIX}-lld"
"${MINGW_PACKAGE_PREFIX}-llvm"
"${MINGW_PACKAGE_PREFIX}-llvm-libs")
_version=17.0.4
_version=17.0.6
_rc=
_tag=llvmorg-${_version}${_rc}
pkgver=${_version}${_rc/-/}
Expand Down Expand Up @@ -71,19 +72,19 @@ source=("${_url}/llvm-${pkgver}.src.tar.xz"{,.sig}
#0201-0299 -> rt
#0301-0399 -> lld
#0401-0499 -> clang-tools-extra
sha256sums=('4f5907fb547947d10df35230a0fc73cf2f81aa12e09fc8de96c023425412c9f6'
sha256sums=('b638167da139126ca11917b6880207cc6e8f9d1cbb1a48d87d017f697ef78188'
'SKIP'
'56c99515be2f245848dacc60fe85fe9de66cdc438ea0a1b82640e68384d0e432'
'a78f668a726ae1d3d9a7179996d97b12b90fb76ab9442a43110b972ff7ad9029'
'SKIP'
'e191d573cbf0ec15ce12c8ac7080d3a1eeb27b8296ee104e1147cae90f424211'
'aa774642415d338d7b77a66fcbad6fd1f77f382dabcb67422a6230614eff1ab9'
'SKIP'
'9dd56f359f3dc08fb1dd34f4e3147e5a84b4f0d96a39160c8eb739cf7ea32e64'
'11b8d09dcf92a0f91c5c82defb5ad9ff4acf5cf073a80c317204baa922d136b4'
'SKIP'
'47f5da4d28c60d69ab134c028ece0af8a5e18aca940d26a672265a381cafdc50'
'4ac13125616dc44905b85820aa403d27ec1226329b7f674daeb5f5584c6f0b22'
'SKIP'
'1a5cbe4a1fcda56ecdd80f42c3437060a28c97ec31de1748f6ba6aa84948fb0f'
'807f069c54dc20cb47b21c1f6acafdd9c649f3ae015609040d6182cab01140f4'
'SKIP'
'49358a7da2f49149a3028bf3aa6389052d4ebc15c548699cf19694141fdea847'
'3054d0a9c9375dab1a4539cc2cc45ab340341c5d71475f9599ba7752e222947b'
'SKIP'
'eb03df53671df6627768141b3aaa76abe176a14e5e47911c97bec544387c4aff'
'd7d58ad5d0e77f2803070a8fb7f4138a6f49a2cbf30c55ff059c31f40ca6b65c'
Expand Down Expand Up @@ -268,6 +269,7 @@ package_clang() {
pkgdesc="C language family frontend for LLVM (mingw-w64)"
url="https://clang.llvm.org/"
depends=("${MINGW_PACKAGE_PREFIX}-llvm=${pkgver}"
"${MINGW_PACKAGE_PREFIX}-clang-libs=${pkgver}"
$( ((_clangprefix)) && echo \
"${MINGW_PACKAGE_PREFIX}-compiler-rt=${pkgver}" \
"${MINGW_PACKAGE_PREFIX}-crt" \
Expand All @@ -279,7 +281,26 @@ package_clang() {
"${MINGW_PACKAGE_PREFIX}-cc" \
|| true ))

cmake --install "${srcdir}/build-${MSYSTEM}/tools/clang" --prefix "${pkgdir}${MINGW_PREFIX}"
DESTDIR="${pkgdir}" ${MINGW_PREFIX}/bin/cmake --install "${srcdir}/build-${MSYSTEM}/tools/clang"

install -Dm644 "${srcdir}/clang/LICENSE.TXT" "${pkgdir}"${MINGW_PREFIX}/share/licenses/clang/LICENSE

# Runtime libraries
rm -rf "${srcdir}/clang-libs"
mkdir -p "${srcdir}/clang-libs/${MINGW_PREFIX}/bin"
mv -f "${pkgdir}${MINGW_PREFIX}"/bin/libclang{,-cpp}.dll "${srcdir}/clang-libs/${MINGW_PREFIX}/bin"
}

package_clang-libs() {
pkgdesc="Clang runtime libraries (mingw-w64)"
url="https://clang.llvm.org/"
depends=("${MINGW_PACKAGE_PREFIX}-gcc-libs"
"${MINGW_PACKAGE_PREFIX}-llvm-libs=${pkgver}")
conflicts=("${MINGW_PACKAGE_PREFIX}-clang<17.0.6")

cp -r "${srcdir}/clang-libs/${MINGW_PREFIX}" "${pkgdir}${MINGW_PREFIX}"

install -Dm644 "${srcdir}/clang/LICENSE.TXT" "${pkgdir}"${MINGW_PREFIX}/share/licenses/clang-libs/LICENSE
}

package_clang-analyzer() {
Expand All @@ -290,12 +311,11 @@ package_clang-analyzer() {

local _analyzer
for _analyzer in scan-build scan-build-py scan-view; do
DESTDIR="${pkgdir}" cmake --install "${srcdir}/build-${MSYSTEM}/tools/clang/tools/${_analyzer}"
DESTDIR="${pkgdir}" ${MINGW_PREFIX}/bin/cmake --install "${srcdir}/build-${MSYSTEM}" --component ${_analyzer}
done

# Compile Python scripts
${MINGW_PREFIX}/bin/python -m compileall "${pkgdir}"${MINGW_PREFIX}/lib/libscanbuild
${MINGW_PREFIX}/bin/python -O -m compileall "${pkgdir}"${MINGW_PREFIX}/lib/libscanbuild
${MINGW_PREFIX}/bin/python -m compileall -o 0 -o 1 "${pkgdir}"${MINGW_PREFIX}/lib/libscanbuild

install -Dm644 "${srcdir}/clang/LICENSE.TXT" "${pkgdir}"${MINGW_PREFIX}/share/licenses/clang-analyzer/LICENSE
}
Expand All @@ -305,15 +325,15 @@ package_clang-tools-extra() {
url="https://clang.llvm.org/"
depends=("${MINGW_PACKAGE_PREFIX}-clang=${pkgver}")

DESTDIR="${pkgdir}" cmake --install "${srcdir}/build-${MSYSTEM}/tools/clang/tools/extra"
DESTDIR="${pkgdir}" ${MINGW_PREFIX}/bin/cmake --install "${srcdir}/build-${MSYSTEM}/tools/clang/tools/extra"
}

package_compiler-rt() {
pkgdesc="Runtime libraries for Clang and LLVM (mingw-w64)"
url="https://compiler-rt.llvm.org/"
depends=($( (( _clangprefix )) || echo "${MINGW_PACKAGE_PREFIX}-gcc-libs"))

DESTDIR="${pkgdir}" cmake --install "${srcdir}/build-${MSYSTEM}/projects/compiler-rt"
DESTDIR="${pkgdir}" ${MINGW_PREFIX}/bin/cmake --install "${srcdir}/build-${MSYSTEM}/projects/compiler-rt"
mkdir -p "${pkgdir}${MINGW_PREFIX}/bin/"
find "${pkgdir}${MINGW_PREFIX}/lib/clang/${_version%.[0-9].*}/lib/windows/" \
-name '*.dll' -exec mv '{}' "${pkgdir}${MINGW_PREFIX}/bin/" \;
Expand All @@ -338,12 +358,15 @@ package_gcc-compat() {
package_lld() {
pkgdesc="Linker tools for LLVM (mingw-w64)"
url="https://lld.llvm.org/"
depends=("${MINGW_PACKAGE_PREFIX}-llvm=${pkgver}")
depends=("${MINGW_PACKAGE_PREFIX}-gcc-libs"
"${MINGW_PACKAGE_PREFIX}-llvm-libs=${pkgver}"
"${MINGW_PACKAGE_PREFIX}-zlib"
"${MINGW_PACKAGE_PREFIX}-zstd")
provides=($( (( _clangprefix )) && echo \
"${MINGW_PACKAGE_PREFIX}-binutils" \
|| true))

DESTDIR="${pkgdir}" cmake --install "${srcdir}/build-${MSYSTEM}/tools/lld"
DESTDIR="${pkgdir}" ${MINGW_PREFIX}/bin/cmake --install "${srcdir}/build-${MSYSTEM}/tools/lld"
if (( _clangprefix )); then
install -Dm755 "${pkgdir}${MINGW_PREFIX}/bin/lld.exe" "${pkgdir}${MINGW_PREFIX}/bin/ld.exe"
fi
Expand All @@ -355,7 +378,7 @@ package_llvm() {

cd "${srcdir}"/llvm

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

install -Dm644 "${srcdir}/llvm/LICENSE.TXT" "${pkgdir}${MINGW_PREFIX}/share/licenses/llvm/LICENSE"

Expand Down