# -*- 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 PortSystem 1.0 PortGroup active_variants 1.1 PortGroup cmake 1.1 PortGroup compilers 1.0 PortGroup compiler_blacklist_versions 1.0 PortGroup github 1.0 PortGroup select 1.0 PortGroup legacysupport 1.1 PortGroup openssl 1.0 # Please also check if Gate needs a revbump after root6 update github.setup root-project root 6-32-08 v version [string map {- .} ${github.version}] revision 0 livecheck.version ${github.version} # Use git commit #github.setup root-project root 6e90aef0c646668a513fd2e291500c0c31fa1af2 #github.setup cjones051073 root 6e90aef0c646668a513fd2e291500c0c31fa1af2 #version 6.14.00 #livecheck.version 6-14-00 #revision 0 checksums rmd160 35d09ae1653c0fb44a7b749f9733160323a12188 \ sha256 43ad286abd9c01c067f6470d900060bb43ce11681ac0a45e90fcd741c431e893 \ size 192929296 # extract major version set version_major [lindex [split ${version} .] 0] livecheck.type regex livecheck.url ${github.homepage}/tags # even numbered minor releases are production releases, odd are developmental so skip. # Also, skip anything with trailing rcX etc. livecheck.regex {v(6[-.]\d[02468][-.]\d{2}).tar.gz} name root${version_major} categories science maintainers {jonesc @cjones051073} {mojca @mojca} 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 https://root.cern.ch/ platforms {darwin >= 17} dist_subdir root/${version} # Use compilers PG to pick a fortran compiler compilers.choose f90 fc f77 compilers.setup require_fortran -g95 -gcc44 -gcc45 -gcc46 -gcc47 -gcc48 -gcc49 -gcc5 -gcc6 -gcc7 -gcc8 compiler.blacklist-append *gcc* {clang < 920} {macports-clang-3.[0-9]} {macports-clang-[4-6].0} # c++17 filesystem required, only available in Xcode clang from macOS 10.15 compiler.blacklist-append {clang < 1200} # enabling root7 requires better support (macOS 12 or newer) compiler.blacklist-append {clang < 1400} # If using MacPorts clang, make sure it's added as a runtime dep as well as cling will need it. if {[regexp {macports-clang-(.*)} ${configure.compiler} -> clang_v]} { depends_run-append port:clang-${clang_v} } # https://trac.macports.org/ticket/69945 use_parallel_build no depends_build-append port:pkgconfig depends_lib-append port:expat \ port:gmp \ port:giflib \ path:include/turbojpeg.h:libjpeg-turbo \ port:libpng \ port:lzma \ port:pcre \ port:tiff \ port:xz \ port:gl2ps \ port:lz4 \ port:vdt \ port:tbb \ port:xxhashlib \ port:z3 \ port:zstd \ port:nlohmann-json \ port:zlib \ port:bzip2 \ port:brotli \ port:librsvg \ path:lib/libopenblas.dylib:OpenBLAS depends_run-append port:root_select cmake.out_of_source yes #cmake.generator Ninja # TODO: the file ${filespath}/${name} would have to be generated on the fly instead select.group root select.file ${filespath}/${name} # port specific location set install_prefix ${prefix}/libexec/root${version_major} patch.pre_args-replace -p0 -p1 configure.args-append \ -Dgnuinstall=ON \ -Drpath=ON \ -DCMAKE_INSTALL_PREFIX="${install_prefix}" \ -DCMAKE_INSTALL_SYSCONFDIR="${install_prefix}/etc/root" \ -DCMAKE_INSTALL_NAME_DIR="${install_prefix}/lib/root" \ -Dfortran=ON \ -Dbuiltin_davix=OFF \ -Dbuiltin_freetype=ON \ -Dbuiltin_glew=OFF \ -Dbuiltin_pcre=OFF \ -Dbuiltin_zlib=OFF \ -Dbuiltin_lzma=OFF \ -Dbuiltin_tbb=OFF \ -Dbuiltin_afterimage=ON \ -Ddavix=OFF \ -Dfftw3=OFF \ -Dkrb5=OFF \ -Dmysql=OFF \ -Dsqlite=OFF \ -Dodbc=OFF \ -Dopengl=OFF \ -Dpythia6=OFF \ -Dpythia8=OFF \ -Droofit=OFF \ -Dssl=ON \ -Dxml=OFF \ -Dpyroot=OFF \ -Dfitsio=OFF \ -Dpgsql=OFF \ -Ddcache=OFF \ -Dchirp=OFF \ -Dhdfs=OFF \ -Druby=OFF \ -Dtmva=OFF \ -Dqt=OFF \ -Dqtgsi=OFF \ -Dgviz=OFF \ -Dsoversion=ON \ -Dcxx14=OFF \ -Dlibcxx=ON \ -Dxrootd=OFF \ -Dbuiltin_ftgl=ON \ -Dbuiltin_gsl=ON \ -Dmathmore=ON \ -Dgenvector=ON \ -Dunuran=ON \ -Dgdml=ON \ -Dhttp=ON \ -Dvc=OFF \ -Dastiff=ON \ -Dgeocad=OFF \ -Dr=OFF \ -Droot7=ON \ -Dwebgui=ON \ -Dbuiltin_veccore=OFF \ -DPNG_LIBRARY=${prefix}/lib/libpng.dylib \ -DPNG_PNG_INCLUDE_DIR=${prefix}/include configure.env-append \ TBB_ROOT=${prefix}/libexec/tbb # https://root-forum.cern.ch/t/v6-22-00-build-error-on-macos/40239 configure.args-append -Druntime_cxxmodules=OFF # Enable C++17 compiler.cxx_standard 2017 cmake.set_cxx_standard yes # Configure the C++ runtime to use if { ${configure.cxx_stdlib} ne "libc++" } { configure.args-replace -Dlibcxx=ON -Dlibcxx=OFF } # Configure the graphics backend. cocoa on macOS 10.12 and newer. X11 otherwise if {${os.platform} eq "darwin" && ${os.major} >= 16} { if {![variant_isset x11]} { default_variants-append +cocoa } } else { if {![variant_isset cocoa]} { default_variants-append +x11 } } # Enable xrootd support by default if {${os.platform} eq "darwin" && ${os.major} >= 12} { default_variants-append +xrootd } if {${os.platform} eq "darwin" && ${os.major} >= 20} { # Starting with macOS 11 the SDK version changes on incremental OS updates, # e.g. going from 11.0 to 11.1. This causes problems with root as it bakes # the SDK version (sysroot) into a number of places in the installed files # and thus users will run into problems if they try and use a binary built on # one incremental OS version, on a different one with a different SDK available. # This is probably not the only port that will have this problem, and we might # need to come up with a better policy in MacPorts to handle this, but until then # unset the sdk version to use, which causes a fallback to the unversioned SDK path. configure.sdk_version } if {${os.platform} eq "darwin" && ${os.major} >= 22} { if { [vercmp ${xcodeversion} >= 15.0] || [vercmp ${xcodecltversion} >= 15.0] } { # On macOS13 and newer ensure the 'legacy' linker is used as GCC currently has problems # with the new default linker in Xcode 15. See e.g. # https://developer.apple.com/documentation/xcode-release-notes/xcode-15-release-notes#Linking # https://discussions.apple.com/thread/255137447 # https://developer.apple.com/forums/thread/737707 # https://github.com/Homebrew/homebrew-core/issues/145991 configure.ldflags-append -Wl,-ld_classic } } pre-configure { # Force use of system python in build scripts # Find command finds text files containing the string to be replaced. # shtest-encoding.py intentionally includes an unreadable character, so have to skip it ... set pystringtoreplace "/usr/bin/env python" foreach f [ exec find ${worksrcpath} -type f -and -not -name "shtest-encoding.py" -and -name "*.py" ] { reinplace -q "s|${pystringtoreplace}|/usr/bin/python|g" $f } } post-build { ui_debug "Searching ${workpath}/build for third party build logs ..." foreach log [ exec find ${workpath}/build -type f -and -name "*.log" ] { ui_debug "Contents of ${log} :-" set f [open ${log}] set lines [split [read $f] "\n"] foreach line $lines { ui_debug "${line}" } close $f } } post-destroot { # Set execute flag on binaries (broken in 6.06.00) foreach f [glob -directory ${destroot}${install_prefix}/bin *] { system "chmod +x $f" } # 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} # 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} } # Define font path in system config file set rootsystemrcfile ${destroot}${prefix}/libexec/root${version_major}/etc/root/system.rootrc # uncoment some settings reinplace "s|#\*\.\*\.Root\.TTFontPath|\*\.\*\.Root\.TTFontPath|g" ${rootsystemrcfile} reinplace "s|#Unix\.\*\.Gui.IconPath|Unix\.\*\.Gui\.IconPath|g" ${rootsystemrcfile} # fix libGLEW.dylib install location move ${destroot}${install_prefix}/lib/libGLEW.dylib ${destroot}${install_prefix}/lib/root/ } 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-append +xml +tmva +roofit +graphviz +opengl +davix variant native description {Build with best native support for local CPU capabilities} { configure.cflags-append -O3 -mtune=native configure.cppflags-append -O3 -mtune=native configure.fflags-append -O3 -mtune=native } variant qt4 description {Enable QT4 support} { configure.args-replace -Dqt=OFF -Dqt=ON PortGroup qt4 1.0 } variant veccore description {Enable VecCore support} { configure.args-replace -Dbuiltin_veccore=OFF -Dbuiltin_veccore=ON } variant valgrind description {Build internal LLVM library with valgrind support} { depends_lib-append port:valgrind } variant vc description {Build with Vc library support} { depends_lib-append port:Vc configure.args-replace -Dvc=OFF -Dvc=ON } variant debug description {Enable a debug build} { configure.args-append -DCMAKE_BUILD_TYPE=Debug } variant xrootd description {Build with XRootD support} { configure.args-replace -Dxrootd=OFF -Dxrootd=ON # configure.args-append -Dbuiltin_xrootd=ON configure.args-append -DXROOTD_INCLUDE_DIR="${prefix}/include/xrootd" depends_lib-append port:xrootd } variant graphviz description {Build with graphviz support} { configure.args-replace -Dgviz=OFF -Dgviz=ON configure.args-append -DGRAPHVIZ_INCLUDE_DIR="${prefix}/include" # -DGRAPHVIZ_CDT_LIBRARY="${prefix}/lib/libcdt.dylib" \ # -DGRAPHVIZ_GRAPH_LIBRARY="${prefix}/lib/libcgraph.dylib" \ # -DGRAPHVIZ_GVC_LIBRARY="${prefix}/lib/libgvc.dylib" \ # -DGRAPHVIZ_PATHPLAN_LIBRARY="${prefix}/lib/libpathplan.dylib" depends_lib-append path:bin/dot:graphviz } variant fftw3 description {Build with fftw3 support} { configure.args-replace -Dfftw3=OFF -Dfftw3=ON configure.args-append -DFFTW_INCLUDE_DIR="${prefix}/include" \ -DFFTW_LIBRARY="${prefix}/lib/libfftw3.dylib" depends_lib-append port:fftw-3 } variant fitsio description {Build with fitsio support} { configure.args-replace -Dfitsio=OFF -Dfitsio=ON depends_lib-append port:cfitsio } variant odbc description {Build with odbc support} { configure.args-replace -Dodbc=OFF -Dodbc=ON configure.args-append -DODBC_INCLUDE_DIR="${prefix}/include" \ -DODBC_LIBRARY="${prefix}/lib/libiodbc.dylib" depends_lib-append port:libiodbc } variant roofit description {Build the RooFit advanced fitting package} { configure.args-replace -Droofit=OFF -Droofit=ON } variant tmva description {Build the TMVA package} { configure.args-replace -Dtmva=OFF -Dtmva=ON } variant opengl description {Build with opengl support} { configure.args-replace -Dopengl=OFF -Dopengl=ON configure.args-replace -Dbuiltin_glew=OFF -Dbuiltin_glew=ON } # ======================================================================================== # Setup various python variants # ======================================================================================== # List of possible python versions set python_versions { 3.9 3.10 3.11 3.12 } # Enable python variant by default on OS X 10.9 and newer. # Disabled on older systems due to an issue fetching the source for # the various python dependencies due to these systems having out of # date SSL versions that are rejected by the upstream server. if {${os.platform} ne "darwin" || ${os.major} >= 13} { set default_python_variant +python312 } else { set default_python_variant "" } # Define the available variants foreach py_ver ${python_versions} { set py_ver_no_dot [join [split ${py_ver} "."] ""] set variant_line {variant python${py_ver_no_dot} description "Build with python ${py_ver} support"} foreach py_over ${python_versions} { if { ${py_ver} == ${py_over} } { continue } set py_over_no_dot [join [split ${py_over} "."] ""] append variant_line " conflicts python${py_over_no_dot}" } append variant_line { { } } eval $variant_line if {[variant_isset python${py_ver_no_dot}]} { if {${default_python_variant} != "+python${py_ver_no_dot}"} { set default_python_variant "" } } } if {${default_python_variant} != ""} { default_variants-append "${default_python_variant}" } variant jupyter description {Enable Jupyter support} { } # If a python variant is enabled, activate it set active_python_version "" foreach py_ver ${python_versions} { set py_ver_no_dot [join [split ${py_ver} "."] ""] if {[variant_isset python${py_ver_no_dot}]} { set active_python_version ${py_ver} set active_python_version_no_dot ${py_ver_no_dot} # Check root5 variants pre-activate { set portname root5 if {![catch {set result [active_variants ${portname} python${active_python_version_no_dot}]}]} { if {$result} { ui_error "Cannot install ${name} with +python${active_python_version_no_dot} variant" 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." } } } # Setup python set mypydir ${frameworks_dir}/Python.framework/Versions/${py_ver} configure.args-replace -Dpyroot=OFF -Dpyroot=ON configure.args-append -DPYTHON_INCLUDE_DIR="${mypydir}/Headers" \ -DPYTHON_EXECUTABLE="${mypydir}/bin/python${py_ver}" # Explicitly set python library if { [ file exists "${mypydir}/lib/libpython${py_ver}.dylib" ] } { configure.args-append -DPYTHON_LIBRARY="${mypydir}/lib/libpython${py_ver}.dylib" } elseif { [ file exists "${prefix}/lib/libpython${py_ver}.dylib" ] } { configure.args-append -DPYTHON_LIBRARY="${prefix}/lib/libpython${py_ver}.dylib" } depends_lib-append port:python${py_ver_no_dot} \ port:py${py_ver_no_dot}-numpy \ port:py${py_ver_no_dot}-gnureadline if {[variant_isset jupyter ]} { depends_lib-append port:py${py_ver_no_dot}-jupyter \ port:py${py_ver_no_dot}-metakernel } post-destroot { # Install PyROOT in the correct place set mypyincdir ${frameworks_dir}/Python.framework/Versions/${active_python_version}/include set mypylibdir ${frameworks_dir}/Python.framework/Versions/${active_python_version}/lib/python${active_python_version} set mypysitedir ${mypylibdir}/site-packages/ file mkdir ${destroot}${mypysitedir} # Move X.py files to site-packages foreach pyfile [glob ${destroot}${install_prefix}/lib/root/*.py*] { move $pyfile ${destroot}${mypysitedir}/ } # Fix PyROOT.... set py_ver_dash [join [split ${py_ver} "."] "_"] foreach f [ exec find ${destroot}${install_prefix}/lib/root/ -name "libcppyy*${py_ver_dash}*" ] { set fname [file tail ${f}] set fname_nover [string map "${py_ver_dash}. ." ${fname}] ln -s ${fname} ${destroot}${install_prefix}/lib/root/${fname_nover} } # See also https://trac.macports.org/ticket/58942 foreach fname { cppyy cppyy_backend JsMVA JupyROOT ROOT } { ln -s ${install_prefix}/lib/root/${fname} ${destroot}${mypysitedir}/ } foreach fname [ glob -tails -directory ${destroot}${install_prefix}/lib/root/ lib* ] { ln -s ${install_prefix}/lib/root/${fname} ${destroot}${mypysitedir}/ } # Fix cppyy loader imports... set cppyy_lib_dir ${install_prefix}/lib/root/cppyy_backend/lib file mkdir ${destroot}${cppyy_lib_dir} foreach fname [ glob -tails -directory ${destroot}${install_prefix}/lib/root/ libcppyy* ] { ln -s ${install_prefix}/lib/root/${fname} ${destroot}${cppyy_lib_dir}/ } file mkdir ${destroot}${mypyincdir} ln -s ${install_prefix}/include/root/CPyCppyy ${destroot}${mypyincdir}/ # Fix python version in scripts set pystringtoreplace "/usr/bin/python" foreach f [ exec find ${destroot}${install_prefix} -type f -and -name "*.py" ] { reinplace -q "s|${pystringtoreplace}|${prefix}/bin/python${active_python_version}|g" $f } # Add rpath to all libraries # https://root-forum.cern.ch/t/import-error/49492 foreach f [ exec find ${destroot}${install_prefix}/ -name "*.so" -or -name "*.dylib"] { system "install_name_tool -add_rpath ${install_prefix}/lib/root ${f} > /dev/null 2>&1 ; true" } } if {[variant_isset jupyter ]} { # patch the command ROOT assumes to run for jupyter pre-configure { foreach f [ exec find ${worksrcpath}/ -type f -and -name "nbmain.cxx" ] { reinplace "s|\"jupyter\"|\"jupyter-${active_python_version}\"|g" $f } } } } } # ======================================================================================== variant davix description {Enable Davix support} { configure.args-replace -Ddavix=OFF -Ddavix=ON depends_lib-append port:davix } variant xml description {Build with xml support} { configure.args-replace -Dxml=OFF -Dxml=ON configure.args-append -DLIBXML2_INCLUDE_DIR="${prefix}/include/libxml2" \ -DLIBXML2_LIBRARIES="${prefix}/lib/libxml2.dylib" \ -DLIBXML2_LIBRARY="${prefix}/lib/libxml2.dylib" \ -DLIBXML2_XMLLINT_EXECUTABLE="${prefix}/bin/xmllint" depends_lib-append port:libxml2 } variant sqlite3 description {Build with sqlite3 support} { configure.args-replace -Dsqlite=OFF -Dsqlite=ON depends_lib-append port:sqlite3 } variant mysql conflicts mariadb percona description {Build with mysql support} { set ver 57 configure.args-replace -Dmysql=OFF -Dmysql=ON configure.args-append -DMYSQL_CONFIG_EXECUTABLE=${prefix}"/lib/mysql${ver}/bin/mysql_config" depends_lib-append port:mysql${ver} } variant mariadb conflicts mysql percona description {Build with mariadb support} { set ver 10.2 configure.args-replace -Dmysql=OFF -Dmysql=ON configure.args-append -DMYSQL_CONFIG_EXECUTABLE=${prefix}"/lib/mariadb-${ver}/bin/mysql_config" depends_lib-append port:mariadb-${ver} } variant percona conflicts mysql mariadb description {Build with percona support} { configure.args-replace -Dmysql=OFF -Dmysql=ON configure.args-append -DMYSQL_CONFIG_EXECUTABLE=${prefix}"/lib/percona/bin/mysql_config" depends_lib-append port:percona } variant postgresql conflicts description {Build with PostgreSQL support} { set ver 96 configure.args-replace -Dpgsql=OFF -Dpgsql=ON configure.args-append -DPOSTGRESQL_INCLUDE_DIR="${prefix}/include/postgresql${ver}" \ -DPOSTGRESQL_LIBRARY="${prefix}/lib/postgresql${ver}/libpq.dylib" depends_lib-append port:libpqxx port:postgresql${ver} } # variant oracle description {Build with Oracle support} { # configure.args-replace --disable-oracle --enable-oracle # configure.args-append -DORACLE_PATH_INCLUDES="${prefix}/lib/oracle/sdk/include" \ # -DORACLE_PATH_LIB="${prefix}/lib/oracle" \ # -DORACLE_OCI_VERSION=8 # depends_lib-append port:oracle-instantclient # } variant pythia description {Enables Pythia 8 support} { configure.args-replace -Dpythia8=OFF -Dpythia8=ON configure.args-append -DPYTHIA8_INCLUDE_DIR=${prefix}/include/pythia \ -DPYTHIA8_LIBRARY=${prefix}/lib/libpythia8.dylib depends_lib-append port:pythia } variant cocoa conflicts x11 description {Enables native OSX graphical backend} { # Enable cocoa support in configure configure.args-append -Dcocoa=ON -Dx11=OFF } 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 -Dcocoa=OFF -Dx11=ON \ -DOPENGL_INCLUDE_DIR=${prefix}/include \ -DOPENGL_gl_LIBRARY=${prefix}/lib/libGL.dylib \ -DX11_ICE_INCLUDE_PATH=${prefix}/include \ -DX11_SM_INCLUDE_PATH=${prefix}/include \ -DX11_X11_INCLUDE_PATH=${prefix}/include \ -DX11_Xext_INCLUDE_PATH=${prefix}/include \ -DX11_Xft_INCLUDE_PATH=${prefix}/include \ -DX11_Xpm_INCLUDE_PATH=${prefix}/include \ -DX11_ICE_LIB=${prefix}/lib/libICE.dylib \ -DX11_SM_LIB=${prefix}/lib/libSM.dylib \ -DX11_X11_LIB=${prefix}/lib/libX11.dylib \ -DX11_Xext_LIB=${prefix}/lib/libXext.dylib \ -DX11_Xft_LIB=${prefix}/lib/libXft.dylib \ -DX11_Xpm_LIB=${prefix}/lib/libXpm.dylib \ -DOPENGL_glu_LIBRARY=${prefix}/lib/libGLU.dylib }