Ticket #35434: Portfile.2

File Portfile.2, 7.0 KB (added by g5pw (Aljaž Srebrnič), 12 years ago)

Portfile working with gcc47

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 92837 2012-05-09 00:51:48Z ryandesign@macports.org $
3
4PortSystem 1.0
5
6name                octave-devel
7version             3.6.2
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           rmd160  1bf26b238d2bba461c5902d091088533c733439b \
27                    sha256  0bb69b93d0bee872308a7944f1ebbe948f55cd4ae55beab38f05950e1b45c4ae
28
29depends_build       port:bison \
30                    port:flex \
31                    port:gawk \
32                    port:gperf \
33                    port:grep \
34                    port:gsed \
35                    path:bin/perl:perl5 \
36                    port:texinfo
37
38depends_lib         port:curl \
39                    port:fftw-3 \
40                    port:fftw-3-single \
41                    port:ftgl \
42                    port:ghostscript \
43                    port:glpk \
44                    port:GraphicsMagick \
45                    port:gnuplot \
46                    port:hdf5-18 \
47                    port:less \
48                    port:metis \
49                    port:ncurses \
50                    port:pcre \
51                    port:readline \
52                    port:qhull \
53                    port:qrupdate \
54                    port:SuiteSparse
55
56# allow us to disable checking for FLTK
57# via the environment variable "FLTK_CONFIG"
58patchfiles-append   patch-configure.diff
59
60universal_variant   no
61
62# do not use CLANG (yet)
63compiler.blacklist  clang
64
65configure.args      --disable-dependency-tracking \
66                    --without-x \
67                    --disable-docs \
68                    --with-cholmod="-lcholmod -lmetis" \
69                    --with-umfpack="-lumfpack -lSuiteSparse"
70
71#                    --without-framework-carbon
72
73# octave uses a number of other ports to create sources from template:
74# perl, gawk, gsed, flex, bison, texinfo.  Make sure these are the
75# MacPorts' versions.  Python is not used if perl is available, so
76# clear it out.  grep is checked for in 'configure', but not used
77# except inside that script; include it here for completion.
78configure.perl      ${prefix}/bin/perl
79configure.python    ' '
80configure.awk       ${prefix}/bin/gawk
81configure.env-append GREP="${prefix}/bin/grep" \
82                     FLTK_CONFIG=no \
83                     SED="${prefix}/bin/gsed" \
84                     TEXI2DVI="${prefix}/bin/texi2dvi" \
85                     TEXI2PDF="${prefix}/bin/texi2pdf"
86configure.cppflags
87configure.ldflags
88
89test.run            yes
90test.target         check
91
92platform darwin 11 {
93    # 10.7 requires an extra patch; this patch will break the build on
94    # 10.6 and prior, so apply it only under 10.7.
95    patchfiles-append patch-src-display.cc.diff
96}
97
98platform darwin 12 {
99    # In 10.8 patch is required as above, also
100    # the LANG environment variable needs to
101    # be set to "C" otherwise /usr/bin/sed
102    # fails with an error, if you installed gsed
103    # with default name this should have no effect.
104
105    patchfiles-append patch-src-display.cc.diff
106    build.args-append LANG="C"
107}
108
109
110variant gcc43 description {build with the macports gcc43 toolchain} conflicts gcc47 gcc46 gcc45 gcc44 g95 {}
111
112variant gcc44 description {build with the macports gcc44 toolchain} conflicts gcc47 gcc46 gcc45 gcc43 g95 {}
113
114variant gcc45 description {build with the macports gcc45 toolchain} conflicts gcc47 gcc46 gcc44 gcc43 g95 {}
115
116variant gcc46 description {build with the macports gcc45 toolchain} conflicts gcc47 gcc45 gcc44 gcc43 g95 {}
117
118variant gcc47 description {build with the macports gcc47 toolchain} conflicts gcc45 gcc46 gcc44 gcc43 g95 {}
119
120variant g95 description {build with g95} conflicts gcc43 gcc44 gcc45 gcc46 {
121    depends_build-append    port:g95
122    configure.f77           "${prefix}/bin/g95"
123}
124
125variant atlas description {use BLAS from ATLAS} conflicts accelerate {
126    depends_lib-append port:atlas
127}
128
129variant accelerate description {use BLAS from Apple's Accelerate.framework} conflicts atlas {
130    depends_lib-append      port:dotwrp
131    configure.args-append   --with-blas="-ldotwrp -framework Accelerate"
132    configure.args-append   --with-lapack="-framework Accelerate"
133}
134
135if {[variant_isset g95]} {
136    default_variants +accelerate
137} elseif {![variant_isset accelerate]} {
138    default_variants +atlas
139}
140
141# check for GCC / G95 variants.  The default here must match the
142# default found in the 'atlas' port (but, this is not checked for).
143
144# check for setting the default variant (gcc44)
145if { ![variant_isset gcc43] && ![variant_isset gcc44] && \
146         ![variant_isset gcc46] && ![variant_isset gcc47] && ![variant_isset g95] } {
147    default_variants +gcc45
148}
149
150# check if the user disabled just the default variant: -gcc44
151if { ![variant_isset gcc43] && ![variant_isset gcc44] && \
152         ![variant_isset gcc45] && ![variant_isset gcc46] && \
153         ![variant_isset gcc47] && ![variant_isset g95] } {
154    pre-fetch {
155        error "You must select one of the compiler variants."
156    }
157}
158
159set gcc_version ""
160if {[variant_isset gcc43]} {
161    set gcc_version "4.3"
162} elseif {[variant_isset gcc44]} {
163    set gcc_version "4.4"
164} elseif {[variant_isset gcc45]} {
165    set gcc_version "4.5"
166} elseif {[variant_isset gcc46]} {
167    set gcc_version "4.6"
168} elseif {[variant_isset gcc47]} {
169    set gcc_version "4.7"
170}
171
172if {${gcc_version} != ""} {
173    set gcc_version_join [join [split ${gcc_version} "."] ""]
174    configure.ldflags           "-L${prefix}/lib/gcc${gcc_version_join}"
175    configure.ldflags-append    -lstdc++ \
176                                -lgfortran
177    depends_build-append port:gcc${gcc_version_join}
178    configure.compiler   macports-gcc-${gcc_version}
179}
180
181variant docs description {Enable creation and installation of documentation} {
182    depends_run-append port:texlive-basic
183    configure.args-replace s|--disable-docs|--enable-docs|
184}
185
186variant x11 description {Enable use of X11} {
187    configure.args-replace s|--without-x|--with-x|
188    configure.args-append --x-includes=${prefix}
189}
190
191variant fltk description {Include FLTK for graphical front-end} {
192    depends_lib-append port:fltk-devel
193    depends_run-append  port:epstool \
194                        port:transfig \
195                        port:pstoedit
196    configure.env-delete FLTK_CONFIG=no
197}
198
199livecheck.type      regex
200livecheck.url       http://www.gnu.org/software/octave/news.html
201livecheck.regex     Version (\\d+(\\.\\d+)*)