void-packages/srcpkgs/pari/template
Gonzalo Tornaría 0fa23a6372 pari: update to 2.13.2.
- enable pthreads build
- switch gp binary to static link libpari; this offsets the slowdown due
  to pthreads
- use -flto and -fno-semantic-interposition which improve speed a little
  bit more
- ship the static library, so external programs can static link
- change of maintainer agreed by sgn

I had to add a minimal patch to the makefile, so that the build step
builds and the install step installs. I will try to upstream that patch.
2021-08-15 00:48:02 -03:00

61 lines
1.7 KiB
Bash

# Template file for 'pari'
pkgname=pari
version=2.13.2
revision=1
build_style=configure
build_helper=qemu
configure_script=./Configure
configure_args="--prefix=/usr $(vopt_if pthreads --mt=pthread) -s"
make_build_target="gp lib-sta lib-dyn doc"
make_check_target=statest-all
make_install_target="install install-lib-sta install-lib-dyn"
hostmakedepends="perl texlive"
makedepends="gmp-devel readline-devel $(vopt_if x11 libX11-devel)"
short_desc="Fast computations library in number theory"
maintainer="Gonzalo Tornaría <tornaria@cmat.edu.uy>"
license="GPL-2.0-or-later"
homepage="https://pari.math.u-bordeaux.fr"
distfiles="https://pari.math.u-bordeaux.fr/pub/pari/unix/${pkgname}-${version}.tar.gz"
checksum=1679985094a0b723d14f49aa891dbe5ec967aa4040050a2c50bd764ddb3eba24
build_options="x11 pthreads"
build_options_default="x11 pthreads"
desc_option_pthreads="Enable support for pthreads"
# reduce speed losses due to pthreads
CFLAGS="-flto -fno-semantic-interposition"
post_patch() {
# sse2 is not available on all i686
# and it's available on all x86_64
if [ "${XBPS_TARGET_MACHINE%-musl}" != x86_64 ]; then
echo 'int main() { return 1; }' > config/has_sse2.c
else
echo 'int main() { return 0; }' > config/has_sse2.c
fi
cat <<-EOF >config/arch-osname
#!/bin/sh
echo "${XBPS_TARGET_MACHINE%-musl}-linux"
EOF
# No RPATH please
vsed -i -e '/runpathprefix=/s/=.*/=/' config/get_ld
}
pre_configure() {
export LD="$CC"
if [ "$CROSS_BUILD" ]; then
export RUNTEST="/usr/bin/qemu-$XBPS_TARGET_QEMU_MACHINE-static"
fi
}
pari-devel_package() {
short_desc+=" - development files"
depends="pari>=${version}_${revision}"
pkg_install() {
vmove usr/include
vmove "usr/lib/*.a"
vmove "usr/lib/*.so"
}
}