blob: 77f9a2742ca9a81e5e2a20d5e968c79ec219345f (
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
|
# Contributor: William Pitcock <nenolod@dereferenced.org>
# Maintainer: William Pitcock <nenolod@dereferenced.org>
pkgname=llvm
pkgver=3.2
pkgrel=3
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
llvm-3.2-alpine-linux.patch
"
# 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
prepare() {
mkdir "$_builddir"
msg "Preparing CLANG sources..."
mv "$srcdir"/clang-$pkgver.src \
"$srcdir"/$pkgname-$pkgver.src/tools/clang || return 1
msg "Patching LLVM core..."
cd "$srcdir"/$pkgname-$pkgver.src || 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
}
build() {
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
../$pkgname-$pkgver.src/configure \
--prefix=/usr \
--sysconfdir=/etc \
--mandir=/usr/share/man \
--infodir=/usr/share/info \
--enable-ffi \
--enable-shared \
|| 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
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
}
libs() {
pkgdesc="LLVM shared libraries"
mkdir -p "$subpkgdir"/usr/lib/
mv "$pkgdir"/usr/lib/*.so "$subpkgdir"/usr/lib/
}
md5sums="71610289bbc819e3e15fdd562809a2d7 llvm-3.2.src.tar.gz
3896ef4334df08563b05d0848ba80582 clang-3.2.src.tar.gz
3014842ee498ffe044773ef3a7f859ca llvm-3.2-alpine-linux.patch"
sha256sums="125090c4d26740f1d5e9838477c931ed7d9ad70d599ba265f46f3a42cb066343 llvm-3.2.src.tar.gz
2aaaf03f7c0f6b16fe97ecc81247dc2bf2d4bec7620a77cc74670b7e07ff5658 clang-3.2.src.tar.gz
0496f84b97131b393662f4031bf7e117caaa29702bea569e8d4d783093c3067f llvm-3.2-alpine-linux.patch"
sha512sums="cc66171322dbbe40bcac0e0ea5b09df8ff52df63ded304f841f32f702270d6ab1512216413ee52498c3ebee8cd39c4cd23e3855d591944bc2ac0ae76f5be62cc llvm-3.2.src.tar.gz
99fc57d19b76c42af9821eaaa762056a926eb68178f6b7dd5e8bf092c9ee201a554b91d760d5a30a57f38102eae340e080ef8c6a39327f6881eda391b20b108d clang-3.2.src.tar.gz
3878cfff1ab702c275d47b831751d87b2a112223ea6fe1fcc30e5f8e06b2fedf4f07b8ca9c65b3e6ac35dc6feba8d91a8b0579f9b2fe194ccdb202c2b9338640 llvm-3.2-alpine-linux.patch"
|