pkgname=lld pkgver=19.1.6 pkgrel=1 pkgdesc="Linker from the LLVM project" arch=('x86_64') url="https://lld.llvm.org/" license=('Apache-2.0 WITH LLVM-exception') depends=('llvm-libs' 'gcc-libs' 'zlib' 'zstd') makedepends=('llvm' 'cmake' 'ninja' 'python-sphinx') source=(https://github.com/llvm/llvm-project/releases/download/llvmorg-${pkgver}/${pkgname}-${pkgver}.src.tar.xz https://github.com/llvm/llvm-project/releases/download/llvmorg-${pkgver}/llvm-${pkgver}.src.tar.xz https://github.com/llvm/llvm-project/releases/download/llvmorg-${pkgver}/libunwind-${pkgver}.src.tar.xz https://github.com/llvm/llvm-project/releases/download/llvmorg-${pkgver}/cmake-${pkgver}.src.tar.xz) sha256sums=(44fa50556cefbe3796e8256536267ee2f34ced5f3c1492473bccd75449cadbe6 ad1a3b125ff014ded290094088de40efb9193ce81a24278184230b7d401f8a3e 34eab971069837be770e44f3543f1eb50f385575e8f29d1b5e1a67e7c482f680 9c7ec82d9a240dc2287b8de89d6881bb64ceea0dcd6ce133c34ef65bda22d99e) prepare() { # https://bugs.llvm.org/show_bug.cgi?id=49228 mv libunwind{-${pkgver}.src,} mv cmake{-${pkgver}.src,} } build() { cd ${pkgname}-${pkgver}.src local cmake_args=( -B flarebird-build -G Ninja -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/usr -D LLVM_LIBDIR_SUFFIX=64 -D CMAKE_INSTALL_DOCDIR=share/doc -D CMAKE_SKIP_INSTALL_RPATH=ON -D BUILD_SHARED_LIBS=ON -D LLVM_BUILD_DOCS=ON -D LLVM_ENABLE_SPHINX=ON -D LLVM_EXTERNAL_LIT=/usr/bin/lit -D LLVM_INCLUDE_TESTS=ON -D LLVM_LINK_LLVM_DYLIB=ON -D LLVM_MAIN_SRC_DIR="${srcdir}/llvm-${pkgver}.src" -D SPHINX_WARNINGS_AS_ERRORS=OFF ) cmake ${cmake_args[@]} ninja -C flarebird-build } package() { cd ${pkgname}-${pkgver}.src DESTDIR=${pkgdir} ninja -C flarebird-build install # https://bugs.llvm.org/show_bug.cgi?id=42455 install -Dm644 -t ${pkgdir}/usr/share/man/man1 docs/ld.lld.1 # Remove documentation sources rm -r ${pkgdir}/usr/share/doc/lld/html/{_sources,.buildinfo} }