aboutsummaryrefslogtreecommitdiffstats
path: root/testing/lldb/APKBUILD
blob: 493babeabb2ffff2e719ce6a0c87ec5111e5ce04 (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
# Contributor: Bartłomiej Piotrowski <bpiotrowski@alpinelinux.org>
# Maintainer:
pkgname=lldb
# Note: Update together with llvm.
pkgver=4.0.0
pkgrel=0
_vermajor=${pkgver%%.*}
pkgdesc="Next generation, high-performance debugger"
arch="all !x86 !ppc64le"
url="http://llvm.org/"
license="UOI-NCSA"
makedepends="
	clang-dev>=$_vermajor
	clang-static>=$_vermajor
	cmake
	doxygen
	libedit-dev
	libffi-dev
	libxml2-dev
	linux-headers
	llvm-dev>=$_vermajor
	llvm-static>=$_vermajor
	ncurses-dev
	ninja
	python2-dev
	swig
	"
subpackages="$pkgname-dev py2-$pkgname:py2"
source="http://llvm.org/releases/$pkgver/$pkgname-$pkgver.src.tar.xz
	musl-include-limits.h.patch
	musl-include-ptrace.aarch64.patch"
builddir="$srcdir/$pkgname-$pkgver.src"

build() {
	mkdir -p "$builddir"/build
	cd "$builddir"/build

	CC=clang CXX=clang++ cmake .. -G Ninja -Wno-dev \
		-DCMAKE_BUILD_TYPE=Release \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DLLVM_LINK_LLVM_DYLIB=ON \
		-DLLDB_DISABLE_LIBEDIT=ON \
		-DPYTHON_EXECUTABLE=/usr/bin/python2
	ninja
}

package() {
	cd "$builddir"/build

	DESTDIR="$pkgdir" ninja install

	# Remove static libraries.
	rm -f "$pkgdir"/usr/lib/*.a
}

py2() {
	pkgdesc="Python module for LLDB"
	depends="$pkgname py2-six"
	replaces="py-lldb"
	local sitedir="usr/lib/python2.7/site-packages"

	mkdir -p "$subpkgdir"/$sitedir
	cd "$subpkgdir"

	mv "$pkgdir"/$sitedir ${sitedir%/*}/

	# Remove bundled module.
	rm $sitedir/six.py

	python2 -m compileall -fqd /$sitedir $sitedir
}

sha512sums="931e8c6e74b66c4ac1c56c9d067309a319aa9a9f4c72d4ed9703be3decefeb8730084ad8c3581e4e31d61cdd4074518d2ed72bacce1e689e087b2f62ad4bb2e8  lldb-4.0.0.src.tar.xz
200b3628f091bd5c4e5de8ebd4f0f4d4746553df50db82704381ece7ae7d4d50b9766a53dd972cd04aea4ea664dbe45ca5ac23a341d436dd8366a591a0c96722  musl-include-limits.h.patch
1613a1cb042edd430aba6b86e4971ebb01f7d2bc3f13a5a1264cb94da7612188897e9dcaaa9233be8af5c8f4bad013dd0cfb821e323cd73dfe07fe125869ccef  musl-include-ptrace.aarch64.patch"