Ticket #36103: Portfile

File Portfile, 7.4 KB (added by gnw3, 12 years ago)

test version of Portfile mixing Apple with GNU compilers

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
3PortSystem 1.0
4
5name                octave-devel-test
6version             3.6.2
7revision            1
8conflicts           octave, octave-devel
9categories          math science
10maintainers         nomaintainer
11platforms           darwin
12description         test Portfile to work around ticket #36103
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"
86
87
88configure.cppflags
89configure.ldflags
90
91test.run            yes
92test.target         check
93
94platform darwin 11 {
95    # 10.7 requires an extra patch; this patch will break the build on
96    # 10.6 and prior, so apply it only under 10.7.
97    patchfiles-append patch-src-display.cc.diff
98}
99
100platform darwin 12 {
101    # In 10.8 patch is required as above, also
102    # the LANG environment variable needs to
103    # be set to "C" otherwise /usr/bin/sed
104    # fails with an error, if you installed gsed
105    # with default name this should have no effect.
106
107    patchfiles-append patch-src-display.cc.diff
108    build.args-append LANG="C"
109}
110
111
112variant gfortran43 description {build with the macports gfortran43 toolchain} conflicts gfortran47 gfortran46 gfortran45 gfortran44 g95 {}
113
114variant gfortran44 description {build with the macports gfortran44 toolchain} conflicts gfortran47 gfortran46 gfortran45 gfortran43 g95 {}
115
116variant gfortran45 description {build with the macports gfortran45 toolchain} conflicts gfortran47 gfortran46 gfortran44 gfortran43 g95 {}
117
118variant gfortran46 description {build with the macports gfortran45 toolchain} conflicts gfortran47 gfortran45 gfortran44 gfortran43 g95 {}
119
120variant gfortran47 description {build with the macports gfortran47 toolchain} conflicts gfortran45 gfortran46 gfortran44 gfortran43 g95 {}
121
122variant g95 description {build with g95} conflicts gfortran43 gfortran44 gfortran45 gfortran46 gfortran47 {
123    depends_build-append    port:g95
124    configure.f77           "${prefix}/bin/g95"
125}
126
127variant atlas description {use BLAS from ATLAS} conflicts accelerate {
128    depends_lib-append port:atlas
129}
130
131variant accelerate description {use BLAS from Apple's Accelerate.framework} conflicts atlas {
132    depends_lib-append      port:dotwrp
133    configure.args-append   --with-blas="-ldotwrp -framework Accelerate"
134    configure.args-append   --with-lapack="-framework Accelerate"
135}
136
137if {[variant_isset g95]} {
138    default_variants +accelerate
139} elseif {![variant_isset accelerate]} {
140    default_variants +atlas
141}
142
143# check for GFORTRAN / G95 variants.  The default here must match the
144# default found in the 'atlas' port (but, this is not checked).
145
146# check for setting the default variant (gfortran44)
147if { ![variant_isset gfortran43] && ![variant_isset gfortran44] && \
148         ![variant_isset gfortran46] && ![variant_isset gfortran47] && ![variant_isset g95] } {
149    default_variants +gfortran45
150}
151
152# check if the user disabled just the default variant: -gfortran44
153if { ![variant_isset gfortran43] && ![variant_isset gfortran44] && \
154         ![variant_isset gfortran45] && ![variant_isset gfortran46] && \
155         ![variant_isset gfortran47] && ![variant_isset g95] } {
156    pre-fetch {
157        error "You must select one of the compiler variants."
158    }
159}
160
161set gfortran_version ""
162if {[variant_isset gfortran43]} {
163    set gfortran_version "4.3"
164} elseif {[variant_isset gfortran44]} {
165    set gfortran_version "4.4"
166} elseif {[variant_isset gfortran45]} {
167    set gfortran_version "4.5"
168} elseif {[variant_isset gfortran46]} {
169    set gfortran_version "4.6"
170} elseif {[variant_isset gfortran47]} {
171    set gfortran_version "4.7"
172}
173
174if {${gfortran_version} != ""} {
175    set gfortran_version_join [join [split ${gfortran_version} "."] ""]
176    configure.ldflags           "-L${prefix}/lib/gcc${gfortran_version_join}"
177    configure.ldflags-append    -lstdc++ -lgfortran
178    depends_build-append port:gcc${gfortran_version_join}
179    configure.cc            llvm-gcc-4.2
180    configure.cxx           llvm-g++-4.2
181    configure.f77           "/usr/local/bin/octf77-${gfortran_version}"
182}
183
184variant docs description {Enable creation and installation of documentation} {
185    depends_run-append port:texlive-basic
186    configure.args-replace s|--disable-docs|--enable-docs|
187}
188
189variant x11 description {Enable use of X11} {
190    configure.args-replace s|--without-x|--with-x|
191    configure.args-append --x-includes=${prefix}
192}
193
194variant fltk description {Include FLTK for graphical front-end} {
195    depends_lib-append  path:lib/libfltk.dylib:fltk
196    depends_run-append  port:epstool \
197                        port:transfig \
198                        port:pstoedit
199    configure.env-delete FLTK_CONFIG=no
200}
201
202livecheck.type      regex
203livecheck.url       http://www.gnu.org/software/octave/news.html
204livecheck.regex     Version (\\d+(\\.\\d+)*)