102.11.0-1
[arch-packages.git] / lld / repos / extra-x86_64 / PKGBUILD
blob0da4780919ebcc0513a5b99b3d661a035b925266
1 # Maintainer: Evangelos Foutras <evangelos@foutrelis.com>
2 # Contributor: Jan "heftig" Steffens <jan.steffens@gmail.com>
4 pkgname=lld
5 pkgver=15.0.7
6 pkgrel=2
7 pkgdesc="Linker from the LLVM project"
8 arch=('x86_64')
9 url="https://lld.llvm.org/"
10 license=('custom:Apache 2.0 with LLVM Exception')
11 depends=('llvm-libs')
12 makedepends=('llvm' 'cmake' 'ninja' 'python-sphinx')
13 options=('!lto') # LTO causes a couple of test failures
14 _source_base=https://github.com/llvm/llvm-project/releases/download/llvmorg-$pkgver
15 source=($_source_base/lld-$pkgver.src.tar.xz{,.sig}
16         $_source_base/llvm-$pkgver.src.tar.xz{,.sig}
17         $_source_base/libunwind-$pkgver.src.tar.xz{,.sig}
18         $_source_base/cmake-$pkgver.src.tar.xz{,.sig})
19 sha256sums=('dba5c70c3fe88b3a38b9180df82fbc9d1dfd55d68f41fddd6a90f9e17f8e5df9'
20             'SKIP'
21             '4ad8b2cc8003c86d0078d15d987d84e3a739f24aae9033865c027abae93ee7a4'
22             'SKIP'
23             '406d199ae3a16add84017f40458a5e7c31f9412937fcb518715af0a0eeafbc0c'
24             'SKIP'
25             '8986f29b634fdaa9862eedda78513969fe9788301c9f2d938f4c10a3e7a3e7ea'
26             'SKIP')
27 validpgpkeys=('474E22316ABF4785A88C6E8EA2C794A986419D8A'  # Tom Stellard <tstellar@redhat.com>
28               'D574BD5D1D0E98895E3BF90044F2485E45D59042') # Tobias Hieta <tobias@hieta.se>
30 prepare() {
31   # https://bugs.llvm.org/show_bug.cgi?id=49228
32   mv libunwind{-$pkgver.src,}
34   mv cmake{-$pkgver.src,}
35   cd lld-$pkgver.src
36   mkdir build
39 build() {
40   cd lld-$pkgver.src/build
42   local cmake_args=(
43     -G Ninja
44     -DCMAKE_BUILD_TYPE=Release
45     -DCMAKE_INSTALL_PREFIX=/usr
46     -DCMAKE_INSTALL_DOCDIR=share/doc
47     -DCMAKE_SKIP_RPATH=ON
48     -DBUILD_SHARED_LIBS=ON
49     -DLLVM_BUILD_DOCS=ON
50     -DLLVM_ENABLE_SPHINX=ON
51     -DLLVM_EXTERNAL_LIT=/usr/bin/lit
52     -DLLVM_INCLUDE_TESTS=ON
53     -DLLVM_LINK_LLVM_DYLIB=ON
54     -DLLVM_MAIN_SRC_DIR="$srcdir/llvm-$pkgver.src"
55     -DSPHINX_WARNINGS_AS_ERRORS=OFF
56   )
57   cmake .. "${cmake_args[@]}"
58   ninja
61 check() {
62   cd lld-$pkgver.src/build
63   ninja check-lld
66 package() {
67   cd lld-$pkgver.src/build
69   DESTDIR="$pkgdir" ninja install
70   install -Dm644 ../LICENSE.TXT "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
72   # https://bugs.llvm.org/show_bug.cgi?id=42455
73   install -Dm644 -t "$pkgdir/usr/share/man/man1" ../docs/ld.lld.1
75   # Remove documentation sources
76   rm -r "$pkgdir"/usr/share/doc/lld/html/{_sources,.buildinfo}
79 # vim:set ts=2 sw=2 et: