blob: 8d476bfc2652267a6bf046c64e96749dff1bed9b (
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
|
# Contributor Travis Tilley <ttilley@gmail.com>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=clang
pkgver=3.8.1
pkgrel=3
pkgdesc="A C language family front-end for LLVM"
arch="all"
url="http://llvm.org/"
license="UOI-NCSA"
makedepends="
cmake
isl-dev
libxml2-dev
libxml2-utils
llvm
llvm-dev
llvm-static
paxmark
python2
"
depends_dev="$pkgname=$pkgver-r$pkgrel"
subpackages="$pkgname-static $pkgname-dev $pkgname-doc $pkgname-libs
$pkgname-analyzer::noarch"
source="http://llvm.org/releases/$pkgver/cfe-$pkgver.src.tar.xz
clang-0001-Add-Alpine-Linux-distro.patch
clang-0002-Use-z-relro-on-Alpine-Linux.patch
clang-0003-Use-hash-style-gnu-for-Alpine-Linux.patch
clang-0004-Add-musl-targets-and-dynamic-linker.patch
clang-0005-Enable-PIE-by-default-for-alpine-linux.patch
clang-0006-Link-with-z-now-by-default-for-Alpine-Linux.patch
clang-0007-Enable-stack-protector-by-default-for-alpine-linux.patch
"
builddir="$srcdir/cfe-$pkgver.src"
build() {
mkdir -p "$builddir"/build
cd "$builddir"/build
cmake .. -G "Unix Makefiles" -Wno-dev \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_VERBOSE_MAKEFILE=OFF \
-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 \
|| return 1
make clang-tblgen || return 1
make
}
package() {
cd "$builddir"/build
make DESTDIR="$pkgdir" install || return 1
install -m 644 lib/libclang.a "$pkgdir"/usr/lib
}
static() {
pkgdesc="Static libraries for clang"
mkdir -p "$subpkgdir"/usr/lib
mv "$pkgdir"/usr/lib/*.a "$subpkgdir"/usr/lib/
}
analyzer() {
pkgdesc="Clang source code analysis framework"
depends="$pkgname=$pkgver-r$pkgrel perl python2"
cd "$pkgdir"
mkdir -p "$subpkgdir"/usr/bin \
"$subpkgdir"/usr/libexec \
"$subpkgdir"/usr/share/
mv usr/bin/scan-* "$subpkgdir"/usr/bin/ || return 1
mv usr/libexec/*-analyzer "$subpkgdir"/usr/libexec/ || return 1
mv usr/share/scan-* "$subpkgdir"/usr/share/
}
sha512sums="72d23a410271b50f97371b13dd7a6c6c5c0a993e35df436ab716ece8521d83406aa3d4bf8fdecd8154139f39fd5e011e480d405225d8c3ff152d0a2ac4573e04 cfe-3.8.1.src.tar.xz
ed19cb50fe96a5b05754887b055d75f0c0466f77e07e4d4f69b9cea17a3fa88e449d54bd47a791780bee095716cf6b6d8bf16352317192b0ce88d09c603af657 clang-0001-Add-Alpine-Linux-distro.patch
22ad0e449c633f3d5a849207c5e2ed048998e03820c743ad90242d4637c23ba3d2dc8f3c51b923fdfa1891d08d10e934f65dd7b6a90adeb3ce35c3ab923370d3 clang-0002-Use-z-relro-on-Alpine-Linux.patch
c6c1f8693085c375f7039baa64f209834f8fdb8be4c597301e882b3fe099bb91e427beaf6555664e46a4e0aae7dbb4b6e0662a1390c4eaacfdbb138345feb478 clang-0003-Use-hash-style-gnu-for-Alpine-Linux.patch
29e92198d164572ac32d43da40c5d01070d45073cbda2338ff1e3949f6807db722ca9d40a4ef03b21de7e9e9d7b0a61e273b760cf8f302d3ec77d1b0027accc2 clang-0004-Add-musl-targets-and-dynamic-linker.patch
c38f973d9ad8f3e535476cf2b617a2a569a15db8e28c2df0d70252cf69ccbdb29ab18d3aa979b4e66d52128ad0fa654fd0ae503e0cd14b0c265addff1ee35268 clang-0005-Enable-PIE-by-default-for-alpine-linux.patch
af79bb12a75866151edb257377dc5c5f47fa69b03c860ffd0d5d569f18385d642a1cf394c1d375f0fa0a2226637b000bb15f9bf3cacd95972bd465dd8fdbed0c clang-0006-Link-with-z-now-by-default-for-Alpine-Linux.patch
a2a9b307d764fed977299b1b9d130d63a60e65889638b1aadcc082ef021170c8c0c38b4107ceef7b85b057ef2a72bc19a84297f5179afaf697983c19b20cab7b clang-0007-Enable-stack-protector-by-default-for-alpine-linux.patch"
|