# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=gc
pkgver=8.2.6
pkgrel=0
pkgdesc="garbage collector for C and C++"
url="https://hboehm.info/gc/"
arch="all"
license="Boehm-GC"
makedepends="linux-headers"
subpackages="$pkgname-dbg $pkgname-dev $pkgname-doc libgc++:libgccpp"
source="https://github.com/ivmai/bdwgc/releases/download/v$pkgver/gc-$pkgver.tar.gz"

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--datadir=/usr/share/doc/gc \
		--enable-static \
		--enable-cplusplus
	make
}

check() {
	make check
}

package() {
	make DESTDIR="$pkgdir" install
	install -Dm644 README.md "$pkgdir/usr/share/licenses/$pkgname/README.md"
}

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

sha512sums="
48afcc1d8570d6b5d62addf8b7b947a3836717e71c073f6dff8982744c06f5973a02e890d17e8dd93f7f997d029b49c652929e6efa0e32aefbcdf7ab0910eda5  gc-8.2.6.tar.gz
"
