Ticket #44267: root-python-check.diff

File root-python-check.diff, 1.9 KB (added by cjones051073 (Chris Jones), 10 years ago)
  • science/root6/Portfile

     
    344344    set py_ver_no_dot [join [split ${py_ver} "."] ""]
    345345    if {[variant_isset python${py_ver_no_dot}]} {
    346346
     347        set active_python_version        ${py_ver}
     348        set active_python_version_no_dot ${py_ver_no_dot}
     349
    347350        # Check root5 variants
    348         set portname root5
    349         if {![catch {set result [active_variants ${portname} python${py_ver_no_dot}]}]} {
    350             if {$result} {
    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."
     351        pre-activate {
     352            set portname root5
     353            if {![catch {set result [active_variants ${portname} python${active_python_version_no_dot}]}]} {
     354                if {$result} {
     355                    ui_error "Cannot install ${name} with +python${active_python_version_no_dot} variant"
     356                    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."
     357                }
    353358            }
    354359        }
    355360
     
    360365                                -DPYTHON_LIBRARY="${prefix}/lib/libpython${py_ver}.dylib" \
    361366                                -DPYTHON_EXECUTABLE="${prefix}/bin/python${py_ver}"
    362367        depends_lib-append      port:python${py_ver_no_dot}
    363         set active_python_version ${py_ver}
     368       
    364369        post-destroot {
    365370            set mypylibdir  ${prefix}/Library/Frameworks/Python.framework/Versions/${active_python_version}/lib/python${active_python_version}
    366371            set mypysitedir ${mypylibdir}/site-packages/