source: trunk/dports/science/root6/Portfile

Last change on this file was 152286, checked in by larryv@…, 13 months ago

root6: Update to 6.06.08 (maintainer, #52159)

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 27.1 KB
Line 
1# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
2# $Id: Portfile 152286 2016-09-02 13:56:28Z ryandesign@macports.org $
3
4PortSystem          1.0
5
6PortGroup           active_variants 1.1
7PortGroup           cmake 1.0
8PortGroup           compiler_blacklist_versions 1.0
9PortGroup           github 1.0
10PortGroup           select 1.0
11PortGroup           xcodeversion 1.0
12
13# don't forget to update both the git tag and the version
14github.setup        root-mirror root 6-06-08 v
15version             [string map {- .} ${github.version}]
16livecheck.version   ${github.version}
17# github.setup      root-mirror root <sha>
18# version           6.06.05
19# livecheck.version 6-06-04
20
21set version_major   [lindex [split ${version} .] 0]
22
23checksums           rmd160  547484b51868ee1368779a9e0aea310eda17a6f1 \
24                    sha256  ce5f6c56f353e449792ed3c8c5367e5407093261355b905e388cd8e708b41d39
25
26name                root${version_major}
27categories          science
28maintainers         hep.phy.cam.ac.uk:jonesc mojca
29license             LGPL-2.1+
30
31description         ROOT is a data analysis framework from CERN
32long_description    The ROOT system provides a set of frameworks with all \
33                    the functionality needed to handle and analyze large amounts \
34                    of data in a very efficient way.
35
36homepage            http://root.cern.ch/
37platforms           darwin
38
39dist_subdir         root
40
41depends_lib         port:expat \
42                    port:gmp \
43                    port:giflib \
44                    port:jpeg \
45                    port:libpng \
46                    port:lzma \
47                    port:ocaml \
48                    port:ocaml-ctypes \
49                    port:ocaml-findlib \
50                    port:pcre \
51                    port:tiff \
52                    port:zlib \
53                    port:xz
54                  # port:freetype
55
56depends_run         port:root_select
57
58cmake.out_of_source yes
59
60# TODO: the file ${filespath}/${name} would have to be generated on the fly instead
61select.group        root
62select.file         ${filespath}/${name}
63
64# Force a compatible compiler
65compiler.blacklist-append *gcc* {clang < 500} macports-clang-3.3
66compiler.fallback-append  macports-clang-3.7 macports-clang-3.6 macports-clang-3.5
67
68# port specific location
69set install_prefix ${prefix}/libexec/root${version_major}
70
71configure.args-append \
72                    -Dgnuinstall=ON \
73                    -Drpath=ON \
74                    -DCMAKE_INSTALL_PREFIX="${install_prefix}" \
75                    -DCMAKE_INSTALL_SYSCONFDIR="${install_prefix}/etc/root" \
76                    -DCMAKE_INSTALL_NAME_DIR="${install_prefix}/lib/root" \
77                    -Dfortran=OFF \
78                    -Dbuiltin_davix=ON \
79                    -Dbuiltin_freetype=ON \
80                    -Dbuiltin_glew=OFF \
81                    -Dbuiltin_pcre=OFF \
82                    -Dbuiltin_zlib=OFF \
83                    -Dbuiltin_lzma=OFF \
84                    -Dbuiltin_afterimage=ON \
85                    -Dfftw3=OFF \
86                    -Dkrb5=OFF \
87                    -Dldap=OFF \
88                    -Dmysql=OFF \
89                    -Dsqlite=OFF \
90                    -Dodbc=OFF \
91                    -Dopengl=OFF \
92                    -Dpythia6=OFF \
93                    -Dpythia8=OFF \
94                    -Droofit=OFF \
95                    -Dssl=OFF \
96                    -Dxml=OFF \
97                    -Dpython=OFF \
98                    -Dfitsio=OFF \
99                    -Dgsl_shared=OFF \
100                    -Dbuiltin_gsl=OFF \
101                    -Dpgsql=OFF \
102                    -Ddcache=OFF \
103                    -Dchirp=OFF \
104                    -Dhdfs=OFF \
105                    -Druby=OFF \
106                    -Dminuit2=OFF \
107                    -Dtmva=OFF \
108                    -Dqt=OFF \
109                    -Dqtgsi=OFF \
110                    -Dbonjour=OFF \
111                    -Dgviz=OFF \
112                    -Dsoversion=OFF \
113                    -Dcxx11=ON \
114                    -Dcxx14=OFF \
115                    -Dlibcxx=ON \
116                    -Dxrootd=OFF \
117                    -Dbuiltin_ftgl=ON \
118                    -Dmathmore=OFF \
119                    -Dgenvector=ON \
120                    -Dmemstat=ON \
121                    -Dunuran=ON \
122                    -Dtable=ON \
123                    -Dgdml=ON \
124                    -Dhttp=OFF \
125                    -Dvc=OFF \
126                    -Dastiff=ON \
127                    -Dgeocad=OFF \
128                    -Dr=OFF \
129                    -DPNG_LIBRARY=${prefix}/lib/libpng.dylib \
130                    -DPNG_PNG_INCLUDE_DIR=${prefix}/include
131
132platform darwin {
133
134    # No longer compiles on OSX10.6, due to update to internal LLVM version.
135    # Disable build on this platform.
136    if { ${os.major} < 11 } {
137        pre-fetch {
138            ui_error "${name} is not supported on this OSX release."
139            return -code error "Unsupported OSX version"
140        }
141    }
142
143    # Note that we are forcing this choice.  This means that anything linking
144    # against root6 needs to also be using libc++.  This is possibly
145    # problematic, but luckily there is just a limited set of such dependents.
146    # Another problem is that all dependencies might need to be built-in
147    # to make sure that they all use libc++.
148    if { ${configure.cxx_stdlib} ne "libc++" } {
149        configure.cxx_stdlib libc++
150        depends_lib-append port:libcxx
151    }
152
153    pre-configure {
154        # replace
155        #   -DCMAKE_OSX_SYSROOT="/Developer/SDKs/MacOSX10.6.sdk"
156        #   -DCMAKE_OSX_DEPLOYMENT_TARGET="10.6"
157        # with
158        #   -DCMAKE_OSX_SYSROOT="/"
159        #   -DCMAKE_OSX_DEPLOYMENT_TARGET=""
160        configure.args-strsed "s|CMAKE_OSX_SYSROOT=\[^\[:blank:\]\]*|CMAKE_OSX_SYSROOT=\"/\"|"
161        configure.args-strsed "s|CMAKE_OSX_DEPLOYMENT_TARGET=\[^\[:blank:\]\]*|CMAKE_OSX_DEPLOYMENT_TARGET=\"\"|"
162
163        # Force use of system python in build scripts
164        # Find command finds text files containing the string to be replaced.
165        # shtest-encoding.py intentionally includes an unreadable character, so have to skip it ...
166        set pystringtoreplace "/usr/bin/env python"
167        foreach f [ exec find ${worksrcpath} -type f -and -not -name "shtest-encoding.py" -and -name "*.py" ] {
168            reinplace "s|${pystringtoreplace}|/usr/bin/python|g" $f
169        }
170    }
171}
172
173post-destroot {
174    # Temporary - Set execute flag on binaries (broken in 6.06.00)
175    foreach f [glob -directory ${destroot}${install_prefix}/bin *] {
176        system "chmod +x $f"
177    }
178    # create versioned symlinks for the content of libexec bin dir
179    foreach f [glob -directory ${destroot}${install_prefix}/bin *] {
180        set filename  [file tail $f]
181        set extension [file extension $filename]
182        set base      [file rootname $filename]
183        set versioned_filename ${base}${version_major}${extension}
184        ln -s ${install_prefix}/bin/${filename} ${destroot}${prefix}/bin/${versioned_filename}
185    }
186    # lib dir
187    ln -s ${install_prefix}/lib/root ${destroot}${prefix}/lib/root${version_major}
188    # include dir
189    ln -s ${install_prefix}/include/root ${destroot}${prefix}/include/root${version_major}
190    # etc dir
191    ln -s ${install_prefix}/etc/root ${destroot}${prefix}/etc/root${version_major}
192    # share dir
193    ln -s ${install_prefix}/share ${destroot}${prefix}/share/root${version_major}
194    # Compress manpages in custom location (borrowed from mariadb)
195    set manpath ${install_prefix}/share/man
196    set gzip [findBinary gzip ${portutil::autoconf::gzip_path}]
197    foreach manpage [glob -type f ${destroot}${manpath}/man1/*] {
198        # Zip the man file
199        system "$gzip -9vf ${manpage}"
200        # Create man pages for versioned files
201        set filename  [file tail $manpage]
202        set extension [file extension $filename]
203        set base      [file rootname $filename]
204        set versioned_filename ${base}${version_major}${extension}.gz
205        set d [file tail $manpage]
206        ln -s ${manpath}/man1/${d}.gz ${destroot}${prefix}/share/man/man1/${versioned_filename}
207    }
208}
209
210set run_port_select "No"
211pre-activate {
212  if { ![file exists ${prefix}/bin/root]  &&
213       ![file exists ${prefix}/bin/root5] &&
214       ![file exists ${prefix}/bin/root6] } {
215     set run_port_select "Yes"
216  }
217}
218
219post-activate {
220  ui_msg "======================================================================================"
221  if { ${run_port_select} == "Yes" } {
222      ui_msg "  Making root${version_major} your default root version. To change this run 'sudo port select root'"
223      catch { system "port select root root${version_major}" }
224  } else {
225      ui_msg "  To make root${version_major} your default root version, run 'sudo port select root root${version_major}'"
226  }
227  ui_msg "======================================================================================"
228}
229
230universal_variant   no
231
232default_variants    +cocoa +ssl +xml +gsl +minuit2 +tmva +roofit +graphviz +opengl +soversion +http
233
234# Enable C++14 by default when Xcode allows (Xcode 6.3 onwards)
235if { [vercmp $xcodeversion "6.3"] >= 0 } {
236    default_variants-append +cxx14
237}
238
239variant qt4 description {Enable QT4 support} {
240    configure.args-replace  -Dqt=OFF -Dqt=ON
241    PortGroup qt4 1.0
242}
243
244variant cxx14 description {Enable c++14 compiler support} {
245    configure.args-replace  -Dcxx14=OFF -Dcxx14=ON
246    # Update compiler blacklist to force use of MP's Clang 3.7 when required
247    compiler.blacklist-append {clang < 602} macports-clang-3.4
248}
249
250variant valgrind description {Build internal LLVM library with valgrind support} {
251    depends_lib-append      port:valgrind
252}
253
254variant http description {Build with HTTP Server library support} {
255    configure.args-replace  -Dhttp=OFF -Dhttp=ON
256}
257
258variant vc description {Build with Vc library support} {
259    ui_msg "Vc support is currently disabled by upstream"
260#   configure.args-replace  -Dvc=OFF -Dvc=ON
261}
262
263variant debug description {Enable a debug build} {
264    configure.args-append   -DCMAKE_BUILD_TYPE=Debug
265}
266
267variant xrootd description {Build with XRootD support} {
268    configure.args-replace  -Dxrootd=OFF -Dxrootd=ON
269#   configure.args-append   -Dbuiltin_xrootd=ON
270    configure.args-append   -DXROOTD_INCLUDE_DIR="${prefix}/include/xrootd"
271    depends_lib-append      port:xrootd
272}
273
274variant soversion description {Build with soversion support} {
275    configure.args-replace  -Dsoversion=OFF -Dsoversion=ON
276}
277
278variant graphviz description {Build with graphviz support} {
279    configure.args-replace  -Dgviz=OFF -Dgviz=ON
280    configure.args-append   -DGRAPHVIZ_INCLUDE_DIR="${prefix}/include"
281#                           -DGRAPHVIZ_CDT_LIBRARY="${prefix}/lib/libcdt.dylib" \
282#                           -DGRAPHVIZ_GRAPH_LIBRARY="${prefix}/lib/libcgraph.dylib" \
283#                           -DGRAPHVIZ_GVC_LIBRARY="${prefix}/lib/libgvc.dylib" \
284#                           -DGRAPHVIZ_PATHPLAN_LIBRARY="${prefix}/lib/libpathplan.dylib"
285    depends_lib-append      path:bin/dot:graphviz
286}
287
288variant avahi description {Build with avahi support} {
289    configure.args-replace  -Dbonjour=OFF -Dbonjour=ON
290#   configure.args-append   -DAVAHI_INCLUDE_DIR="${prefix}/include" \
291#                           -DAVAHI_client_LIBRARY="${prefix}/lib"
292    depends_lib-append      port:avahi
293}
294
295variant fftw3 description {Build with fftw3 support} {
296    configure.args-replace  -Dfftw3=OFF -Dfftw3=ON
297    configure.args-append   -DFFTW_INCLUDE_DIR="${prefix}/include" \
298                            -DFFTW_LIBRARY="${prefix}/lib/libfftw3.dylib"
299    depends_lib-append      port:fftw-3
300}
301
302variant gsl description {Build with gsl support} {
303    # Builtin GSL library
304    #configure.args-replace -Dbuiltin_gsl=OFF -Dbuiltin_gsl=ON
305    # External GSL library
306    configure.args-replace  -Dgsl_shared=OFF -Dgsl_shared=ON
307    configure.args-append   -DGSL_CONFIG_EXECUTABLE="${prefix}/bin/gsl-config"
308    depends_lib-append      port:gsl
309    # Enable the MathMore library
310    configure.args-replace  -Dmathmore=OFF -Dmathmore=ON
311}
312
313variant fitsio description {Build with fitsio support} {
314    configure.args-replace  -Dfitsio=OFF -Dfitsio=ON
315    configure.args-append   -DCFITSIO_INCLUDE_DIR="${prefix}/include" \
316                            -DCFITSIO_LIBRARIES="${prefix}/lib"
317    depends_lib-append      port:cfitsio
318}
319
320variant odbc description {Build with odbc support} {
321    configure.args-replace  -Dodbc=OFF -Dodbc=ON
322    configure.args-append   -DODBC_INCLUDE_DIR="${prefix}/include" \
323                            -DODBC_LIBRARY="${prefix}/lib/libiodbc.dylib"
324    depends_lib-append      port:libiodbc
325}
326
327variant ldap description {Build with ldap support} {
328    configure.args-replace  -Dldap=OFF -Dldap=ON
329#   configure.args-append   -DLDAP_INCLUDE_DIR="${prefix}/include" \
330#                           -DLDAP_LIBRARY="${prefix}/lib"
331    depends_lib-append      port:openldap
332}
333
334variant roofit description {Build the RooFit advanced fitting package} {
335    configure.args-replace  -Droofit=OFF -Droofit=ON
336}
337
338variant tmva description {Build the TMVA package} {
339    configure.args-replace  -Dtmva=OFF -Dtmva=ON
340}
341
342variant minuit2 description {Build with minuit2 support} {
343    configure.args-replace  -Dminuit2=OFF -Dminuit2=ON
344}
345
346variant opengl description {Build with opengl support} {
347    configure.args-delete   -Dopengl=OFF
348    configure.args-delete   -Dbuiltin_glew=OFF
349    configure.args-append   -Dopengl=ON -Dbuiltin_glew=ON
350}
351
352# ========================================================================================
353# Setup various python variants
354# ========================================================================================
355
356# List of possible python versions
357set python_versions { 2.6 2.7 3.3 3.4 }
358set default_python_variant +python27
359
360# Define the available variants
361foreach py_ver ${python_versions} {
362    set py_ver_no_dot [join [split ${py_ver} "."] ""]
363    set variant_line {variant python${py_ver_no_dot} description "Build with python ${py_ver} support"}
364    foreach py_over ${python_versions} {
365        if { ${py_ver} == ${py_over} } { continue }
366        set py_over_no_dot [join [split ${py_over} "."] ""]
367        append variant_line " conflicts python${py_over_no_dot}"
368    }
369    append variant_line { { } }
370    eval $variant_line
371    if {[variant_isset python${py_ver_no_dot}]} {
372        if {${default_python_variant} != "+python${py_ver_no_dot}"} {
373            set default_python_variant ""
374        }
375    }
376}
377
378if {${default_python_variant} != ""} {
379    default_variants-append "${default_python_variant}"
380}
381
382# If a python variant is enabled, activate it
383set active_python_version ""
384foreach py_ver ${python_versions} {
385    set py_ver_no_dot [join [split ${py_ver} "."] ""]
386    if {[variant_isset python${py_ver_no_dot}]} {
387
388        set active_python_version        ${py_ver}
389        set active_python_version_no_dot ${py_ver_no_dot}
390
391        # Check root5 variants
392        pre-activate {
393            set portname root5
394            if {![catch {set result [active_variants ${portname} python${active_python_version_no_dot}]}]} {
395                if {$result} {
396                    ui_error "Cannot install ${name} with +python${active_python_version_no_dot} variant"
397                    return -code error "${portname} port is already installed with +python${active_python_version_no_dot} and both cannot be active at once. Pick a different python variant."
398                }
399            }
400        }
401
402        # Setup python
403        set mypydir ${frameworks_dir}/Python.framework/Versions/${py_ver}
404        configure.args-replace  -Dpython=OFF -Dpython=ON
405        configure.args-append   -DPYTHON_INCLUDE_DIR="${mypydir}/Headers" \
406                                -DPYTHON_EXECUTABLE="${mypydir}/bin/python${py_ver}"
407        # Explicitly set python library
408        if       { [ file exists "${mypydir}/lib/libpython${py_ver}.dylib" ] } {
409            configure.args-append -DPYTHON_LIBRARY="${mypydir}/lib/libpython${py_ver}.dylib"
410        } elseif { [ file exists "${prefix}/lib/libpython${py_ver}.dylib" ] } {
411            configure.args-append -DPYTHON_LIBRARY="${prefix}/lib/libpython${py_ver}.dylib"
412        }
413        depends_lib-append      port:python${py_ver_no_dot}
414       
415        post-destroot {
416            # Install PyROOT lib in the correct place
417            set mypylibdir  ${frameworks_dir}/Python.framework/Versions/${active_python_version}/lib/python${active_python_version}
418            set mypysitedir ${mypylibdir}/site-packages/
419            file mkdir ${destroot}${mypysitedir}
420            foreach pyfile [glob ${destroot}${install_prefix}/lib/root/*.py*] { move $pyfile ${destroot}${mypysitedir}/ }
421            ln -sf ${install_prefix}/lib/root/libPyROOT.so ${destroot}${mypylibdir}/
422            # Fix python version in scripts
423            set pystringtoreplace "/usr/bin/python"
424            foreach f [ exec find ${destroot}${install_prefix} -type f -and -name "*.py" ] {
425                reinplace "s|${pystringtoreplace}|${prefix}/bin/python${active_python_version}|g" $f
426            }
427            foreach f [ exec find ${destroot}${install_prefix}/bin -type f | xargs grep -Il ${pystringtoreplace} ] {
428                reinplace "s|${pystringtoreplace}|${prefix}/bin/python${active_python_version}|g" $f
429            }
430        }
431
432    }
433}
434
435# ========================================================================================
436
437variant ssl description {Build with ssl support} {
438    configure.args-replace  -Dssl=OFF -Dssl=ON
439    depends_lib-append      path:lib/libssl.dylib:openssl
440}
441
442variant xml description {Build with xml support} {
443    configure.args-replace  -Dxml=OFF -Dxml=ON
444    configure.args-append   -DLIBXML2_INCLUDE_DIR="${prefix}/include/libxml2" \
445                            -DLIBXML2_LIBRARIES="${prefix}/lib/libxml2.dylib" \
446                            -DLIBXML2_XMLLINT_EXECUTABLE="${prefix}/bin/xmllint"
447    depends_lib-append      port:libxml2
448}
449
450variant sqlite3 description {Build with sqlite3 support} {
451    configure.args-replace  -Dsqlite=OFF -Dsqlite=ON
452    depends_lib-append      port:sqlite3
453}
454
455variant mysql conflicts mysql51 mysql55 mysql56 mariadb percona description {Build with mysql5 support} {
456    configure.args-replace  -Dmysql=OFF -Dmysql=ON
457    configure.args-append   -DMYSQL_CONFIG_EXECUTABLE=${prefix}"/lib/mysql5/bin/mysql_config"
458    depends_lib-append      port:mysql5
459}
460
461variant mysql51 conflicts mysql mysql55 mysql56 mariadb percona description {Build with mysql51 support} {
462    configure.args-replace  -Dmysql=OFF -Dmysql=ON
463    configure.args-append   -DMYSQL_CONFIG_EXECUTABLE=${prefix}"/lib/mysql51/bin/mysql_config"
464    depends_lib-append      port:mysql51
465}
466
467variant mysql55 conflicts mysql mysql51 mysql56 mariadb percona description {Build with mysql55 support} {
468    configure.args-replace  -Dmysql=OFF -Dmysql=ON
469    configure.args-append   -DMYSQL_CONFIG_EXECUTABLE=${prefix}"/lib/mysql55/bin/mysql_config"
470    depends_lib-append      port:mysql55
471}
472
473variant mysql56 conflicts mysql mysql51 mysql55 mariadb percona description {Build with mysql56 support} {
474    configure.args-replace  -Dmysql=OFF -Dmysql=ON
475    configure.args-append   -DMYSQL_CONFIG_EXECUTABLE=${prefix}"/lib/mysql56/bin/mysql_config"
476    depends_lib-append      port:mysql56
477}
478
479variant mariadb conflicts mysql mysql51 mysql55 mysql56 percona description {Build with mariadb support} {
480    configure.args-replace  -Dmysql=OFF -Dmysql=ON
481    configure.args-append   -DMYSQL_CONFIG_EXECUTABLE=${prefix}"/lib/mariadb/bin/mysql_config"
482    depends_lib-append      port:mariadb
483}
484
485variant percona conflicts mysql mysql51 mysql55 mysql56 mariadb description {Build with percona support} {
486    configure.args-replace  -Dmysql=OFF -Dmysql=ON
487    configure.args-append   -DMYSQL_CONFIG_EXECUTABLE=${prefix}"/lib/percona/bin/mysql_config"
488    depends_lib-append      port:percona
489}
490
491variant postgresql90 conflicts postgresql92 description {Build with PostgreSQL 9.0 support} {
492    configure.args-replace -Dpgsql=OFF -Dpgsql=ON
493    configure.args-append  -DPOSTGRESQL_INCLUDE_DIR="${prefix}/include/postgresql90"\
494                           -DPOSTGRESQL_LIBRARY="${prefix}/lib/postgresql90/libpq.dylib"
495    depends_lib-append      port:libpqxx port:postgresql90
496}
497
498variant postgresql92 conflicts postgresql90 description {Build with PostgreSQL 9.2 support} {
499    configure.args-replace -Dpgsql=OFF -Dpgsql=ON
500    configure.args-append  -DPOSTGRESQL_INCLUDE_DIR="${prefix}/include/postgresql92" \
501                           -DPOSTGRESQL_LIBRARY="${prefix}/lib/postgresql92/libpq.dylib"
502    depends_lib-append      port:libpqxx port:postgresql92
503}
504
505# variant oracle description {Build with Oracle support} {
506#     configure.args-replace --disable-oracle --enable-oracle
507#     configure.args-append  -DORACLE_PATH_INCLUDES="${prefix}/lib/oracle/sdk/include" \
508#                            -DORACLE_PATH_LIB="${prefix}/lib/oracle" \
509#                            -DORACLE_OCI_VERSION=8
510#     depends_lib-append     port:oracle-instantclient
511# }
512
513variant pythia description {Enables Pythia 8 support} {
514    configure.args-replace  -Dpythia8=OFF -Dpythia8=ON
515    configure.args-append   -DPYTHIA8_INCLUDE_DIR=${prefix}/include/pythia \
516                            -DPYTHIA8_LIBRARY=${prefix}/lib/libpythia8.dylib
517    depends_lib-append      port:pythia
518}
519
520variant cocoa conflicts x11 description {Enables native OSX graphical backend} {
521    # Enable cocoa support in configure
522    configure.args-append   -Dcocoa=ON -Dx11=OFF
523}
524
525variant x11 conflicts cocoa description {Enables X11 graphical backend} {
526    # Dependencies on X11 ports
527    depends_lib-append      port:xorg-libX11 port:mesa port:libGLU port:Xft2 port:xpm
528    # Disable cocoa
529    configure.args-append   -Dcocoa=OFF -Dx11=ON \
530                            -DOPENGL_INCLUDE_DIR=${prefix}/include \
531                            -DOPENGL_gl_LIBRARY=${prefix}/lib/libGL.dylib \
532                            -DX11_ICE_INCLUDE_PATH=${prefix}/include \
533                            -DX11_SM_INCLUDE_PATH=${prefix}/include \
534                            -DX11_X11_INCLUDE_PATH=${prefix}/include \
535                            -DX11_Xext_INCLUDE_PATH=${prefix}/include \
536                            -DX11_Xft_INCLUDE_PATH=${prefix}/include \
537                            -DX11_Xpm_INCLUDE_PATH=${prefix}/include \
538                            -DX11_ICE_LIB=${prefix}/lib/libICE.dylib \
539                            -DX11_SM_LIB=${prefix}/lib/libSM.dylib \
540                            -DX11_X11_LIB=${prefix}/lib/libX11.dylib \
541                            -DX11_Xext_LIB=${prefix}/lib/libXext.dylib \
542                            -DX11_Xft_LIB=${prefix}/lib/libXft.dylib \
543                            -DX11_Xpm_LIB=${prefix}/lib/libXpm.dylib \
544                            -DOPENGL_glu_LIBRARY=${prefix}/lib/libGLU.dylib
545}
546
547# ========================================================================================
548# Setup various clang variants, to provide alternative C++ compilers that support cocoa
549# ========================================================================================
550
551# List of possible clang versions that work
552set clang_versions { 3.4 3.5 3.6 3.7 3.8 }
553
554# Define the available variants
555foreach clang_ver ${clang_versions} {
556    set clang_ver_no_dot [join [split ${clang_ver} "."] ""]
557    set variant_line {variant clang${clang_ver_no_dot} description "Compile using MacPorts clang ${clang_ver}"}
558    foreach clang_over ${clang_versions} {
559        if { ${clang_ver} == ${clang_over} } { continue }
560        set clang_over_no_dot [join [split ${clang_over} "."] ""]
561        append variant_line " conflicts clang${clang_over_no_dot}"
562    }
563    append variant_line { { } }
564    eval $variant_line
565}
566
567# make sure that the proper variant is automatically selected
568# (ROOT crashes if the compiler it was built with doesn't exist)
569if { ![variant_isset clang34] &&
570     ![variant_isset clang35] &&
571     ![variant_isset clang36] &&
572     ![variant_isset clang37] &&
573     ![variant_isset clang38] } {
574    if       { ${configure.compiler} eq "macports-clang-3.4" } {
575        default_variants-append +clang34
576    } elseif { ${configure.compiler} eq "macports-clang-3.5" } {
577        default_variants-append +clang35
578    } elseif { ${configure.compiler} eq "macports-clang-3.6" } {
579        default_variants-append +clang36
580    } elseif { ${configure.compiler} eq "macports-clang-3.7" } {
581        default_variants-append +clang37
582    } elseif { ${configure.compiler} eq "macports-clang-3.8" } {
583        default_variants-append +clang38
584    }
585}
586
587# Is a variant active ?
588set active_clang_variant ""
589foreach clang_ver ${clang_versions} {
590    set clang_ver_no_dot [join [split ${clang_ver} "."] ""]
591    if {[variant_isset clang${clang_ver_no_dot}]} {
592        set active_clang_variant ${clang_ver}
593    }
594}
595
596# If so, set it up.
597if { ${active_clang_variant} != "" } {
598    configure.compiler  macports-clang-${active_clang_variant}
599    # TODO
600    # configure.args-append   --with-llvm-config="${prefix}/bin/llvm-config-mp-"${active_clang_variant}
601    depends_run-append  port:clang-${active_clang_variant}
602}
603
604# ========================================================================================
605# Following is for fortran support
606# Might eventually move to a portgroup, or similar, so could be simplified.
607# Based on recipe from https://trac.macports.org/wiki/PortfileRecipes#fortran
608# Note that g95 does not work here, so that variant is removed
609# ========================================================================================
610
611set gcc_versions { 4.7 4.8 4.9 5 6 }
612set default_fortran_variant +gcc6
613
614foreach gcc_ver ${gcc_versions} {
615    set gcc_ver_no_dot [join [split ${gcc_ver} "."] ""]
616
617    set variant_line {variant gcc${gcc_ver_no_dot} description "Build with gfortran from gcc${gcc_ver_no_dot}"}
618
619    foreach gcc_over ${gcc_versions} {
620        if {${gcc_ver} == ${gcc_over}} {
621            continue
622        }
623        set gcc_over_no_dot [join [split ${gcc_over} "."] ""]
624        append variant_line " conflicts gcc${gcc_over_no_dot}"
625    }
626
627    append variant_line { {} }
628
629    eval $variant_line
630
631    if {[variant_isset gcc${gcc_ver_no_dot}]} {
632        if {${default_fortran_variant} != "+gcc${gcc_ver_no_dot}"} {
633            set default_fortran_variant ""
634        }
635    }
636}
637
638if {${default_fortran_variant} != ""} {
639    default_variants-append "${default_fortran_variant}"
640}
641
642foreach gcc_ver ${gcc_versions} {
643    set gcc_ver_no_dot [join [split ${gcc_ver} "."] ""]
644
645    if {[variant_isset gcc${gcc_ver_no_dot}]} {
646        depends_lib-append path:lib/libgcc/libgcc_s.1.dylib:libgcc
647        depends_build-append port:gcc${gcc_ver_no_dot}
648
649        configure.fc  ${prefix}/bin/gfortran-mp-${gcc_ver}
650        configure.f77 ${prefix}/bin/gfortran-mp-${gcc_ver}
651        configure.f90 ${prefix}/bin/gfortran-mp-${gcc_ver}
652
653        configure.args-replace -Dfortran=OFF -Dfortran=ON
654    }
655}
656
657# ========================================================================================
658
659# Various variants etc. with problems. Work in progress...
660
661# variant ruby description {Build with ruby support} {
662#     configure.args-replace  -Druby=OFF -Druby=ON
663#     depends_lib-append      port:ruby
664# }
665
666# variant geocad description {Enable CAD Interface} {
667#     configure.args-replace  -Dgeocad=OFF -Dgeocad=ON
668#     depends_lib-append      port:oce
669#     configure.args-append   -DOCC_INCLUDE_DIR="${prefix}/include/oce"
670# }
671
672# variant r description {Enable R support} {
673#     configure.args-replace  -Dr=OFF -Dr=ON
674#     depends_lib-append  port:R
675# }
676
677livecheck.type      regex
678livecheck.url       ${github.homepage}/tags
679livecheck.regex     {archive/v(6[-.]\d[02468][-.]\d{2}).tar.gz}
Note: See TracBrowser for help on using the repository browser.