summaryrefslogtreecommitdiff
path: root/user/gc/APKBUILD
blob: 96cb7d5ff990d1f75a82cb8b141f27e9a8596c26 (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
# Maintainer: A. Wilcox <awilfox@adelielinux.org>
pkgname=gc
pkgver=7.6.8
pkgrel=0
pkgdesc="A garbage collector for C and C++"
url="http://hboehm.info/gc/"
arch="all"
license="MIT"
makedepends="libatomic_ops-dev linux-headers"
subpackages="$pkgname-dev $pkgname-doc libgc++:libgccpp"
source="https://github.com/ivmai/bdwgc/releases/download/v$pkgver/$pkgname-$pkgver.tar.gz
	fix-boehm-gc.patch
	"
builddir="$srcdir/gc-${pkgver%[a-z]}"

build() {
	cd "$builddir"

	if [ "$CLIBC" = "musl" ]; then
		export CFLAGS="$CFLAGS -D_GNU_SOURCE -DNO_GETCONTEXT -DUSE_MMAP -DHAVE_DL_ITERATE_PHDR"
	fi
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--datadir=/usr/share/doc/gc \
		--enable-cplusplus
	make
}

check() {
	cd "$builddir"

	if [ "$CARCH" = "ppc" ]; then
		make check || true
	else
		make check
	fi
}

package() {
	cd "$builddir"
	make DESTDIR="$pkgdir" install
}

libgccpp() {
	install -d "$subpkgdir"/usr/lib
	mv "$pkgdir"/usr/lib/libgccpp.* "$subpkgdir"/usr/lib/
}

sha512sums="525e84e3de0575a76dc994f746fb60f829c850442b6e4dbec5482000a478bb63b9e8d5ac6ddf677a341312207e228eb64442fd7b177223b86efbb9cef3e74aec  gc-7.6.8.tar.gz
6439505931f0d023bf27d6ce0af90d09dc23bb9dd49b561566ec54b2cddc20642be9bd7b41203f643cb6efed3db2f54aef410b436f3acc2351fe4bb0a8791ea4  fix-boehm-gc.patch"