# Contributor: Grigory Kirillov <txgk@bk.ru>
# Maintainer:
pkgname=libsymmetrica
pkgver=3.0.1
pkgrel=2
pkgdesc="Library with a collection of routines for combinatorial mathematics"
url="https://gitlab.com/sagemath/symmetrica"
arch="all"
license="ISC"
makedepends="autoconf automake libtool"
source="https://gitlab.com/sagemath/symmetrica/-/archive/$pkgver/symmetrica-$pkgver.tar.gz"
subpackages="$pkgname-static $pkgname-dev"
builddir="$srcdir/symmetrica-$pkgver"

prepare() {
	default_prepare
	autoreconf -fi
}

build() {
	export CFLAGS="${CFLAGS/-Os/-O3}" # gotta go fast

	./configure \
		--target="$CTARGET" \
		--build="$CBUILD" \
		--host="$CHOST" \
		--prefix=/usr
	make
}

check() {
	make check
}

package() {
	make DESTDIR="$pkgdir" install
	# It has just a README.md from repository.
	rm -r "${pkgdir:?}"/usr/share
}

sha512sums="
fd663ba1bf0d6ca91aa67cbb642f2a9150c7e938f3fef54b4227f67e1269b9f5b64af597aaebf158ce936441025d348db907fa0cbf0d7ddeca19985e8ea565de  symmetrica-3.0.1.tar.gz
"
