# Contributor: Ben Pye <ben@curlybracket.co.uk>
# Maintainer: Ben Pye <ben@curlybracket.co.uk>
pkgname=libunwind
pkgver=1.2.1
_pkgver=${pkgver/_/-}
pkgrel=1
pkgdesc="Portable and efficient C programming interface (API) to determine the call-chain of a program"
url="http://www.nongnu.org/libunwind/"
arch="all !s390x !x86 !ppc64le"
license="MIT"
depends=""
depends_dev="libexecinfo-dev"
makedepends="$depends_dev autoconf automake libtool linux-headers"
subpackages="$pkgname-dbg $pkgname-dev $pkgname-doc"
source="http://download.savannah.gnu.org/releases/libunwind/libunwind-$_pkgver.tar.gz
	force-enable-man.patch
	fix-UNW_VERSION_MINOR.patch"
builddir="$srcdir/$pkgname-$_pkgver"

build() {
	cd "$builddir"
	autoreconf -f -i

	LDFLAGS="-lexecinfo" ./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var \
		--enable-cxx-exceptions
	make
}

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

sha512sums="af7c280d2a963779a4a2711887618bc96383011e4e5d52e4085aa7fb351e55e357468f6ff85e66a216f1c6826538f498335a917a5970575c93be74c96316319b  libunwind-1.2.1.tar.gz
7c2b9f48b74464c8c27367bfb0ede317bfbc5fc392c0d1371a9a82ae518d3799c019f6e258ec2262c4117c6fb936c40b7cb9f2bfebddb3ea4efbbcbcc4268822  force-enable-man.patch
6efc82cb6ab042da68f982789644896b1dd24d6232f5ffd911f9aedcb01439d6b794c0534b64ee7c39f1ea46fff563e980c6650291440365e577ea0b4abc3436  fix-UNW_VERSION_MINOR.patch"
