Ticket #51342: Portfile

File Portfile, 4.4 KB (added by wbl (Watson Ladd), 9 years ago)

Portfile

Line 
1# -*- 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
2# $Id: Portfile 142083 2015-11-03 11:06:55Z ryandesign@macports.org $
3
4PortSystem          1.0
5PortGroup           muniversal 1.0
6
7name                pari
8version             2.7.5
9categories          math
10platforms           darwin
11license             GPL-2+
12maintainers         gmail.com:watsonbladd openmaintainer
13
14description         PARI/GP computer algebra system
15
16long_description    PARI/GP is a widely used computer algebra system designed \
17                    for fast  computations in number theory (factorizations, \
18                    algebraic number theory,  elliptic curves...)
19
20homepage            http://pari.math.u-bordeaux.fr/
21master_sites        ${homepage}pub/pari/unix/
22
23checksums           md5    87a0d8a49e0845bc372dadfacb5b889e \
24                    sha256 2140fe2d40b5a42acd5b7fce7e49b576777efdfc59370b531e07cb07d4401431
25
26depends_lib         port:gmp \
27                    port:ncurses \
28                    port:readline
29
30platform darwin 8 {
31    build.args-append EXTRADLLDFLAGS="-Wl,-single_module"
32    destroot.args-append EXTRADLLDFLAGS="-Wl,-single_module"
33}
34
35# llvm-gcc produces incorrect code, ticket #33024
36compiler.blacklist  llvm-gcc-4.2
37
38configure.cmd       ./Configure
39
40# PARI/GP doesn't use autoconf, and if only *FLAGS environment variables are
41# used, libreadline is not found. One needs *PATH environment variables.
42configure.env       C_INCLUDE_PATH=${prefix}/include
43
44# Always use GMP (forced by --with-gmp), as advised by the PARI developers:
45#   http://www.math.u-bordeaux.fr/~belabas/pari/doc/faq.html#gnump
46# There are no reasons not to use it. If a no_gmp variant is needed,
47# one would need --without-gmp, as by default, PARI's Configure will
48# choose GMP if it can find it.
49configure.args      --mandir=${prefix}/share/man \
50                    --with-gmp \
51                    --with-readline \
52                    --graphic=none
53configure.universal_args-delete --disable-dependency-tracking
54
55set merger_must_run_binaries yes
56
57# pari does not build for ppc on intel
58if {${build_arch} eq "i386" || ${build_arch} eq "x86_64"} {
59    supported_archs i386 x86_64
60} elseif {${build_arch} eq "ppc" || ${build_arch} eq "ppc64"} {
61    supported_archs ppc ppc64
62}
63set universal_archs_supported ${supported_archs}
64
65post-patch {
66    if {![variant_isset doc]} {
67        reinplace "s/\\(doc all:\\).*/\\1/" \
68            ${worksrcpath}/config/DOC_Make.SH
69        reinplace "/INSTALL_DATA.*\\.\\(dvi\\|ps\\)/d" \
70            ${worksrcpath}/config/Makefile.SH
71    }
72}
73
74build.args-append   CPLUSPLUS=${configure.cxx}
75
76build.target        gp
77
78post-destroot {
79    set docdir ${destroot}${prefix}/share/doc/${name}
80    file mkdir ${docdir}
81    xinstall -m 644 -v -W ${worksrcpath} \
82        AUTHORS CHANGES COPYING ${docdir}
83    ln -s ../../${name}/doc ${docdir}/doc
84}
85
86variant doc description {Build DVI/PDF/PS documentation} {
87    depends_build-append path:bin/tex:texlive
88    build.target-append docpdf
89    post-destroot {
90        if {[variant_isset universal]} {
91            set dir ${worksrcpath}-[lindex ${universal_archs_to_use} 0]
92        } else {
93            set dir ${worksrcpath}
94        }
95        xinstall -m 644 -W ${dir}/doc \
96            develop.pdf libpari.pdf refcard.pdf tutorial.pdf users.pdf \
97            ${destroot}${prefix}/share/${name}/doc
98    }
99}
100
101# Qt support doesn't work with:
102#   depends_lib-append port:qt4-mac
103#   configure.args-delete --graphic=none
104#   configure.args-append --graphic=Qt --with-qt=${prefix}
105# Configure succeeds, but the build of src/graph/plotQt.c fails because
106# ${prefix}/include/Qt is not in the include search path.
107
108# Plotting works with X11, but the redraw after a window resize is
109# sometimes incorrect.
110variant x11 conflicts fltk description {Build with X11 support for the high-resolution plotting functions} {
111    depends_lib-append port:xorg-libX11
112    configure.args-delete --graphic=none
113    configure.args-append --graphic=X11
114}
115
116# Plotting works with fltk @1.1.10_3, but the GUI part freezes
117# (a Force Quit is needed).
118variant fltk conflicts x11 description {Build with FLTK support for the high-resolution plotting functions} {
119    depends_lib-append path:lib/libfltk.dylib:fltk
120    configure.args-delete --graphic=none
121    configure.args-append --graphic=fltk
122}
123
124livecheck.type      regex
125livecheck.url       [lindex ${master_sites} 0]
126livecheck.regex     ${name}-(\\d+\\.\\d+\\.\\d+)