PKGBUILDs/community/libc++/PKGBUILD
2021-05-20 22:36:41 +00:00

90 lines
3.8 KiB
Bash

# Maintener: Anatol Pomozov
# Contributor: Llewelyn Trahaearn <woefulderelict [at] gmail [dot] com>
# Contributor: Daniel Micay <danielmicay [at] gmail [dot] com>
# Contributor: MThinkCpp <mtc [dot] maintainer [at] outlook [dot] com>
# ALARM: Kevin Mihelich <kevin@archlinuxarm.org>
# - atomic fixes for v5
pkgbase=libc++
pkgname=(libc++ libc++abi libc++experimental)
pkgver=12.0.0
pkgrel=1
url="https://libcxx.llvm.org/"
license=('custom:Apache 2.0 with LLVM Exception')
arch=('x86_64')
depends=('gcc-libs')
makedepends=('clang' 'cmake' 'llvm' 'libunwind' 'ninja' 'python')
source=("https://github.com/llvm/llvm-project/releases/download/llvmorg-$pkgver/llvm-$pkgver.src.tar.xz"{,.sig}
"https://github.com/llvm/llvm-project/releases/download/llvmorg-$pkgver/libcxx-$pkgver.src.tar.xz"{,.sig}
"https://github.com/llvm/llvm-project/releases/download/llvmorg-$pkgver/libcxxabi-$pkgver.src.tar.xz"{,.sig}
'atomic.patch')
noextract=("${source[@]##*/}")
sha512sums=('ec17153ef774a1e08085763bda7d0dfce6802fbaa17e89831695ce1b2eb015a6c2aebfaa9fe7985a83b9c51bd75d40bb4f1fc706dc16d4c0dc2b2722a1d8a24e'
'SKIP'
'd8038e73b4f26191516608799288f5418ccfb4552ffd767b08179f0dba2730f0d872b28bd3db9fe244e7177101b599aa251d28a496c734b22b3c053db187d88d'
'SKIP'
'adc59e168d4e298a3fe8a08045c4c5089b2a3eb06dacf54a5a345200cef11a764b93bcc5a289433a57bde2d0456fedd92abf0c22da00a62b395e1d2f678d26f1'
'SKIP'
'd4dd60345d59690e5fb332ec8c4b600615a6a2f3b50c748876b713e39c0e21800e021358a32920c7954e62c2224954c6f2cd2054d531420da3f696957d21e7f6')
validpgpkeys=('474E22316ABF4785A88C6E8EA2C794A986419D8A' # Tom Stellard <tstellar@redhat.com> (.1 releases)
'B6C8F98282B944E3B0D5C2530FC3042E345AD05D') # Hans Wennborg <hans@chromium.org> (.0 releases)
prepare() {
mkdir -p build llvm/projects/libcxx llvm/projects/libcxxabi
bsdtar --strip-components 1 -zxf "${source[0]##*/}" -C llvm
bsdtar --strip-components 1 -zxf "${source[2]##*/}" -C llvm/projects/libcxx
bsdtar --strip-components 1 -zxf "${source[4]##*/}" -C llvm/projects/libcxxabi
sed -i 's/CREDITS.TXT/CREDITS/' llvm/projects/libcxx/LICENSE.TXT llvm/projects/libcxxabi/LICENSE.TXT
if [[ $CARCH == "arm" ]]; then
patch -p1 -d llvm -i ../atomic.patch
echo "target_link_libraries(cxxabi_shared PRIVATE atomic)" >> llvm/projects/libcxxabi/src/CMakeLists.txt
fi
}
build() {
cd build
cmake \
-G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_C_COMPILER=clang \
-DCMAKE_CXX_COMPILER=clang++ \
-DLIBCXX_INSTALL_EXPERIMENTAL_LIBRARY=NO \
"$srcdir"/llvm
ninja cxx cxx_experimental
}
check() {
ninja -C build check-cxx check-cxxabi
}
package_libc++() {
pkgdesc='LLVM C++ standard library.'
depends=("libc++abi=$pkgver-$pkgrel")
options=('staticlibs')
DESTDIR="$pkgdir" ninja -C build install-cxx
install -Dm0644 "$srcdir"/llvm/projects/libcxx/CREDITS.TXT "$pkgdir"/usr/share/licenses/"$pkgname"/CREDITS
install -Dm0644 "$srcdir"/llvm/projects/libcxx/LICENSE.TXT "$pkgdir"/usr/share/licenses/"$pkgname"/LICENSE
}
package_libc++abi() {
pkgdesc='Low level support for the LLVM C++ standard library.'
options=('staticlibs')
DESTDIR="$pkgdir" ninja -C build install-cxxabi
install -Dm0644 "$srcdir"/llvm/projects/libcxxabi/CREDITS.TXT "$pkgdir"/usr/share/licenses/"$pkgname"/CREDITS
install -Dm0644 "$srcdir"/llvm/projects/libcxxabi/LICENSE.TXT "$pkgdir"/usr/share/licenses/"$pkgname"/LICENSE
}
package_libc++experimental() {
depends=("libc++=$pkgver-$pkgrel")
pkgdesc='LLVM C++ experimental library.'
install -Dm0644 -t "$pkgdir"/usr/lib/ build/lib/libc++experimental.a
install -Dm0644 llvm/projects/libcxx/CREDITS.TXT "$pkgdir"/usr/share/licenses/"$pkgname"/CREDITS
install -Dm0644 llvm/projects/libcxx/LICENSE.TXT "$pkgdir"/usr/share/licenses/"$pkgname"/LICENSE
}