Skip to content
Switch branches/tags
Go to file
Cannot retrieve contributors at this time
135 lines (110 sloc) 4.68 KB
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
PortSystem 1.0
PortGroup muniversal 1.0
PortGroup compiler_blacklist_versions 1.0
PortGroup xcode_workaround 1.0
name pari
version 2.13.0
revision 0
categories math
platforms darwin
license GPL-2+
maintainers { @wbl} openmaintainer
description PARI/GP computer algebra system
long_description PARI/GP is a widely used computer algebra system designed \
for fast computations in number theory (factorizations, \
algebraic number theory, elliptic curves...)
master_sites ${homepage}pub/pari/unix/
checksums rmd160 c58a2e0898b04d62f9809ac8409a22b3b8786a53 \
sha256 c811946de9d2c1ed0e97ff08e80d966f9a0b55848b7688406fab229e3948ba93 \
size 4758091
depends_lib port:gmp \
port:ncurses \
platform darwin 8 {
build.args-append EXTRADLLDFLAGS="-Wl,-single_module"
destroot.args-append EXTRADLLDFLAGS="-Wl,-single_module"
# llvm-gcc produces incorrect code, ticket #33024
compiler.blacklist-append llvm-gcc-4.2
xcode_workaround.type avoid_xcode_compiler
configure.cmd ./Configure
# PARI/GP doesn't use autoconf, and if only *FLAGS environment variables are
# used, libreadline is not found. One needs *PATH environment variables.
configure.env C_INCLUDE_PATH=${prefix}/include
# Always use GMP (forced by --with-gmp), as advised by the PARI developers:
# There are no reasons not to use it. If a no_gmp variant is needed,
# one would need --without-gmp, as by default, PARI's Configure will
# choose GMP if it can find it.
configure.args --mandir=${prefix}/share/man \
--with-gmp \
--with-readline \
configure.universal_args-delete --disable-dependency-tracking
set merger_must_run_binaries yes
# pari does not build for ppc on intel
if {${build_arch} eq "i386" || ${build_arch} eq "x86_64"} {
supported_archs i386 x86_64
} elseif {${build_arch} eq "ppc" || ${build_arch} eq "ppc64"} {
supported_archs ppc ppc64
set universal_archs_supported ${supported_archs}
post-patch {
if {![variant_isset doc]} {
reinplace "s/\\(doc all:\\).*/\\1/" \
reinplace "/INSTALL_DATA.*\\.\\(dvi\\|ps\\)/d" \
build.args-append CPLUSPLUS=${configure.cxx} gp
post-destroot {
set docdir ${destroot}${prefix}/share/doc/${name}
file mkdir ${docdir}
xinstall -m 644 -v -W ${worksrcpath} \
ln -s ../../${name}/doc ${docdir}/doc
variant doc description {Build DVI/PDF/PS documentation} {
depends_build-append path:bin/tex:texlive docpdf
post-destroot {
if {[variant_exists universal] && [variant_isset universal]} {
set dir ${worksrcpath}-[lindex ${universal_archs_to_use} 0]
} else {
set dir ${worksrcpath}
xinstall -m 644 -W ${dir}/doc \
develop.pdf libpari.pdf refcard.pdf tutorial.pdf users.pdf \
# Qt support doesn't work with:
# depends_lib-append port:qt4-mac
# configure.args-delete --graphic=none
# configure.args-append --graphic=Qt --with-qt=${prefix}
# Configure succeeds, but the build of src/graph/plotQt.c fails because
# ${prefix}/include/Qt is not in the include search path.
# Plotting works with X11, but the redraw after a window resize is
# sometimes incorrect.
variant x11 conflicts fltk description {Build with X11 support for the high-resolution plotting functions} {
depends_lib-append port:xorg-libX11
configure.args-delete --graphic=none
configure.args-append --graphic=X11
# Plotting works with fltk @1.1.10_3, but the GUI part freezes
# (a Force Quit is needed).
variant fltk conflicts x11 description {Build with FLTK support for the high-resolution plotting functions} {
depends_lib-append path:lib/libfltk.dylib:fltk
configure.args-delete --graphic=none
configure.args-append --graphic=fltk
variant mt description {Build multithreaded} {
configure.args-append --mt=pthread
livecheck.type regex
livecheck.url [lindex ${master_sites} 0]
livecheck.regex ${name}-(\\d+\\.\\d+\\.\\d+)