blob: 40b4a5945559d80361f83c031b497f0ff861a8f6 (
plain)
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
|
# Contributor: William Pitcock <nenolod@dereferenced.org>
# Maintainer: William Pitcock <nenolod@dereferenced.org>
pkgname=llvm
pkgver=3.4
pkgrel=0
pkgdesc="low level virtual machine compiler system"
arch="x86 x86_64"
url="http://llvm.org/"
license="UOI-NCSA"
depends=
depends_dev="perl"
makedepends="$depends_dev groff libffi-dev python chrpath"
install=
subpackages="clang $pkgname-dev $pkgname-doc $pkgname-libs"
source="http://llvm.org/releases/$pkgver/llvm-$pkgver.src.tar.gz
http://llvm.org/releases/$pkgver/clang-$pkgver.src.tar.gz
"
# clang hardcodes linker paths; and don't know of a fix like the --with-dynamic-linker
# patch we use for gcc. So llvm-3.2-alpine-linux.patch needs to be updated if/when the
# uClibc ABI version (as of uClibc 0.9.33.2, this is 0.9.32) increases.
_builddir="$srcdir"/build
_srcdir="$srcdir"/"$pkgname-$pkgver.src"
prepare() {
msg "Preparing CLANG sources..."
mv "$srcdir"/clang-$pkgver \
"$srcdir"/$pkgname-$pkgver/tools/clang || return 1
msg "Patching LLVM core..."
cd "$srcdir"/$pkgname-$pkgver || return 1
update_config_sub || return 1
for i in $source; do
case $i in
*.patch)
msg "Applying $i..."
patch -s -p1 -N -i "$srcdir"/$i || return 1
;;
esac
done
# fails to link
#rm ./unittests/Support/formatted_raw_ostream_test.cpp
}
build() {
mkdir "$_builddir"
cd "$_builddir"
export CBUILD
sed -i -e '/case "\${UNAME_MACHINE}:\${UNAME_SYSTEM}:\${UNAME_RELEASE}:\${UNAME_VERSION}" in/i \' \
-e 'if [ x != "x$CBUILD" ]; then echo "$CBUILD"; exit; fi' \
../$pkgname-$pkgver.src/autoconf/config.guess \
../$pkgname-$pkgver.src/projects/sample/autoconf/config.guess \
|| return 1
$_srcdir/configure \
--build=$CBUILD \
--host=$CHOST \
--prefix=/usr \
--sysconfdir=/etc \
--mandir=/usr/share/man \
--infodir=/usr/share/info \
--enable-ffi \
--enable-shared \
--enable-optimized \
|| return 1
# configure gets it wrong. We do have error_t
sed -i -e 's/.*undef HAVE_ERROR_T.*/#define HAVE_ERROR_T 1/' \
-e '/define error_t/d' \
./include/llvm/Config/config.h || return 1
make || return 1
}
package() {
cd "$_builddir"
make DESTDIR="$pkgdir" install
#relocate docs
mkdir -p "$pkgdir"/usr/share/doc
mv "$pkgdir"/usr/docs/llvm "$pkgdir"/usr/share/doc/ || return 1
rmdir "$pkgdir"/usr/docs || return 1
chrpath -d "$pkgdir"/usr/bin/* "$pkgdir"/usr/lib/*.so
}
clang() {
pkgdesc="A C language family front-end for LLVM"
mkdir -p "$subpkgdir"/usr/bin \
"$subpkgdir"/usr/lib "$subpkgdir"/usr/share/clang
mv "$pkgdir"/usr/bin/clang* "$pkgdir"/usr/bin/c-index-test \
"$subpkgdir"/usr/bin/ || return 1
mv "$pkgdir"/usr/lib/clang \
"$pkgdir"/usr/lib/libclang.so \
"$subpkgdir"/usr/lib/ || return 1
cp -r "$_srcdir"/tools/clang/tools/scan-build "$subpkgdir"/usr/share/clang/scan-build
cp -r "$_srcdir"/tools/clang/tools/scan-view "$subpkgdir"/usr/share/clang/scan-view
ln -s /usr/share/clang/scan-build/scan-build "$subpkgdir"/usr/bin/scan-build
ln -s /usr/share/clang/scan-view/scan-view "$subpkgdir"/usr/bin/scan-view
}
libs() {
pkgdesc="LLVM shared libraries"
mkdir -p "$subpkgdir"/usr/lib/
mv "$pkgdir"/usr/lib/*.so "$subpkgdir"/usr/lib/
}
md5sums="46ed668a1ce38985120dbf6344cf6116 llvm-3.4.src.tar.gz
b378f1e2c424e03289effc75268d3d2c clang-3.4.src.tar.gz
18f9165003a5b86101547d40ec5d3036 llvm-3.3-alpine-linux.patch
517019fb4907cf5944c84315c681f905 llvm-musl.patch"
sha256sums="25a5612d692c48481b9b397e2b55f4870e447966d66c96d655241702d44a2628 llvm-3.4.src.tar.gz
22a9780db3b85a7f2eb9ea1f7f6e00da0249e3d12851e8dea0f62f1783242b1b clang-3.4.src.tar.gz
5a6e40c7ffe280534ce964eaca5bc8ec325cb747f8de1390f534be2944c72361 llvm-3.3-alpine-linux.patch
3b653520e79933058e9b4ab0943a364a87babe8e5e6b520ac15660c146302c74 llvm-musl.patch"
sha512sums="4ccd8c4fc15dd9abc43f93b62f0b1349c419a2afeba05304fa98c157325e31dbbdb1587afc18d0a3f5dba14c95d64a3d40a825efe89ddf6f93fa96002496675c llvm-3.4.src.tar.gz
eac282c26d46d04f3e74c6a34629aa6496882aa6f64387728be86de3eba963a97388fd4214aea7d47a801215e61c0a54663d65474effec8be2e39be1b1ed89f1 clang-3.4.src.tar.gz
d240f0fbef611b9863cbe1a79c10b4383dabf8be2ee49fd0f853d23fb0b4c935a41f3d50456a05815102834f2a4b1ac3c9334b444ed3868b7f3fb24e14ff14eb llvm-3.3-alpine-linux.patch
52f9791a11c103ff8d1a35e0fd94a9d8e1379fd6f8046e346f52686bb256ca969ead77059271931ac1fff5581146dd7e3862a3a14d85b96555b8823e807f2d70 llvm-musl.patch"
|