# Template file for 'flintlib'
pkgname=flintlib
version=3.4.0
revision=1
build_style=gnu-configure
configure_args="--with-ntl
 $(vopt_if openblas --with-blas-include=${XBPS_CROSS_BASE}/usr/include/openblas)"
hostmakedepends="m4"
makedepends="mpfr-devel ntl-devel $(vopt_if openblas openblas-devel)"
short_desc="Fast Library for Number Theory"
maintainer="Gonzalo Tornaría <tornaria@cmat.edu.uy>"
license="LGPL-3.0-or-later"
homepage="https://flintlib.org"
changelog="https://raw.githubusercontent.com/flintlib/flint/refs/heads/main/doc/source/history.rst"
distfiles="https://github.com/flintlib/flint/releases/download/v${version/+/-}/flint-${version/+/-}.tar.xz"
checksum=0550623c85aa37897638a6b10d267c311a788d137509692d8d858fba10a852da

build_options="openblas"

case "$XBPS_TARGET_MACHINE" in
	x86_64*|i686*|aarch64*|ppc64*) build_options_default+=" openblas";;
esac

CFLAGS="-D_GNU_SOURCE" # needed for cpu_set_t

flintlib-devel_package() {
	depends="${sourcepkg}>=${version}_${revision} mpfr-devel"
	short_desc+=" - development files"
	pkg_install() {
		vmove usr/include
		vmove usr/lib/pkgconfig
		vmove "usr/lib/*.so"
	}
}

arb_package() {
	depends="${sourcepkg}>=${version}_${revision}"
	short_desc+=" - transitional dummy package"
	metapackage=yes
}

arb-devel_package() {
	depends="${sourcepkg}-devel>=${version}_${revision}"
	short_desc+=" - transitional dummy package"
	metapackage=yes
}
