aboutsummaryrefslogtreecommitdiffstats
path: root/testing/lldb/APKBUILD
blob: d729813e235530daa92ebd9141ef82b22709e39e (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
# Contributor: Bartłomiej Piotrowski <bpiotrowski@alpinelinux.org>
# Maintainer: Rasmus Thomsen <oss@cogitri.dev>
pkgname=lldb
# Note: Update together with llvm.
pkgver=8.0.1
pkgrel=0
_vermajor=${pkgver%%.*}
pkgdesc="Next generation, high-performance debugger"
arch="aarch64 armv7 s390x x86_64"
url="https://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-static $pkgname-dev py2-$pkgname:py2"
source="https://github.com/llvm/llvm-project/releases/download/llvmorg-8.0.1/lldb-8.0.1.src.tar.xz
	fix-embedded_interpreter.patch
	cmake-include-ClangConfig.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=MinSizeRel \
		-DCMAKE_C_FLAGS_MINSIZEREL_INIT="$CFLAGS" \
		-DCMAKE_CXX_FLAGS_MINSIZEREL_INIT="$CXXFLAGS" \
		-DCMAKE_EXE_LINKER_FLAGS_MINSIZEREL_INIT="$LDFLAGS" \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DLLVM_LINK_LLVM_DYLIB=ON \
		-DLLDB_DISABLE_LIBEDIT=ON \
		-DLLDB_TEST_C_COMPILER=clang \
		-DLLDB_TEST_CXX_COMPILER=clang++ \
		-DPYTHON_EXECUTABLE=/usr/bin/python2
	ninja
}

package() {
	cd "$builddir"/build

	DESTDIR="$pkgdir" ninja install
}

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%/*}/
	rmdir "$pkgdir"/${sitedir%/*}

	# Move binary lib to the module's directory.
	mv $sitedir/readline.so $sitedir/lldb/

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

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

sha512sums="eb031985ad4d08226ec47a90fe32c1e6d070948971ca5235fd431cf7d5b7ea20f5d5131237bf83a6419773d18c339590bf9672e7b4f884304497e63c1030988f  lldb-8.0.1.src.tar.xz
3c611fa5d45b6cb3f2925a31deeb8a34c295277aedcd55c22851d373897acd376fa92f4ef953c96a25c8dae4c93b6a88de0918550672141d324a3813d8283d48  fix-embedded_interpreter.patch
0edf6e750cd9367fccb32636c37b3d21bb781173b182b8e4b537c19c1b49898f792a3fa8139e50129af4570736e6dcda6bf390357b367c1f00179fc2b0fb6d62  cmake-include-ClangConfig.patch"