# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=guile
pkgver=2.2.2
pkgrel=2
pkgdesc="Guile is a portable, embeddable Scheme implementation written in C"
url="http://www.gnu.org/software/guile/"
arch="all !s390x"  # disabled due to build failure
license="GPL"
subpackages="$pkgname-dev $pkgname-doc $pkgname-libs"
makedepends="gmp-dev libtool ncurses-dev texinfo libunistring-dev libffi-dev
	gc-dev bash"
depends=
depends_dev="guile gc-dev"
source="ftp://ftp.gnu.org/pub/gnu/$pkgname/$pkgname-$pkgver.tar.gz
	0002-Mark-mutex-with-owner-not-retained-threads-test-as-u.patch
	stacksize.patch
	"

builddir="$srcdir"/$pkgname-$pkgver

build() {
	cd "$builddir"
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--disable-error-on-warning \
		--disable-static \
		--with-threads
	make
}

package() {
	cd "$builddir"
	make DESTDIR="$pkgdir" install
	rm "$pkgdir"/usr/lib/charset.alias
}

sha512sums="dfc4a413faa8d7cd111beb3673e52be3d95c5c408c6796c874cdd01c095a05bc266856c45067aef3b931889349980d0985dde269aabde18f21659d02f5c2344d  guile-2.2.2.tar.gz
54a9fe0fa2ea83da7ae61f96612e3e653ec80f60ab41d1995dc44bd05c7ff68cc4fab36a655e8835c4ab1cf0966765a299ef2d73cb9f69d3ef955e6aeaa8062d  0002-Mark-mutex-with-owner-not-retained-threads-test-as-u.patch
01fdb59b3580cab538e68956b431e8246775fe43a1771e252859c1ca231a7c228abd39c50e64b332dc45325debe8f1b23680a6f81994f30b1fa7615f8a323dfc  stacksize.patch"