void-packages/srcpkgs/pari/template

56 lines
1.4 KiB
Bash

# Template file for 'pari'
pkgname=pari
version=2.13.1
revision=1
build_style=configure
build_helper=qemu
configure_script=./Configure
configure_args="--prefix=/usr"
make_build_target=all
make_check_target=test-all
hostmakedepends="perl texlive"
makedepends="gmp-devel readline-devel $(vopt_if x11 libX11-devel)"
short_desc="Fast computations library in number theory"
maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
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=81ecf7d70ccdaae230165cff627c9ce2ec297b8f22f9f40742279d85f86dfcb1
build_options="x11"
build_options_default="x11"
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/*.so"
}
}