Ticket #31560: Portfile

File Portfile, 6.2 KB (added by lukas.reichlin@…, 13 years ago)

The Portfile

Line 
1# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:et:sw=4:ts=4:sts=4
2# $Id: Portfile 82296 2011-08-12 11:20:23Z takanori@macports.org $
3
4PortSystem 1.0
5
6name                octave-devel
7version             3.4.3
8conflicts           octave
9categories          math science
10maintainers         michaelld openmaintainer
11platforms           darwin
12description         a Matlab-like environment for numerical analysis
13long_description    Octave provides a convenient command line interface \
14                    for solving linear and nonlinear problems numerically, \
15                    using a language that is mostly compatible with Matlab. \
16                    It is easily extensible and customizable via \
17                    user-defined functions or using dynamically loaded \
18                    modules written in e.g. C++, C or Fortran.
19
20homepage            http://www.gnu.org/software/octave/
21master_sites        gnu:octave
22dist_subdir         octave
23distname            octave-${version}
24use_bzip2           yes
25
26checksums           md5     185b08f4e4a7b646d76e4d33b77fa87e \
27                    sha1    fe622c28a38f8730c59e46211bc7b18e7f51a679 \
28                    rmd160  d6f43fca9097b40f163c140db853d8ac1383ab39
29
30depends_build       port:bison \
31                    port:flex \
32                    port:gawk \
33                    port:gperf \
34                    port:grep \
35                    port:gsed \
36                    path:bin/perl:perl5 \
37                    port:texinfo
38
39depends_lib         port:arpack \
40                    port:atlas \
41                    port:curl \
42                    port:fftw-3 \
43                    port:fftw-3-single \
44                    port:ftgl \
45                    port:ghostscript \
46                    port:glpk \
47                    port:GraphicsMagick \
48                    port:gnuplot \
49                    port:hdf5-18 \
50                    port:less \
51                    port:metis \
52                    port:ncurses \
53                    port:pcre \
54                    port:readline \
55                    port:qhull \
56                    port:qrupdate \
57                    port:SuiteSparse
58
59# allow non-Apple compilers to work with FLTK by removing the -arch
60# flag, which means this port cannot easily compile as universal.
61patchfiles-append patch-configure.diff
62
63universal_variant   no
64
65configure.args      --disable-dependency-tracking \
66                    --without-x \
67                    --disable-docs \
68                    --with-cholmod="-lcholmod -lmetis" \
69                    --without-framework-carbon
70
71# octave uses a number of other ports to create sources from template:
72# perl, gawk, gsed, flex, bison, texinfo.  Make sure these are the
73# MacPorts' versions.  Python is not used if perl is available, so
74# clear it out.  grep is checked for in 'configure', but not used
75# except inside that script; include it here for completion.
76configure.perl      ${prefix}/bin/perl
77configure.python    ' '
78configure.awk       ${prefix}/bin/gawk
79configure.env-append GREP="${prefix}/bin/grep" \
80                     FLTK_CONFIG=no \
81                     SED="${prefix}/bin/gsed" \
82                     TEXI2DVI="${prefix}/bin/texi2dvi" \
83                     TEXI2PDF="${prefix}/bin/texi2pdf"
84configure.cppflags
85configure.ldflags
86
87test.run            yes
88test.target         check
89
90variant gcc43 description {build with the macports gcc43 toolchain} conflicts gcc46 gcc45 gcc44 g95 {}
91
92variant gcc44 description {build with the macports gcc44 toolchain} conflicts gcc46 gcc45 gcc43 g95 {}
93
94variant gcc45 description {build with the macports gcc45 toolchain} conflicts gcc46 gcc44 gcc43 g95 {}
95
96variant gcc46 description {build with the macports gcc45 toolchain} conflicts gcc45 gcc44 gcc43 g95 {}
97
98variant g95 description {build with g95} conflicts gcc43 gcc44 gcc45 gcc46 {
99    depends_build-append    port:g95
100    configure.f77           "${prefix}/bin/g95"
101}
102
103# check for GCC / G95 variants.  The default here must match the
104# default found in the 'arpack' and 'atlas' ports.
105
106# check for setting the default variant (gcc44)
107if { ![variant_isset gcc43] && ![variant_isset gcc44] && \
108         ![variant_isset gcc45] && ![variant_isset gcc46] && ![variant_isset g95] } {
109    default_variants +gcc44
110}
111
112# check if the user disabled just the default variant: -gcc44
113if { ![variant_isset gcc43] && ![variant_isset gcc44] && \
114         ![variant_isset gcc45] && ![variant_isset gcc46] && ![variant_isset g95] } {
115    error "You cannot use the variant -gcc44 alone."
116}
117
118set gcc_version ""
119if {[variant_isset gcc43]} {
120    set gcc_version "4.3"
121} elseif {[variant_isset gcc44]} {
122    set gcc_version "4.4"
123} elseif {[variant_isset gcc45]} {
124    set gcc_version "4.5"
125} elseif {[variant_isset gcc46]} {
126    set gcc_version "4.6"
127}
128
129if {${gcc_version} != ""} {
130    set gcc_version_join [join [split ${gcc_version} "."] ""]
131    configure.ldflags    "${prefix}/lib/gcc${gcc_version_join}/libstdc++.6.dylib"
132    depends_build-append port:gcc${gcc_version_join}
133    configure.compiler   macports-gcc-${gcc_version}
134}
135
136variant docs description {Enable creation and installation of documentation} {
137    configure.args-replace s|--disable-docs|--enable-docs|
138}
139
140variant x11 description {Enable use of X11} {
141    configure.args-replace s|--without-x|--with-x|
142    configure.args-append --x-includes=${prefix}
143}
144
145variant debug description {Produce debugging information in compiled code} {
146    configure.cflags-delete    -O2
147    configure.cxxflags-delete  -O2
148    configure.fflags-delete    -O2
149    configure.fcflags-delete   -O2
150    configure.f90flags-delete  -O2
151    configure.objcflags-delete -O2
152    configure.cflags-append    -g3 -O0
153    configure.cxxflags-append  -g3 -O0
154    configure.fcflags-append   -g3 -O0
155    configure.f90flags-append  -g3 -O0
156    configure.fflags-append    -g3 -O0
157    configure.objcflags-append -g3 -O0
158}
159
160# FLTK does work as of 1.3.x-r8635, so allow it as an option
161variant fltk description {Include FLTK for graphical front-end} {
162    depends_lib-append port:fltk-devel
163    configure.env-delete FLTK_CONFIG=no
164}
165
166livecheck.type      regex
167livecheck.url       http://www.gnu.org/software/octave/news.html
168livecheck.regex     Version (\\d+(\\.\\d+)*)