# Template file for 'flintlib'
pkgname=flintlib
version=2.8.1
revision=1
wrksrc="flint-${version}"
build_style=configure
configure_args="--prefix=/usr --with-gmp=/usr --with-mpfr=/usr $(vopt_if ntl --with-ntl=/usr)"
makedepends="mpfr-devel $(vopt_if ntl ntl-devel)"
short_desc="Fast Library for Number Theory"
maintainer="Gonzalo Tornaría <tornaria@cmat.edu.uy>"
license="LGPL-2.1-or-later"
homepage="https://flintlib.org"
distfiles="https://flintlib.org/flint-${version}.tar.gz"
checksum=edfdda7a7cb847db4e55e050349259cbc9778589686007fb45602d36ecfb427e

build_options="ntl"
desc_option_ntl="enable NTL support"

if [ -z "$CROSS_BUILD" ]; then
	build_options_default+=" ntl"
fi

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/*.a"
		vmove "usr/lib/*.so"
	}
}
