Ticket #44230: root6-6.00.02-revision2.diff

File root6-6.00.02-revision2.diff, 7.8 KB (added by cjones051073 (Chris Jones), 10 years ago)
  • Portfile

     
    1313# don't forget to update both the git tag and the version
    1414github.setup        root-mirror root 6-00-02 v
    1515version             6.00.02
     16revision            1
    1617# this could be a better way to set the version (unless we use a sha sum for the git tag ;)
    1718# version           [string map {- .} $version]
    1819set version_major   [lindex [split ${version} .] 0]
     
    316317set default_python_variant +python27
    317318
    318319# Define the available variants
    319 foreach ver ${python_versions} {
    320     set ver_no_dot [join [split ${ver} "."] ""]
    321     set variant_line {variant python${ver_no_dot} description "Build with python ${ver} support"}
    322     foreach over ${python_versions} {
    323         if { ${ver} == ${over} } { continue }
    324         set over_no_dot [join [split ${over} "."] ""]
    325         append variant_line " conflicts python${over_no_dot}"
     320foreach py_ver ${python_versions} {
     321    set py_ver_no_dot [join [split ${py_ver} "."] ""]
     322    set variant_line {variant python${py_ver_no_dot} description "Build with python ${py_ver} support"}
     323    foreach py_over ${python_versions} {
     324        if { ${py_ver} == ${py_over} } { continue }
     325        set py_over_no_dot [join [split ${py_over} "."] ""]
     326        append variant_line " conflicts python${py_over_no_dot}"
    326327    }
    327328    append variant_line { { } }
    328329    eval $variant_line
    329     if {[variant_isset python${ver_no_dot}]} {
    330         if {${default_python_variant} != "+python${ver_no_dot}"} {
     330    if {[variant_isset python${py_ver_no_dot}]} {
     331        if {${default_python_variant} != "+python${py_ver_no_dot}"} {
    331332            set default_python_variant ""
    332333        }
    333334    }
     
    338339}
    339340
    340341# If a python variant is enabled, activate it
    341 foreach ver ${python_versions} {
    342     set ver_no_dot [join [split ${ver} "."] ""]
    343     if {[variant_isset python${ver_no_dot}]} {
     342set active_python_version ""
     343foreach py_ver ${python_versions} {
     344    set py_ver_no_dot [join [split ${py_ver} "."] ""]
     345    if {[variant_isset python${py_ver_no_dot}]} {
    344346
    345347        # Check root5 variants
    346348        set portname root5
    347         if {![catch {set result [active_variants ${portname} python${ver_no_dot}]}]} {
     349        if {![catch {set result [active_variants ${portname} python${py_ver_no_dot}]}]} {
    348350            if {$result} {
    349                 ui_error "Cannot install ${name} with +python${ver_no_dot} variant"
    350                 return -code error "${portname} port is already installed with +python${ver_no_dot} and both cannot be active at once. Pick a different python variant."
     351                ui_error "Cannot install ${name} with +python${py_ver_no_dot} variant"
     352                return -code error "${portname} port is already installed with +python${py_ver_no_dot} and both cannot be active at once. Pick a different python variant."
    351353            }
    352354        }
    353355
    354356        # Setup python
    355         set mypydir ${prefix}/Library/Frameworks/Python.framework/Versions/${ver}
     357        set mypydir ${prefix}/Library/Frameworks/Python.framework/Versions/${py_ver}
    356358        configure.args-replace  -Dpython=OFF -Dpython=ON
    357359        configure.args-append   -DPYTHON_INCLUDE_DIR="${mypydir}/Headers" \
    358                                 -DPYTHON_LIBRARY="${prefix}/lib/libpython${ver}.dylib" \
    359                                 -DPYTHON_EXECUTABLE="${prefix}/bin/python${ver}"
    360         depends_lib-append      port:python${ver_no_dot}
     360                                -DPYTHON_LIBRARY="${prefix}/lib/libpython${py_ver}.dylib" \
     361                                -DPYTHON_EXECUTABLE="${prefix}/bin/python${py_ver}"
     362        depends_lib-append      port:python${py_ver_no_dot}
     363        set active_python_version ${py_ver}
    361364        post-destroot {
    362             set mypylibdir  ${prefix}/Library/Frameworks/Python.framework/Versions/${ver}/lib/python${ver}
     365            set mypylibdir  ${prefix}/Library/Frameworks/Python.framework/Versions/${active_python_version}/lib/python${active_python_version}
    363366            set mypysitedir ${mypylibdir}/site-packages/
    364367            file mkdir ${destroot}${mypysitedir}
    365368            foreach pyfile [glob ${destroot}${install_prefix}/lib/root/*.py*] { move $pyfile ${destroot}${mypysitedir}/ }
     
    488491set clang_versions { 3.3 3.4 3.5 }
    489492
    490493# Define the available variants
    491 foreach ver ${clang_versions} {
    492     set ver_no_dot [join [split ${ver} "."] ""]
    493     set variant_line {variant clang${ver_no_dot} description "Compile using MacPorts clang ${ver}"}
    494     foreach over ${clang_versions} {
    495         if { ${ver} == ${over} } { continue }
    496         set over_no_dot [join [split ${over} "."] ""]
    497         append variant_line " conflicts clang${over_no_dot}"
     494foreach clang_ver ${clang_versions} {
     495    set clang_ver_no_dot [join [split ${clang_ver} "."] ""]
     496    set variant_line {variant clang${clang_ver_no_dot} description "Compile using MacPorts clang ${clang_ver}"}
     497    foreach clang_over ${clang_versions} {
     498        if { ${clang_ver} == ${clang_over} } { continue }
     499        set clang_over_no_dot [join [split ${clang_over} "."] ""]
     500        append variant_line " conflicts clang${clang_over_no_dot}"
    498501    }
    499502    append variant_line { { } }
    500503    eval $variant_line
     
    514517
    515518# Is a variant active ?
    516519set active_clang_variant ""
    517 foreach ver ${clang_versions} {
    518     set ver_no_dot [join [split ${ver} "."] ""]
    519     if {[variant_isset clang${ver_no_dot}]} {
    520         set active_clang_variant ${ver}
     520foreach clang_ver ${clang_versions} {
     521    set clang_ver_no_dot [join [split ${clang_ver} "."] ""]
     522    if {[variant_isset clang${clang_ver_no_dot}]} {
     523        set active_clang_variant ${clang_ver}
    521524    }
    522525}
    523526
     
    539542set gcc_versions { 4.7 4.8 4.9 }
    540543set default_fortran_variant +gcc48
    541544
    542 foreach ver ${gcc_versions} {
    543     set ver_no_dot [join [split ${ver} "."] ""]
     545foreach gcc_ver ${gcc_versions} {
     546    set gcc_ver_no_dot [join [split ${gcc_ver} "."] ""]
    544547
    545     set variant_line {variant gcc${ver_no_dot} description "Build with gfortran from gcc${ver_no_dot}"}
     548    set variant_line {variant gcc${gcc_ver_no_dot} description "Build with gfortran from gcc${gcc_ver_no_dot}"}
    546549
    547     foreach over ${gcc_versions} {
    548         if {${ver} == ${over}} {
     550    foreach gcc_over ${gcc_versions} {
     551        if {${gcc_ver} == ${gcc_over}} {
    549552            continue
    550553        }
     554        set gcc_over_no_dot [join [split ${gcc_over} "."] ""]
     555        append variant_line " conflicts gcc${gcc_over_no_dot}"
     556    }
    551557
    552         set over_no_dot [join [split ${over} "."] ""]
    553         append variant_line " conflicts gcc${over_no_dot}"
    554     }
    555558    append variant_line { {} }
    556559
    557560    eval $variant_line
    558561
    559     if {[variant_isset gcc${ver_no_dot}]} {
    560         if {${default_fortran_variant} != "+gcc${ver_no_dot}"} {
     562    if {[variant_isset gcc${gcc_ver_no_dot}]} {
     563        if {${default_fortran_variant} != "+gcc${gcc_ver_no_dot}"} {
    561564            set default_fortran_variant ""
    562565        }
    563566    }
     
    567570    default_variants-append "${default_fortran_variant}"
    568571}
    569572
    570 foreach ver ${gcc_versions} {
    571     set ver_no_dot [join [split ${ver} "."] ""]
     573foreach gcc_ver ${gcc_versions} {
     574    set gcc_ver_no_dot [join [split ${gcc_ver} "."] ""]
    572575
    573     if {[variant_isset gcc${ver_no_dot}]} {
     576    if {[variant_isset gcc${gcc_ver_no_dot}]} {
    574577        depends_lib-append path:lib/libgcc/libgcc_s.1.dylib:libgcc
    575         depends_build-append port:gcc${ver_no_dot}
     578        depends_build-append port:gcc${gcc_ver_no_dot}
    576579
    577         configure.fc  ${prefix}/bin/gfortran-mp-${ver}
    578         configure.f77 ${prefix}/bin/gfortran-mp-${ver}
    579         configure.f90 ${prefix}/bin/gfortran-mp-${ver}
     580        configure.fc  ${prefix}/bin/gfortran-mp-${gcc_ver}
     581        configure.f77 ${prefix}/bin/gfortran-mp-${gcc_ver}
     582        configure.f90 ${prefix}/bin/gfortran-mp-${gcc_ver}
    580583
    581584        configure.args-replace -Dfortran=OFF -Dfortran=ON
    582585    }