1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
|
# Maintainer: jakbyte <jakbyte@protonmail.com>
# Contributor: jakbyte <jakbyte@protonmail.com>
pkgname=("lld7" "lld7-headers" "lld7-libs" "lld7-libs-static" "lld7-docs")
pkgdesc="Linker from the LLVM project."
pkgver="7.1.0"
pkgrel="2"
arch=("x86_64")
url="https://lld.llvm.org/"
license=("custom:University of Illinois/NCSA Open Source License")
makedepends=("llvm7" "cmake" "ninja" "python-sphinx")
conflicts=("lld")
_source_prefix=https://github.com/llvm/llvm-project/releases/download/llvmorg-$pkgver
source=($_source_prefix/lld-$pkgver.src.tar.xz{,.sig}
$_source_prefix/llvm-$pkgver.src.tar.xz{,.sig}
sphinx2.patch)
sha256sums=("a10f274a0a09408eaf9c088dec6fb2254f7d641221437763c94546cbfe595867"
"SKIP"
"1bcc9b285074ded87b88faaedddb88e6b5d6c331dfcfb57d7f3393dd622b3764"
"SKIP"
"7f7cca66a16c5a4aca132bfa1d86a7a2ff33612ec47d3422dc91ad4cc1810646")
validpgpkeys+=("474E22316ABF4785A88C6E8EA2C794A986419D8A") # Tom Stellard <tstellar@redhat.com>
prepare() {
cd "$srcdir/lld-$pkgver.src"
mkdir build
mkdir build/static
# https://bugs.llvm.org/show_bug.cgi?id=41789
patch -Np1 -i ../sphinx2.patch
}
build() {
# Build lld.
cd "$srcdir/lld-$pkgver.src/build"
cmake .. -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr \
-DPYTHON_EXECUTABLE=/usr/bin/python \
-DBUILD_SHARED_LIBS=ON \
-DLLVM_LINK_LLVM_DYLIB=ON \
-DLLVM_INCLUDE_TESTS=ON \
-DLLVM_BUILD_TESTS=ON \
-DLLVM_BUILD_DOCS=ON \
-DLLVM_ENABLE_SPHINX=ON \
-DLLVM_EXTERNAL_LIT=/usr/bin/lit \
-DLLVM_MAIN_SRC_DIR="$srcdir/llvm-$pkgver.src"
ninja
# Build lld with static libraries.
cd "$srcdir/lld-$pkgver.src/build/static"
cmake ../.. -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr \
-DPYTHON_EXECUTABLE=/usr/bin/python \
-DBUILD_SHARED_LIBS=OFF \
-DLLVM_LINK_LLVM_DYLIB=ON \
-DLLVM_INCLUDE_TESTS=ON \
-DLLVM_BUILD_TESTS=ON \
-DLLVM_BUILD_DOCS=ON \
-DLLVM_ENABLE_SPHINX=ON \
-DLLVM_EXTERNAL_LIT=/usr/bin/lit \
-DLLVM_MAIN_SRC_DIR="$srcdir/llvm-$pkgver.src"
ninja
}
check() {
# Run the tests.
cd "$srcdir/lld-$pkgver.src/build"
}
package_lld7() {
pkgdesc="Linker from the LLVM project."
depends=("lld7-headers" "lld7-libs" "llvm7-libs")
# Install lld.
cd "$srcdir/lld-$pkgver.src/build"
DESTDIR="$pkgdir" ninja install
# Remove header, shared library, and documentation files.
rm -r "$pkgdir"/usr/{include,lib,share/doc}
# Install the license.
install -Dm644 ../LICENSE.TXT "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}
package_lld7-headers() {
pkgdesc="Headers from the linker from the LLVM project."
depends=("llvm7-libs")
# Install lld.
cd "$srcdir/lld-$pkgver.src/build"
DESTDIR="$pkgdir" ninja install
# Remove binary, shared library, and documentation files.
rm -r "$pkgdir"/usr/{bin,lib,share/doc}
# Install the license.
install -Dm644 ../LICENSE.TXT "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}
package_lld7-libs() {
pkgdesc="Shared libraries from the linker from the LLVM project."
depends=("llvm7-libs")
# Install lld.
cd "$srcdir/lld-$pkgver.src/build"
DESTDIR="$pkgdir" ninja install
# Remove binary, header, and documentation files.
rm -r "$pkgdir"/usr/{bin,include,share/doc}
# Install the license.
install -Dm644 ../LICENSE.TXT "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}
package_lld7-libs-static() {
pkgdesc="Static libraries from the linker from the LLVM project."
depends=("llvm7-libs")
# Install lld.
cd "$srcdir/lld-$pkgver.src/build/static"
DESTDIR="$pkgdir" ninja install
# Remove binary, header, and documentation files.
rm -r "$pkgdir"/usr/{bin,include,share/doc}
# Install the license.
install -Dm644 ../../LICENSE.TXT "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}
package_lld7-docs() {
pkgdesc="Documentation from the linker from the LLVM project."
# Install lld.
cd "$srcdir/lld-$pkgver.src/build"
DESTDIR="$pkgdir" ninja install
# Remove binary, header, shared library, and documentation source files.
rm -r "$pkgdir"/usr/{bin,include,lib,share/doc/lld/html/{_sources,.buildinfo}}
# Install the license.
install -Dm644 ../LICENSE.TXT "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}
|