blob: 51c1671892c318a082713c0f1bb3e293789651e4 (
plain) (
blame)
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
|
# Contributor Travis Tilley <ttilley@gmail.com>
# Maintainer: A. Wilcox <awilfox@adelielinux.org>
pkgname=clang
# Note: Update together with llvm.
pkgver=14.0.6
pkgrel=0
_llvmver=${pkgver%%.*}
pkgdesc="A C language family front-end for LLVM"
arch="all"
options="!dbg"
url="https://llvm.org/"
license="NCSA"
depends_dev="$pkgname=$pkgver-r$pkgrel"
makedepends="cmake isl-dev libedit-dev libexecinfo-dev libxml2-dev libxml2-utils
llvm${_llvmver}-dev llvm${_llvmver}-static llvm${_llvmver}-test-utils
z3 z3-dev"
subpackages="$pkgname-static $pkgname-dev $pkgname-doc $pkgname-libs
$pkgname-analyzer::noarch"
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
0001-Add-support-for-Ad-lie-Linux.patch
cfe-005-ppc64-dynamic-linker-path.patch
ppc64-elfv2.patch
use-llvm-lit.patch
"
builddir="$srcdir/$pkgname-$pkgver.src"
build() {
CMAKE_PREFIX_PATH=/usr/lib/llvm$_llvmver/lib/cmake \
cmake -Wno-dev \
-DCMAKE_BUILD_TYPE=MinSizeRel \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_VERBOSE_MAKEFILE=OFF \
-DCLANG_VENDOR=${DISTRO_SHORT_NAME:-Adélie} \
-DCLANG_BUILD_EXAMPLES=OFF \
-DCLANG_INCLUDE_DOCS=ON \
-DCLANG_INCLUDE_TESTS=ON \
-DCLANG_PLUGIN_SUPPORT=ON \
-DLIBCLANG_BUILD_STATIC=ON \
-DLLVM_ENABLE_EH=ON \
-DLLVM_ENABLE_RTTI=ON \
-DLLVM_MAIN_SRC_DIR="$srcdir/llvm-$pkgver.src" \
-DLLVM_EXTERNAL_LIT="$builddir/build/bin/llvm-lit" \
-Bbuild \
.
make -C build clang-tblgen
# too memory hungry
if [ -z "$JOBS" ] || [ $JOBS -gt 32 ]; then
make -C build -j32
else
make -C build
fi
}
check() {
[ -f build/bin/llvm-lit ] || ln -s /usr/bin/lit build/bin/llvm-lit
make -C build check-clang
}
package() {
local _dir _file
make DESTDIR="$pkgdir" -C build install
install -m 644 build/lib/libclang.a "$pkgdir"/usr/lib
# mozilla will never be happy
mkdir -p "$pkgdir"/usr/lib/llvm$_llvmver/bin
mkdir -p "$pkgdir"/usr/lib/llvm$_llvmver/lib
for _dir in bin lib; do
cd "$pkgdir"/usr/$_dir
for _file in *; do
[ -f $_file ] || continue
ln -s "../../../$_dir/$_file" \
"$pkgdir"/usr/lib/llvm$_llvmver/$_dir/$_file
done
cd "$OLDPWD"
done
# needed for at least Qt Creator
mkdir -p "$pkgdir"/usr/include/llvm$_llvmver
ln -s ../clang "$pkgdir"/usr/include/llvm$_llvmver/clang
ln -s ../clang-c "$pkgdir"/usr/include/llvm$_llvmver/clang-c
}
static() {
pkgdesc="Static libraries for clang"
mkdir -p "$subpkgdir"/usr/lib
mv "$pkgdir"/usr/lib/*.a "$subpkgdir"/usr/lib/
strip -d "$subpkgdir"/usr/lib/*.a
}
analyzer() {
pkgdesc="Clang source code analysis framework"
depends="$pkgname=$pkgver-r$pkgrel perl python3"
cd "$pkgdir"
mkdir -p "$subpkgdir"/usr/bin \
"$subpkgdir"/usr/libexec \
"$subpkgdir"/usr/share/
mv usr/bin/scan-* "$subpkgdir"/usr/bin/
mv usr/libexec/*-analyzer "$subpkgdir"/usr/libexec/
mv usr/share/scan-* "$subpkgdir"/usr/share/
}
sha512sums="5f5497b57dd116225e90f321902f1015beb50c0b1bb90d0fc6c026f13aa748feabe44f98eb75e86f98f3b1785ad5e850210732f3eae75b942ecd520527dcd30b clang-14.0.6.src.tar.xz
6461bdde27aac17fa44c3e99a85ec47ffb181d0d4e5c3ef1c4286a59583e3b0c51af3c8081a300f45b99524340773a3011380059e3b3a571c3b0a8733e96fc1d llvm-14.0.6.src.tar.xz
7f422f671167498102789e8c0b3ab4e46d6a4433d89f0f6b2cf0736ad257146e5eeb04b6f1d9431cce4635c9691d0cc80e643f852269bf7119ce312ae9bb8068 0001-Add-support-for-Ad-lie-Linux.patch
b3c999ef1e380b02a25f1ebca4811f1c696b88309b73af0c19865e3b92084becc9529b910d24b4fb7133606c1e105860104017406d876f95e9260c716348bd1c cfe-005-ppc64-dynamic-linker-path.patch
4f534e72cf3ec9134d9f77a1a787c84859a5ee84b52da529d47745eb7d75d383070573018588bfbf622e826fcb281fdf20fa79217024df5cb824e6ae1ea1d7bf ppc64-elfv2.patch
1f93918d512849e8bf7eb4e71d2b623c0ae3361e4b6ed5b50b76b0fe78e3d70f8773061b1ea0f327950a4f7c2ffdcdaafcb224301732df2a7469c742e8f5883f use-llvm-lit.patch"
|