# Contributor: Bryce Vandegrift <bryce@brycevandegrift.xyz>
# Maintainer: Bryce Vandegrift <bryce@brycevandegrift.xyz>
pkgname=gambit
pkgver=4.9.5
pkgrel=1
pkgdesc="Portable and efficient implementation of the Scheme language"
url="https://gambitscheme.org/"
# loongarch64: https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/67526
arch="all !loongarch64"
license="LGPL-2.1-only, Apache-2.0"
makedepends="openssl-dev"
subpackages="$pkgname-dev $pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/gambit/gambit/archive/v$pkgver.tar.gz
	tests.patch"

build() {
	./configure --prefix=/usr \
		--libdir=/usr/lib/gambit \
		--docdir=/usr/share/doc/gambit \
		--infodir=/usr/share/info \
		--includedir=/usr/include/gambit \
		--disable-cplusplus \
		--disable-absolute-shared-libs \
		--enable-single-host \
		--enable-gcc-opts \
		--enable-openssl \
		--enable-poll \
		--enable-compiler-name=gambit-gsc
	make
	make doc
}

check() {
	make check
}

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

sha512sums="
d461fa5cce5d030b93165294a3d1dff12935745485e835cfda9164a794d12b1472506c4b4637b7ee7df0a9218f89a30ed6f44cd88557a7a9bf09b573f523c497  gambit-4.9.5.tar.gz
53adf263417997e17ecda51299f6639c8b8812c3399243a61e81736c40d96b503c4cfaa2ee195e8066ac0297fd0d601ecd560b150e9af3813f5b3b8a1f9f6be3  tests.patch
"
