# Contributor: Carlo Landmeter <clandmeter@alpinelinux.org>
# Maintainer: Will Sinatra <wpsinatra@gmail.com>
pkgname=ffcall
pkgver=2.5
pkgrel=0
pkgdesc="C library for implementing foreign function calls in embedded interpreters"
url="https://www.gnu.org/software/libffcall"
arch="all !loongarch64 !riscv64"
license="GPL-2.0-or-later"
makedepends="$depends_dev"
subpackages="$pkgname-doc"
source="https://ftp.gnu.org/gnu/libffcall/libffcall-$pkgver.tar.gz"

builddir="$srcdir"/libffcall-$pkgver

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--localstatedir=/var \
		--disable-static
	make -j1
}

check() {
	make check
}

package() {
	make DESTDIR="$pkgdir" htmldir=/usr/share/doc/ffcall install

	# One of the static libraries is not disabled by --disable-static
	# while all others are, so remove it here
	rm -f "$pkgdir"/usr/lib/*.a
}

sha512sums="
5e5b1c34b9e66bde00e1deea464099ef09e439070e8180c04f2520442933e369e76632346ae59a5720356128787e88255bd75764736ac9b5334a592eb6cf5878  libffcall-2.5.tar.gz
"
