aboutsummaryrefslogtreecommitdiffstats
path: root/community/llvm-libunwind/APKBUILD
blob: ca6e01fcd805f368240d2cf5410c00687f9c8deb (plain) (blame)
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
# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=llvm-libunwind
# Note: Update together with llvm.
pkgver=5.0.2
_pkgname=libunwind
_llvmver=${pkgver%%.*}
pkgrel=0
pkgdesc="LLVM version of libunwind library"
url="http://llvm.org/"
arch="aarch64 armhf armv7 ppc64le x86 x86_64"
license="BSD"
depends_dev="!libunwind-dev"
makedepends="cmake llvm$_llvmver-dev"
subpackages="$pkgname-dev"
source="https://releases.llvm.org/$pkgver/$_pkgname-$pkgver.src.tar.xz
	ppc64le-support.patch"
builddir="$srcdir/$_pkgname-$pkgver.src"
options="!check"

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

	local crossopts=''
	[ "$CBUILD" != "$CHOST" ] && crossopts="
		-DCMAKE_SYSTEM_NAME=Linux
		-DCMAKE_HOST_SYSTEM_NAME=Linux
		-DLIBUNWIND_SYSROOT=$CBUILDROOT"

	cmake .. \
		-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_CONFIG_PATH="/usr/lib/llvm$_llvmver/bin/llvm-config" \
		-DLIBUNWIND_HAS_NODEFAULTLIBS_FLAG=OFF \
		$crossopts
	make
}

package() {
	cd "$builddir"
	make -C build install DESTDIR="$pkgdir"

	mkdir -p "$pkgdir"/usr/include
	cp include/*.h "$pkgdir"/usr/include/
}

sha512sums="137c4b269bff053d532a373e9f696ca68ad0bbf606a18dc98597e00fcfc6ce21d74bc2a0c03b96444654d688fa97d544c6f6b70822fcf7e190ed96f193ddc6ba  libunwind-5.0.2.src.tar.xz
16ebe254c1aa72e6ab350f97a6c4dbfcedb6c014452f8d483b082269ce3be9ef3e96c0c6edc22cc1bac70b59c119b362729ac0d51539f3e255250a86b688f726  ppc64le-support.patch"