Ticket #32702: Portfile

File Portfile, 6.7 KB (added by lukas.reichlin@…, 12 years ago)

Entire 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 88087 2011-12-18 15:31:05Z michaelld@macports.org $
3
4PortSystem 1.0
5
6name                octave-devel
7version             3.4.3
8revision            2
9conflicts           octave
10categories          math science
11maintainers         michaelld openmaintainer
12platforms           darwin
13description         a Matlab-like environment for numerical analysis
14long_description    Octave provides a convenient command line interface \
15                    for solving linear and nonlinear problems numerically, \
16                    using a language that is mostly compatible with Matlab. \
17                    It is easily extensible and customizable via \
18                    user-defined functions or using dynamically loaded \
19                    modules written in e.g. C++, C or Fortran.
20
21homepage            http://www.gnu.org/software/octave/
22master_sites        gnu:octave
23dist_subdir         octave
24distname            octave-${version}
25use_bzip2           yes
26
27checksums           md5     185b08f4e4a7b646d76e4d33b77fa87e \
28                    sha1    fe622c28a38f8730c59e46211bc7b18e7f51a679 \
29                    rmd160  d6f43fca9097b40f163c140db853d8ac1383ab39
30
31depends_build       port:bison \
32                    port:flex \
33                    port:gawk \
34                    port:gperf \
35                    port:grep \
36                    port:gsed \
37                    path:bin/perl:perl5 \
38                    port:texinfo
39
40depends_lib         port:curl \
41                    port:fftw-3 \
42                    port:fftw-3-single \
43                    port:ftgl \
44                    port:ghostscript \
45                    port:glpk \
46                    port:GraphicsMagick \
47                    port:gnuplot \
48                    port:hdf5-18 \
49                    port:less \
50                    port:metis \
51                    port:ncurses \
52                    port:pcre \
53                    port:readline \
54                    port:qhull \
55                    port:qrupdate \
56                    port:SuiteSparse
57
58# allow us to disable checking for FLTK
59# via the environment variable "FLTK_CONFIG"
60patchfiles-append   patch-configure.diff
61
62universal_variant   no
63
64# do not use CLANG (yet)
65if {${configure.compiler} == "clang"} {
66    configure.compiler llvm-gcc-4.2
67}
68
69configure.args      --disable-dependency-tracking \
70                    --without-x \
71                    --disable-docs \
72                    --with-cholmod="-lcholmod -lmetis"
73
74#                    --without-framework-carbon
75
76# octave uses a number of other ports to create sources from template:
77# perl, gawk, gsed, flex, bison, texinfo.  Make sure these are the
78# MacPorts' versions.  Python is not used if perl is available, so
79# clear it out.  grep is checked for in 'configure', but not used
80# except inside that script; include it here for completion.
81configure.perl      ${prefix}/bin/perl
82configure.python    ' '
83configure.awk       ${prefix}/bin/gawk
84configure.env-append GREP="${prefix}/bin/grep" \
85                     FLTK_CONFIG=no \
86                     SED="${prefix}/bin/gsed" \
87                     TEXI2DVI="${prefix}/bin/texi2dvi" \
88                     TEXI2PDF="${prefix}/bin/texi2pdf"
89configure.cppflags
90configure.ldflags
91
92test.run            yes
93test.target         check
94
95platform darwin 11 {
96    # 10.7 requires an extra patch; this patch will break the build on
97    # 10.6 and prior, so apply it only under 10.7.
98    patchfiles-append patch-src-display.cc.diff
99}
100
101variant gcc43 description {build with the macports gcc43 toolchain} conflicts gcc47 gcc46 gcc45 gcc44 g95 {}
102
103variant gcc44 description {build with the macports gcc44 toolchain} conflicts gcc47 gcc46 gcc45 gcc43 g95 {}
104
105variant gcc45 description {build with the macports gcc45 toolchain} conflicts gcc47 gcc46 gcc44 gcc43 g95 {}
106
107variant gcc46 description {build with the macports gcc46 toolchain} conflicts gcc47 gcc45 gcc44 gcc43 g95 {}
108
109variant gcc47 description {build with the macports gcc47 toolchain} conflicts gcc46 gcc45 gcc44 gcc43 g95 {}
110
111variant g95 description {build with g95} conflicts gcc43 gcc44 gcc45 gcc46 gcc47 {
112    depends_build-append    port:g95
113    configure.f77           "${prefix}/bin/g95"
114}
115
116variant atlas description {use BLAS from ATLAS} conflicts accelerate {
117    depends_lib-append port:atlas
118}
119
120variant accelerate description {use BLAS from Apple's Accelerate.framework} conflicts atlas {
121    depends_lib-append      port:dotwrp
122    configure.args-append   --with-blas="-ldotwrp -Wl,-framework -Wl,Accelerate"
123    configure.args-append   --with-lapack="-Wl,-framework -Wl,Accelerate"
124}
125
126if {[variant_isset g95]} {
127    default_variants +accelerate
128} elseif {![variant_isset accelerate]} {
129    default_variants +atlas
130}
131
132# check for GCC / G95 variants.  The default here must match the
133# default found in the 'atlas' port (but, this is not checked for).
134
135# check for setting the default variant (gcc44)
136if { ![variant_isset gcc43] && ![variant_isset gcc44] && \
137         ![variant_isset gcc45] && ![variant_isset gcc46] && \
138         ![variant_isset gcc47] && ![variant_isset g95] } {
139    default_variants +gcc44
140}
141
142# check if the user disabled just the default variant: -gcc44
143if { ![variant_isset gcc43] && ![variant_isset gcc44] && \
144         ![variant_isset gcc45] && ![variant_isset gcc46] && \
145         ![variant_isset gcc47] && ![variant_isset g95] } {
146    error "You cannot use the variant -gcc44 alone."
147}
148
149set gcc_version ""
150if {[variant_isset gcc43]} {
151    set gcc_version "4.3"
152} elseif {[variant_isset gcc44]} {
153    set gcc_version "4.4"
154} elseif {[variant_isset gcc45]} {
155    set gcc_version "4.5"
156} elseif {[variant_isset gcc46]} {
157    set gcc_version "4.6"
158} elseif {[variant_isset gcc47]} {
159    set gcc_version "4.7"
160}
161
162if {${gcc_version} != ""} {
163    set gcc_version_join [join [split ${gcc_version} "."] ""]
164    configure.ldflags    "${prefix}/lib/gcc${gcc_version_join}/libstdc++.6.dylib"
165    depends_build-append port:gcc${gcc_version_join}
166    configure.compiler   macports-gcc-${gcc_version}
167}
168
169variant docs description {Enable creation and installation of documentation} {
170    depends_run-append port:texlive-basic
171    configure.args-replace s|--disable-docs|--enable-docs|
172}
173
174variant x11 description {Enable use of X11} {
175    configure.args-replace s|--without-x|--with-x|
176    configure.args-append --x-includes=${prefix}
177}
178
179variant fltk description {Include FLTK for graphical front-end} {
180    depends_lib-append port:fltk-devel
181    depends_run-append  port:epstool \
182                        port:transfig \
183                        port:pstoedit
184    configure.env-delete FLTK_CONFIG=no
185}
186
187livecheck.type      regex
188livecheck.url       http://www.gnu.org/software/octave/news.html
189livecheck.regex     Version (\\d+(\\.\\d+)*)