Ticket #40432: root.diff

File root.diff, 6.6 KB (added by cjones051073 (Chris Jones), 11 years ago)
  • science/root/Portfile

    old new  
    44PortSystem          1.0
    55
    66name                root
    7 version             5.34.09
    8 revision            1
     7version             5.34.10
     8
    99categories          science
    1010maintainers         gmail.com:mattiafrancescomoro hep.phy.cam.ac.uk:jonesc
    1111license             LGPL-2.1+
     
    1919master_sites        http://root.cern.ch/download/ \
    2020                    ftp://root.cern.ch/root/
    2121
    22 checksums           rmd160  73a25b1abc5265f658c4da2c9efd7b1df7a5932a \
    23                     sha256  a99cd7f34bf25a52e63228f3f7c245afa9e55420bfb4ce7e78d20c6475a4ea86
     22checksums           rmd160  cde68d9e96d62d3adc3b6044e167ec5578f22edd \
     23                    sha256  a70c46f382e6557765c4741a367bded9b4041f669e9c313c4201ef66f1ae5d9d
    2424
    2525worksrcdir          root
    2626
     
    5050    configure.args-append \
    5151        --with-cc=${configure.cc} \
    5252        --with-cxx=${configure.cxx} \
    53         --with-ld=${configure.cxx}
    54     if { ${configure.f77} != "" } {
    55         configure.args-append --with-f77=${configure.f77}
    56     } else {
    57         # Set something configure will fail to find
    58         configure.args-append --with-f77="NONE"
    59     }
     53        --with-ld=${configure.cxx} \
     54        --with-f77=${configure.f77}
    6055    # the build type (32 or 64 bit) -must- be for first argument
    6156    if {${build_arch} == "i386" || ${build_arch} == "ppc"} {
    6257        configure.pre_args macosx --prefix=${prefix}
     
    359354}
    360355
    361356variant cocoa description {Enables native OSX graphical backend instead of X11} {
    362     # Check we are using a clang compiler
    363     pre-fetch {
    364         if { ![string match "*clang*" ${configure.compiler}] || [string match "macports-clang-3.3" ${configure.compiler}] } {
    365             ui_error "The cocoa variant is experimental and can currently only be built"
    366             ui_error "using a clang(<3.3) compiler. Your current compiler is ${configure.compiler}."
    367             ui_error "Please try again using either of the clang31 or clang32 variants,"
    368             ui_error "or the system clang compiler using configure.compiler=clang"
    369             return -code error "Unsupported compiler for cocoa support"
    370         }
    371     }
     357    # Force a compatible clang compiler
     358    PortGroup compiler_blacklist_versions 1.0
     359    compiler.blacklist-append {clang < 425} *gcc* macports-clang-3.3 macports-clang-2.9 macports-clang-3.0
     360    compiler.fallback-append macports-clang-3.2 macports-clang-3.1
    372361    # Enable cocoa support in configure
    373362    configure.args-delete --disable-cocoa
    374363    configure.args-append --enable-cocoa
     
    376365    patchfiles-append patch-builtin-afterimage-disabletiff.diff
    377366}
    378367
    379 variant gcc45 conflicts gcc46 gcc47 gcc48 clang31 clang32 clang33 description {Compile using MacPorts gcc 4.5} {
    380     configure.compiler      macports-gcc-4.5
    381 }
    382 
    383 variant gcc46 conflicts gcc45 gcc47 gcc48 clang31 clang32 clang33 description {Compile using MacPorts gcc 4.6} {
    384     configure.compiler      macports-gcc-4.6
    385 }
    386 
    387 variant gcc47 conflicts gcc45 gcc46 gcc48 clang31 clang32 clang33 description {Compile using MacPorts gcc 4.7} {
    388     configure.compiler      macports-gcc-4.7
    389 }
    390 
    391 variant gcc48 conflicts gcc45 gcc46 gcc47 clang31 clang32 clang33 description {Compile using MacPorts gcc 4.8} {
    392     configure.compiler      macports-gcc-4.8
    393 }
    394 
    395 variant clang31 conflicts gcc45 gcc46 gcc47 gcc48 clang32 clang33 description {Compile using MacPorts clang 3.1} {
     368variant clang31 conflicts clang32 clang33 description {Compile using MacPorts clang 3.1} {
    396369    configure.compiler      macports-clang-3.1
     370}
     371if {[string match macports-clang-3.1 ${configure.compiler}]} {
    397372    configure.args-append   --with-llvm-config="${prefix}/bin/llvm-config-mp-3.1"
    398373}
    399374
    400 variant clang32 conflicts gcc45 gcc46 gcc47 gcc48 clang31 clang33 description {Compile using MacPorts clang 3.2} {
     375variant clang32 conflicts clang31 clang33 description {Compile using MacPorts clang 3.2} {
    401376    configure.compiler      macports-clang-3.2
     377}
     378if {[string match macports-clang-3.2 ${configure.compiler}]} {
    402379    configure.args-append   --with-llvm-config="${prefix}/bin/llvm-config-mp-3.2"
    403380}
    404381
    405 variant clang33 conflicts gcc45 gcc46 gcc47 gcc48 clang31 clang32 description {Compile using MacPorts clang 3.3} {
     382variant clang33 conflicts clang31 clang32 description {Compile using MacPorts clang 3.3} {
    406383    configure.compiler      macports-clang-3.3
     384}
     385if {[string match macports-clang-3.3 ${configure.compiler}]} {
    407386    configure.args-append   --with-llvm-config="${prefix}/bin/llvm-config-mp-3.3"
    408387}
    409388
     
    442421    }
    443422}
    444423
     424# ========================================================================================
     425# Following is for fortran support
     426# Might eventually move to a portgroup, or similar, so could be simplified.
     427# Based on recipe from https://trac.macports.org/wiki/PortfileRecipes#fortran
     428# Note that g95 does not work here, so that variant is removed
     429# ========================================================================================
     430
     431set gcc_versions {4.3 4.4 4.5 4.6 4.7 4.8 4.9}
     432set default_fortran_variant +gcc48
     433
     434foreach ver ${gcc_versions} {
     435    set ver_no_dot [join [split ${ver} "."] ""]
     436
     437    set variant_line {variant gcc${ver_no_dot} description "Build with gfortran from gcc${ver_no_dot}"}
     438
     439    foreach over ${gcc_versions} {
     440        if {${ver} == ${over}} {
     441            continue
     442        }
     443
     444        set over_no_dot [join [split ${over} "."] ""]
     445        append variant_line " conflicts gcc${over_no_dot}"
     446    }
     447    append variant_line { {}}
     448
     449    eval $variant_line
     450
     451    if {[variant_isset gcc${ver_no_dot}]} {
     452        if {${default_fortran_variant} != "+gcc${ver_no_dot}"} {
     453            set default_fortran_variant ""
     454        }
     455    }
     456}
     457
     458if {${default_fortran_variant} != ""} {
     459    default_variants-append "${default_fortran_variant}"
     460}
     461
     462foreach ver ${gcc_versions} {
     463    set ver_no_dot [join [split ${ver} "."] ""]
     464
     465    if {[variant_isset gcc${ver_no_dot}]} {
     466        depends_lib-append path:lib/libgcc/libgcc_s.1.dylib:libgcc
     467        depends_build-append port:gcc${ver_no_dot}
     468
     469        configure.fc  ${prefix}/bin/gfortran-mp-${ver}
     470        configure.f77 ${prefix}/bin/gfortran-mp-${ver}
     471        configure.f90 ${prefix}/bin/gfortran-mp-${ver}
     472    }
     473}
     474
     475# ========================================================================================
     476
    445477livecheck.type              regex
    446478livecheck.url               [lindex ${master_sites} 0]
    447479livecheck.regex             ${name}_v(\[0-9a-z.\]+)\\.source