Ticket #32894: Portfile.5

File Portfile.5, 7.6 KB (added by sebastian.moeller@…, 12 years ago)

octave 3.6.2 with uiteSparse 4.0.0 and atlas 3.9.84

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.6.2
8revision            0
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     9a0ecca8e40749ef5c884b1a0265f038 \
28                    sha1    145fef0122268086727a60e1c33e29d56fd546d7 \
29                    rmd160  1bf26b238d2bba461c5902d091088533c733439b
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                    --enable-atomic-refcount \
74#                    --enable-64
75
76#                    --without-framework-carbon
77
78# these were active during the last build
79#configure.args-append   --with-blas="-ltatlas"
80#configure.args-append   --with-lapack="-llapack"
81
82
83
84# octave uses a number of other ports to create sources from template:
85# perl, gawk, gsed, flex, bison, texinfo.  Make sure these are the
86# MacPorts' versions.  Python is not used if perl is available, so
87# clear it out.  grep is checked for in 'configure', but not used
88# except inside that script; include it here for completion.
89configure.perl      ${prefix}/bin/perl
90configure.python    ' '
91configure.awk       ${prefix}/bin/gawk
92configure.env-append GREP="${prefix}/bin/grep" \
93                     FLTK_CONFIG=no \
94                     SED="${prefix}/bin/gsed" \
95                     TEXI2DVI="${prefix}/bin/texi2dvi" \
96                     TEXI2PDF="${prefix}/bin/texi2pdf"
97                     
98# make this work with SuiteSparse 4.0.0 and the newer atlas library naming convention (lin=bsatlas or libtatlas instead of libatalas)                     
99# by patching configure all makefilesget created correctly...
100pre-configure {
101    reinplace "s|-lumfpack|-lSuiteSparse -lumfpack|" ${worksrcpath}/configure.orig
102    reinplace "s|-lumfpack|-lSuiteSparse -lumfpack|" ${worksrcpath}/configure
103    reinplace "s|-latlas|-ltatlas|" ${worksrcpath}/configure.orig
104    reinplace "s|-latlas|-ltatlas|" ${worksrcpath}/configure
105}
106
107
108configure.cppflags
109configure.ldflags
110
111test.run            yes
112test.target         check
113
114platform darwin 11 {
115    # 10.7 requires an extra patch; this patch will break the build on
116    # 10.6 and prior, so apply it only under 10.7.
117    patchfiles-append patch-src-display.cc.diff
118}
119
120variant gcc43 description {build with the macports gcc43 toolchain} conflicts gcc47 gcc46 gcc45 gcc44 g95 {}
121
122variant gcc44 description {build with the macports gcc44 toolchain} conflicts gcc47 gcc46 gcc45 gcc43 g95 {}
123
124variant gcc45 description {build with the macports gcc45 toolchain} conflicts gcc47 gcc46 gcc44 gcc43 g95 {}
125
126variant gcc46 description {build with the macports gcc46 toolchain} conflicts gcc47 gcc45 gcc44 gcc43 g95 {}
127
128variant gcc47 description {build with the macports gcc47 toolchain} conflicts gcc46 gcc45 gcc44 gcc43 g95 {}
129
130variant g95 description {build with g95} conflicts gcc43 gcc44 gcc45 gcc46 gcc47 {
131    depends_build-append    port:g95
132    configure.f77           "${prefix}/bin/g95"
133}
134
135variant atlas description {use BLAS from ATLAS} conflicts accelerate {
136    depends_lib-append      port:atlas
137    configure.args-append   --with-lapack="-llapack"
138}
139
140variant accelerate description {use BLAS from Apple's Accelerate.framework} conflicts atlas {
141    depends_lib-append      port:dotwrp
142    configure.args-append   --with-blas="-ldotwrp -Wl,-framework -Wl,Accelerate"
143    configure.args-append   --with-lapack="-Wl,-framework -Wl,Accelerate"
144}
145
146if {[variant_isset g95]} {
147    default_variants +accelerate
148} elseif {![variant_isset accelerate]} {
149    default_variants +atlas
150}
151
152# check for GCC / G95 variants.  The default here must match the
153# default found in the 'atlas' port (but, this is not checked for).
154
155# check for setting the default variant (gcc45)
156if { ![variant_isset gcc43] && ![variant_isset gcc44] && \
157         ![variant_isset gcc45] && ![variant_isset gcc46] && \
158         ![variant_isset gcc47] && ![variant_isset g95] } {
159    default_variants +gcc45
160}
161
162# check if the user disabled just the default variant: -gcc45
163if { ![variant_isset gcc43] && ![variant_isset gcc44] && \
164         ![variant_isset gcc45] && ![variant_isset gcc46] && \
165         ![variant_isset gcc47] && ![variant_isset g95] } {
166    error "You cannot use the variant -gcc45 alone."
167}
168
169set gcc_version ""
170if {[variant_isset gcc43]} {
171    set gcc_version "4.3"
172} elseif {[variant_isset gcc44]} {
173    set gcc_version "4.4"
174} elseif {[variant_isset gcc45]} {
175    set gcc_version "4.5"
176} elseif {[variant_isset gcc46]} {
177    set gcc_version "4.6"
178} elseif {[variant_isset gcc47]} {
179    set gcc_version "4.7"
180}
181
182if {${gcc_version} != ""} {
183    set gcc_version_join [join [split ${gcc_version} "."] ""]
184    configure.ldflags    "${prefix}/lib/gcc${gcc_version_join}/libstdc++.6.dylib"
185    depends_build-append port:gcc${gcc_version_join}
186    configure.compiler   macports-gcc-${gcc_version}
187}
188
189variant docs description {Enable creation and installation of documentation} {
190    depends_run-append port:texlive-basic
191    configure.args-replace s|--disable-docs|--enable-docs|
192}
193
194variant x11 description {Enable use of X11} {
195    configure.args-replace s|--without-x|--with-x|
196    configure.args-append --x-includes=${prefix}
197}
198
199variant fltk description {Include FLTK for graphical front-end} {
200    depends_lib-append port:fltk-devel
201    depends_run-append  port:epstool \
202                        port:transfig \
203                        port:pstoedit
204    configure.env-delete FLTK_CONFIG=no
205}
206
207livecheck.type      regex
208livecheck.url       http://www.gnu.org/software/octave/news.html
209livecheck.regex     Version (\\d+(\\.\\d+)*)