# Maintainer: Llewelyn Trahaearn # Contributor: Daniel Micay # Contributor: MThinkCpp pkgbase=libc++ pkgname=(${pkgbase}{,abi,experimental}) pkgver=10.0.0 pkgrel=1 url="https://libcxx.llvm.org/" license=('custom:Apache 2.0 with LLVM Exception') arch=('i686' '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}) noextract=("${source[@]##*/}") sha512sums=('7dc961aacee3a01ecc002ff2b688a2ef50661856d2abd5ecc90566ffcad7566e4976736cd339ea96592e452cd5a17aaceba9712b2effec805661cca8ff020ee7' 'SKIP' '8cbcbea23c50f0d7020386d11af5b736b8b43291146c11ccc543118ed1877a88adc381be2573594236e97bcf75c47408f986e5e9644a4fce57758cde47e5b641' 'SKIP' 'e58be156f924b0e613a69872c1d42190a4123e9c7a4de973e3f735a23992487df91549756c8acee81a35f9575f5b3001e748f8b01439f233660a18f4a45b0f32' 'SKIP') validpgpkeys=('474E22316ABF4785A88C6E8EA2C794A986419D8A') # Tom Stellard (.1 releases) validpgpkeys+=('B6C8F98282B944E3B0D5C2530FC3042E345AD05D') # Hans Wennborg (.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 } build() { cd build # https://wiki.archlinux.org/index.php/Clang#Build_packages_with_Clang CFLAGS=${CFLAGS/-fvar-tracking-assignments} CXXFLAGS=${CXXFLAGS/-fvar-tracking-assignments} 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() { cd build ninja check-cxx check-cxxabi } package_libc++() { pkgdesc='LLVM C++ standard library.' depends=("libc++abi=$pkgver-$pkgrel") options=('staticlibs') cd build DESTDIR="$pkgdir" ninja install-libcxx # License. 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') cd build DESTDIR="$pkgdir" ninja install-libcxxabi 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 }