# -*- 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 # $Id$ PortSystem 1.0 PortGroup active_variants 1.1 PortGroup select 1.0 PortGroup compiler_blacklist_versions 1.0 PortGroup github 1.0 #github.setup root-mirror root 5-34-36 v github.setup root-mirror root c06fdea version 5.34.37 set version_major [lindex [split ${version} .] 0] checksums rmd160 4d28ced0f6faee87e5dd7130f96c15fd0237041b \ sha256 da68645b5c31b6fe2c52cf73a6f7c848d3ccdd2ef68436b953c95c55cb030468 name root${version_major} categories science maintainers hep.phy.cam.ac.uk:jonesc license LGPL-2.1+ description ROOT is a data analysis framework from CERN long_description The ROOT system provides a set of frameworks with all \ the functionality needed to handle and analyze large amounts \ of data in a very efficient way. homepage http://root.cern.ch/ platforms darwin dist_subdir root depends_lib port:xz \ port:pcre \ port:zlib \ port:jpeg \ port:libpng \ port:giflib \ port:tiff \ port:gmp \ port:expat \ port:lzma # port:freetype depends_run port:root_select # TODO: the file ${filespath}/${name} would have to be generated on the fly instead select.group root select.file ${filespath}/${name} # Force a compatible compiler compiler.blacklist-append *gcc* {clang < 500} macports-clang-3.3 compiler.fallback-append macports-clang-3.8 macports-clang-3.7 macports-clang-3.6 macports-clang-3.5 post-patch { # reinplace "s|-lfreetype| \`freetype-config --libs\`|g" ${worksrcpath}/config/root-config.in reinplace "s|\"/usr/include\"|\"${prefix}/include /usr/include\"|g" ${worksrcpath}/configure reinplace "s|/usr/lib |${prefix}/lib /usr/lib |g" ${worksrcpath}/configure reinplace "s|/usr/include |${prefix}/include /usr/include |g" ${worksrcpath}/configure reinplace "s|\"/usr/lib\"|\"${prefix}/lib /usr/lib\"|g" ${worksrcpath}/configure } # port specific location set install_prefix ${prefix}/libexec/root${version_major} pre-configure { configure.args-append \ --with-cc=${configure.cc} \ --with-cxx=${configure.cxx} \ --with-ld=${configure.cxx} \ --with-f77=${configure.f77} # the build type (32 or 64 bit) -must- be for first argument if {${build_arch} eq "i386" || ${build_arch} eq "ppc"} { configure.pre_args macosx --prefix=${install_prefix} } else { configure.pre_args macosx64 --prefix=${install_prefix} } } configure.args --etcdir=${install_prefix}/etc/root \ --disable-builtin-glew \ --disable-builtin-pcre \ --disable-builtin-zlib \ --disable-builtin-lzma \ --disable-fftw3 \ --disable-krb5 \ --disable-ldap \ --disable-mysql \ --disable-sqlite \ --disable-odbc \ --disable-opengl \ --disable-pythia6 \ --disable-pythia8 \ --disable-roofit \ --disable-ssl \ --disable-xml \ --disable-python \ --disable-fitsio \ --disable-gsl-shared \ --disable-pgsql \ --disable-dcache \ --disable-chirp \ --disable-hdfs \ --disable-ruby \ --disable-minuit2 \ --disable-tmva \ --disable-qt \ --disable-qtgsi \ --disable-bonjour \ --disable-gviz \ --disable-soversion \ --disable-c++11 \ --disable-xrootd \ --disable-oracle \ --disable-http \ --disable-vc \ --disable-mathmore \ --enable-builtin-ftgl \ --enable-genvector \ --enable-memstat \ --enable-unuran \ --enable-reflex \ --enable-table \ --enable-fink \ --enable-gdml \ --enable-builtin-freetype platform darwin { if {${configure.cxx_stdlib} eq "libc++"} { configure.args-replace --disable-c++11 --enable-c++11 } } post-destroot { # create versioned symlinks for the content of libexec # bin dir foreach f [glob -directory ${destroot}${install_prefix}/bin *] { set filename [file tail $f] set extension [file extension $filename] set base [file rootname $filename] set versioned_filename ${base}${version_major}${extension} ln -s ${install_prefix}/bin/${filename} ${destroot}${prefix}/bin/${versioned_filename} } # lib dir ln -s ${install_prefix}/lib/root ${destroot}${prefix}/lib/root${version_major} # include dir ln -s ${install_prefix}/include/root ${destroot}${prefix}/include/root${version_major} # etc dir ln -s ${install_prefix}/etc/root ${destroot}${prefix}/etc/root${version_major} # share dir ln -s ${install_prefix}/share ${destroot}${prefix}/share/root${version_major} # 'Fix' genreflex reinplace "s|lib/python/genreflex|lib/root${version_major}/python/genreflex|g" ${destroot}${install_prefix}/bin/genreflex # Compress manpages in custom location (borrowed from mariadb) set manpath ${install_prefix}/share/man set gzip [findBinary gzip ${portutil::autoconf::gzip_path}] foreach manpage [glob -type f ${destroot}${manpath}/man1/*] { # Zip the man file system "$gzip -9vf ${manpage}" # Create man pages for versioned files set filename [file tail $manpage] set extension [file extension $filename] set base [file rootname $filename] set versioned_filename ${base}${version_major}${extension}.gz set d [file tail $manpage] ln -s ${manpath}/man1/${d}.gz ${destroot}${prefix}/share/man/man1/${versioned_filename} } } set run_port_select "No" pre-activate { if { ![file exists ${prefix}/bin/root] && ![file exists ${prefix}/bin/root5] && ![file exists ${prefix}/bin/root6] } { set run_port_select "Yes" } } post-activate { ui_msg "======================================================================================" if { ${run_port_select} == "Yes" } { ui_msg " Making root${version_major} your default root version. To change this run 'sudo port select root'" catch { system "port select root root${version_major}" } } else { ui_msg " To make root${version_major} your default root version, run 'sudo port select root root${version_major}'" } ui_msg "======================================================================================" } universal_variant no default_variants +ssl +xml +gsl +minuit2 +tmva +roofit +graphviz +opengl +soversion +http # Since ROOT 5.34.15 the cocoa backend is default on OSX 10.8 or newer # We also make it default on 10.7 if {${os.major} > 10} { set default_gui_variant +cocoa } else { set default_gui_variant +x11 } variant http description {Build with HTTP Server library support} { configure.args-replace --disable-http --enable-http } variant vc description {Build with Vc library support} { configure.args-replace --disable-vc --enable-vc } variant debug description {Enable a debug build} { configure.args-append --build=debug } variant xrootd description {Build with XRootD support} { configure.args-delete --disable-xrootd configure.args-append --enable-xrootd \ --with-xrootd-incdir="${prefix}/include/xrootd" \ --with-xrootd-libdir="${prefix}/lib" depends_lib-append port:xrootd } variant soversion description {Build with soversion support} { configure.args-replace --disable-soversion --enable-soversion } variant graphviz description {Build with graphviz support} { configure.args-delete --disable-gviz configure.args-append --enable-gviz \ --with-gviz-incdir="${prefix}/include/graphviz" \ --with-gviz-libdir="${prefix}/lib" depends_lib-append path:bin/dot:graphviz } variant avahi description {Build with avahi support} { configure.args-delete --disable-bonjour configure.args-append --enable-bonjour \ --with-avahi-incdir="${prefix}/include" \ --with-avahi-libdir="${prefix}/lib" depends_lib-append port:avahi } variant fftw3 description {Build with fftw3 support} { configure.args-delete --disable-fftw3 configure.args-append --enable-fftw3 \ --with-fftw3-incdir="${prefix}/include" \ --with-fftw3-libdir="${prefix}/lib" depends_lib-append port:fftw-3 } variant gsl description {Build with gsl support} { configure.args-replace --disable-mathmore --enable-mathmore configure.args-delete --disable-gsl-shared configure.args-append --enable-gsl-shared \ --with-gsl-incdir="${prefix}/include" \ --with-gsl-libdir="${prefix}/lib" depends_lib-append port:gsl } variant fitsio description {Build with fitsio support} { configure.args-delete --disable-fitsio configure.args-append --enable-fitsio \ --with-cfitsio-incdir="${prefix}/include" \ --with-cfitsio-libdir="${prefix}/lib" depends_lib-append port:cfitsio } variant odbc description {Build with odbc support} { configure.args-delete --disable-odbc configure.args-append --enable-odbc \ --with-odbc-incdir="${prefix}/include" \ --with-odbc-libdir="${prefix}/lib" depends_lib-append port:libiodbc } variant ldap description {Build with ldap support} { configure.args-delete --disable-ldap configure.args-append --enable-ldap \ --with-ldap-incdir="${prefix}/include" \ --with-ldap-libdir="${prefix}/lib" depends_lib-append port:openldap } variant roofit description {Build the RooFit advanced fitting package} { configure.args-replace --disable-roofit --enable-roofit } variant tmva description {Build the TMVA package} { configure.args-replace --disable-tmva --enable-tmva post-destroot { set tmvaTuts ${destroot}${install_prefix}/share/root/tutorial/tmva file mkdir ${tmvaTuts} foreach f [glob ${worksrcpath}/tmva/test/*] { file copy $f ${tmvaTuts}/ } } } variant minuit2 description {Build with minuit2 support} { configure.args-replace --disable-minuit2 --enable-minuit2 } variant opengl description {Build with opengl support} { configure.args-delete --disable-opengl configure.args-delete --disable-builtin-glew configure.args-append --enable-opengl --enable-builtin-glew } # ======================================================================================== # Setup various python variants # ======================================================================================== # List of possible python versions set python_versions { 2.6 2.7 3.3 3.4 3.5 } # Define the available variants foreach ver ${python_versions} { set ver_no_dot [join [split ${ver} "."] ""] set variant_line {variant python${ver_no_dot} description "Build with python ${ver} support"} foreach over ${python_versions} { if { ${ver} == ${over} } { continue } set over_no_dot [join [split ${over} "."] ""] append variant_line " conflicts python${over_no_dot}" } append variant_line { { } } eval $variant_line } # Is a variant active ? set active_python_variant "" foreach ver ${python_versions} { set ver_no_dot [join [split ${ver} "."] ""] if {[variant_isset python${ver_no_dot}]} { set active_python_variant ${ver} } } # If so, set it up. if { ${active_python_variant} != "" } { set ver_no_dot [join [split ${active_python_variant} "."] ""] if {![catch {set result [active_variants root6 python${ver_no_dot}]}]} { if {$result} { ui_error "Cannot install ${name} with +python${ver_no_dot} variant" return -code error "root6 port is already installed with +python${ver_no_dot} and both cannot be active at once. Pick a different python variant." } } set mypydir ${frameworks_dir}/Python.framework/Versions/${active_python_variant} configure.args-delete --disable-python configure.args-append --enable-python \ --with-python-incdir="${mypydir}/Headers" \ --with-python-libdir="${mypydir}" depends_lib-append port:python${ver_no_dot} post-destroot { set mypylibdir ${frameworks_dir}/Python.framework/Versions/${active_python_variant}/lib/python${active_python_variant} set mypysitedir ${mypylibdir}/site-packages/ file mkdir ${destroot}${mypysitedir} foreach pyfile [glob ${destroot}${install_prefix}/lib/root/*.py*] { move $pyfile ${destroot}${mypysitedir}/ } ln -sf ${install_prefix}/lib/root/libPyROOT.so ${destroot}${mypylibdir}/ } } # ======================================================================================== variant ssl description {Build with ssl support} { configure.args-delete --disable-ssl configure.args-append --enable-ssl \ --with-ssl-shared=yes \ --with-ssl-incdir="${prefix}/include" \ --with-ssl-libdir="${prefix}/lib" depends_lib-append path:lib/libssl.dylib:openssl } variant xml description {Build with xml support} { configure.args-delete --disable-xml configure.args-append --enable-xml \ --with-xml-incdir="${prefix}/include/libxml2" \ --with-xml-libdir="${prefix}/lib" depends_lib-append port:libxml2 } variant sqlite3 description {Build with sqlite3 support} { configure.args-delete --disable-sqlite configure.args-append --enable-sqlite \ --with-sqlite-incdir="${prefix}/include" \ --with-sqlite-libdir="${prefix}/lib" depends_lib-append port:sqlite3 } variant mysql conflicts mysql51 mysql55 mysql56 mariadb percona description {Build with mysql5 support} { configure.args-delete --disable-mysql configure.args-append --enable-mysql \ --with-mysql-incdir="${prefix}/include/mysql5/mysql" \ --with-mysql-libdir="${prefix}/lib/mysql5/mysql" depends_lib-append port:mysql5 } variant mysql51 conflicts mysql mysql55 mysql56 mariadb percona description {Build with mysql51 support} { configure.args-delete --disable-mysql configure.args-append --enable-mysql \ --with-mysql-incdir="${prefix}/include/mysql51/mysql" \ --with-mysql-libdir="${prefix}/lib/mysql51/mysql" depends_lib-append port:mysql51 } variant mysql55 conflicts mysql mysql51 mysql56 mariadb percona description {Build with mysql55 support} { configure.args-delete --disable-mysql configure.args-append --enable-mysql \ --with-mysql-incdir="${prefix}/include/mysql55/mysql" \ --with-mysql-libdir="${prefix}/lib/mysql55/mysql" depends_lib-append port:mysql55 } variant mysql56 conflicts mysql mysql51 mysql55 mariadb percona description {Build with mysql56 support} { configure.args-delete --disable-mysql configure.args-append --enable-mysql \ --with-mysql-incdir="${prefix}/include/mysql56/mysql" \ --with-mysql-libdir="${prefix}/lib/mysql56/mysql" depends_lib-append port:mysql56 } variant mariadb conflicts mysql mysql51 mysql55 mysql56 percona description {Build with mariadb support} { configure.args-delete --disable-mysql configure.args-append --enable-mysql \ --with-mysql-incdir="${prefix}/include/mariadb/mysql" \ --with-mysql-libdir="${prefix}/lib/mariadb/mysql" depends_lib-append port:mariadb } variant percona conflicts mysql mysql51 mysql55 mysql56 mariadb description {Build with percona support} { configure.args-delete --disable-mysql configure.args-append --enable-mysql \ --with-mysql-incdir="${prefix}/include/percona/mysql" \ --with-mysql-libdir="${prefix}/lib/percona/mysql" depends_lib-append port:percona } variant postgresql90 conflicts postgresql92 description {Build with PostgreSQL 9.0 support} { configure.args-delete --disable-pgsql configure.args-append --enable-pgsql \ --with-pgsql-incdir="${prefix}/include/postgresql90" \ --with-pgsql-libdir="${prefix}/lib/postgresql90" depends_lib-append port:libpqxx port:postgresql90 } variant postgresql92 conflicts postgresql90 description {Build with PostgreSQL 9.2 support} { configure.args-delete --disable-pgsql configure.args-append --enable-pgsql \ --with-pgsql-incdir="${prefix}/include/postgresql92" \ --with-pgsql-libdir="${prefix}/lib/postgresql92" depends_lib-append port:libpqxx port:postgresql92 } # variant oracle description {Build with Oracle support} { # configure.args-replace --disable-oracle --enable-oracle # configure.args-append --with-oracle-incdir="${prefix}/lib/oracle/sdk/include" \ # --with-oracle-libdir="${prefix}/lib/oracle" # depends_lib-append port:oracle-instantclient # } variant pythia description {Pythia 8 support for root} { configure.args-delete --disable-pythia8 configure.args-append --enable-pythia8 \ --with-pythia8-incdir=${prefix}/include/pythia \ --with-pythia8-libdir=${prefix}/lib depends_lib-append port:pythia } variant cocoa conflicts x11 description {Enables native OSX graphical backend} { # Force a compatible clang compiler PortGroup compiler_blacklist_versions 1.0 compiler.blacklist-append {clang < 425} *gcc* # Enable cocoa support in configure configure.args-delete --disable-cocoa configure.args-append --enable-cocoa # patch afterimage build to make sure TIFF suport is disabled. Causes problems with cocoa... patchfiles-append patch-builtin-afterimage-disabletiff.diff } variant x11 conflicts cocoa description {Enables X11 graphical backend} { # Dependencies on X11 ports depends_lib-append port:xorg-libX11 port:mesa port:libGLU port:Xft2 port:xpm # Disable cocoa configure.args-append --disable-cocoa } # If neither graphical variant is set, use default if { ![variant_isset cocoa] && ![variant_isset x11] } { default_variants-append ${default_gui_variant} } # ======================================================================================== # Setup various clang variants, to provide alternative C++ compilers that support cocoa # ======================================================================================== # List of possible clang versions that work set clang_versions { 3.4 3.5 3.6 3.7 3.8 } # Define the available variants foreach ver ${clang_versions} { set ver_no_dot [join [split ${ver} "."] ""] set variant_line {variant clang${ver_no_dot} description "Compile using MacPorts clang ${ver}"} foreach over ${clang_versions} { if { ${ver} == ${over} } { continue } set over_no_dot [join [split ${over} "."] ""] append variant_line " conflicts clang${over_no_dot}" } append variant_line { { } } eval $variant_line } # make sure that the proper variant is automatically selected # (ROOT crashes if the compiler it was built with doesn't exist) if {![variant_isset clang33] && ![variant_isset clang34] && ![variant_isset clang35]} { if { ${configure.compiler} eq "macports-clang-3.3" } { default_variants-append +clang33 } elseif { ${configure.compiler} eq "macports-clang-3.4" } { default_variants-append +clang34 } elseif { ${configure.compiler} eq "macports-clang-3.5" } { default_variants-append +clang35 } } # Is a variant active ? set active_clang_variant "" foreach ver ${clang_versions} { set ver_no_dot [join [split ${ver} "."] ""] if {[variant_isset clang${ver_no_dot}]} { set active_clang_variant ${ver} } } # If so, set it up. if { ${active_clang_variant} != "" } { configure.compiler macports-clang-${active_clang_variant} configure.args-append --with-llvm-config="${prefix}/bin/llvm-config-mp-"${active_clang_variant} depends_run-append port:clang-${active_clang_variant} } # ======================================================================================== variant qt_mac description {Build with Qt support via Mac UI} { post-patch { # fix where "qglobal.h" is found in all files that use or reference it foreach tpf { configure graf2d/qt/src/TGQt.cxx } { reinplace "s@Qt/qglobal\\.h@QtCore/qglobal\\.h@g" \ ${worksrcpath}/${tpf} } reinplace "/qttestdir/s@Qt@QtCore@g" ${worksrcpath}/configure # fix library search extensions to include ".la" # for Qt framework libraries (only) reinplace "s@\\(\\.so \\.sl \\.dylib \\.dll\\.a\\)@\\1 \\.la@g" \ ${worksrcpath}/configure } configure.args-delete --disable-qt configure.args-delete --disable-qtgsi configure.args-append --enable-qt --enable-qtgsi \ --with-qt-incdir="${prefix}/include" \ --with-qt-libdir="${prefix}/lib" depends_lib-append port:qt4-mac post-configure { # patch up the Makefile.config to handle the QTLIB frameworks correctly reinplace "/QTLIB\[ \]/s@:= @:= -F${qt_libs_dir} @" \ ${worksrcpath}/config/Makefile.config reinplace "/QTLIB\[ \]/s@\\(Qt\[^ \]*\\).la@-framework \\1@g" \ ${worksrcpath}/config/Makefile.config } } if {[variant_isset qt_mac]} { PortGroup qt4 1.0 } # ======================================================================================== # Following is for fortran support # Might eventually move to a portgroup, or similar, so could be simplified. # Based on recipe from https://trac.macports.org/wiki/PortfileRecipes#fortran # Note that g95 does not work here, so that variant is removed # ======================================================================================== set gcc_versions { 4.7 4.8 4.9 5 6 } set default_fortran_variant +gcc6 foreach ver ${gcc_versions} { set ver_no_dot [join [split ${ver} "."] ""] set variant_line {variant gcc${ver_no_dot} description "Build with gfortran from gcc${ver_no_dot}"} foreach over ${gcc_versions} { if {${ver} == ${over}} { continue } set over_no_dot [join [split ${over} "."] ""] append variant_line " conflicts gcc${over_no_dot}" } append variant_line { { } } eval $variant_line if {[variant_isset gcc${ver_no_dot}]} { if {${default_fortran_variant} != "+gcc${ver_no_dot}"} { set default_fortran_variant "" } } } if {${default_fortran_variant} != ""} { default_variants-append "${default_fortran_variant}" } foreach ver ${gcc_versions} { set ver_no_dot [join [split ${ver} "."] ""] if {[variant_isset gcc${ver_no_dot}]} { depends_lib-append path:lib/libgcc/libgcc_s.1.dylib:libgcc depends_build-append port:gcc${ver_no_dot} configure.fc ${prefix}/bin/gfortran-mp-${ver} configure.f77 ${prefix}/bin/gfortran-mp-${ver} configure.f90 ${prefix}/bin/gfortran-mp-${ver} } } # ======================================================================================== # default regex of github suggests version 6 livecheck.regex archive/v(5\[-0-9\]+)${extract.suffix} # ======================================================================================== # The following have build issues, are obsolete or experimental. # ======================================================================================== # Problems finding includes ... # variant ruby description {Build with ruby support} { # configure.args-delete --disable-ruby # configure.args-append --enable-ruby \ # --with-ruby-incdir="${prefix}/include/ruby-1.9.1" \ # --with-ruby-libdir="${prefix}/lib" # depends_lib-append port:ruby19 # } # Intefers with builtin freetype build (enforced by cocoa variant) # Also do not seem to be actually needed any more #pre-build { # build.args CC=${configure.cc} \ # CXX=${configure.cxx} \ # F77=${configure.f77} #} # variant kerberos5 description {Build with kerberos5 support} { # configure.args-delete --disable-krb5 # configure.args-append --enable-krb5 \ # --with-krb5-incdir="${prefix}/include" \ # --with-krb5-libdir="${prefix}/lib" # depends_lib-append port:kerberos5 # } # variant ftgl description {Build with ftgl support} { # configure.args-delete --enable-builtin-ftgl # configure.args-append --disable-builtin-ftgl \ # configure.args-append --with-ftgl-incdir="${prefix}/include" \ # --with-ftgl-libdir="${prefix}/lib" # depends_lib-append port:ftgl # } # variant qt_x11 conflicts qt_mac description {Build with Qt support via X11 UI} { # # fix where "qglobal.h" is found in all files that use or reference it # post-patch { # foreach tpf { configure graf2d/qt/src/TGQt.cxx } { # reinplace "s@Qt/qglobal\\.h@QtCore/qglobal\\.h@g" \ # ${worksrcpath}/${tpf} # } # reinplace "/qttestdir/s@Qt@QtCore@g" ${worksrcpath}/configure # } # configure.env-append QTDIR=${prefix}/libexec/qt4-x11 # configure.args-delete --disable-qt # configure.args-delete --disable-qtgsi # configure.args-append --enable-qt --enable-qtgsi \ # --with-qt-incdir="${prefix}/include" \ # --with-qt-libdir="${prefix}/lib" # depends_lib-append port:qt4-x11 # }