[MacPorts] #19559: variant variables not carried through to post-destroot
#19559: variant variables not carried through to post-destroot ---------------------------------+------------------------------------------ Reporter: dweber@… | Owner: macports-tickets@… Type: request | Status: new Priority: Low | Milestone: MacPorts 1.8.0 Component: base | Version: 1.7.1 Keywords: variant variables | Port: ---------------------------------+------------------------------------------ Can we make variant variables carry through into the post-destroot stage definition within the variant (such that variables defined within the variant over-ride any global variables)? For example: {{{ variant python26 { set pyver 2.6 set python python${pyver} set pyport [join [lrange [split ${python} .] 0 1] ""] set pyframe ${prefix}/Library/Frameworks/Python.framework/Versions/${pyver} depends_lib-append port:${pyport} post-destroot { set pyPackage ${destroot}${pyframe}/lib/${python}/site- packages/THISPACKAGE } } }}} In this mock-up example, the depends-lib will get the ${pyport} but anything within the post-destroot will not see any of the python variables defined in the variant. All of those variables have to be either global or set within the post-destroot clause (within the variant). -- Ticket URL: <http://trac.macports.org/ticket/19559> MacPorts <http://www.macports.org/> Ports system for Mac OS
#19559: variant variables not carried through to post-destroot ---------------------------------+------------------------------------------ Reporter: dweber@… | Owner: macports-tickets@… Type: request | Status: new Priority: Low | Milestone: MacPorts Future Component: base | Version: 1.7.1 Keywords: variant variables | Port: ---------------------------------+------------------------------------------ Changes (by blb@…): * milestone: MacPorts 1.8.0 => MacPorts Future Comment: I think this is a Tcl issue, you can use {{{ global pyver python pyport pyframe }}} at the beginning of the variant section; otherwise, the only way to deal with it would be to automatically make such things global in base, though I don't know if that's feasible nor how difficult that would be. -- Ticket URL: <http://trac.macports.org/ticket/19559#comment:1> MacPorts <http://www.macports.org/> Ports system for Mac OS
#19559: variant variables not carried through to post-destroot ---------------------------------+------------------------------------------ Reporter: dweber@… | Owner: macports-tickets@… Type: request | Status: new Priority: Low | Milestone: MacPorts Future Component: base | Version: 1.7.1 Keywords: variant variables | Port: ---------------------------------+------------------------------------------ Comment(by jmr@…): Isn't this what `option` is for? -- Ticket URL: <http://trac.macports.org/ticket/19559#comment:2> MacPorts <http://www.macports.org/> Ports system for Mac OS
#19559: variant variables not carried through to post-destroot ---------------------------------+------------------------------------------ Reporter: dweber@… | Owner: macports-tickets@… Type: request | Status: new Priority: Low | Milestone: MacPorts Future Component: base | Version: 1.7.1 Keywords: variant variables | Port: ---------------------------------+------------------------------------------ Comment(by dweber@…): Can't find TFM on 'option'. Is it a macports tcl extension? The only thing I found was the option database for tk, probably not what your talking about. Here's a concrete example of what I'm doing in vtk-devel - any tips on how to tidy this up would be great! The idea is to provide two variants for python wrapping, one for py25 and another for py26 (and they must conflict, but only because of configure and build issues, not installation issues). {{{ variant py25 conflicts py26 requires shared description {python 2.5 wrapper} { set pyver 2.5 set python python${pyver} set pyport [join [lrange [split ${python} .] 0 1] ""] set pyframe ${prefix}/Library/Frameworks/Python.framework/Versions/${pyver} depends_lib-append \ port:${pyport} configure.args-delete \ -DVTK_WRAP_PYTHON:BOOL=OFF \ configure.args-append \ -DVTK_WRAP_PYTHON:BOOL=ON \ -DVTK_NO_PYTHON_THREADS:BOOL=OFF \ -DPYTHON_INCLUDE_PATH:FILEPATH=${prefix}/include/${python} \ -DPYTHON_LIBRARY:FILEPATH=${prefix}/lib/lib${python}.dylib \ -DPYTHON_DEBUG_LIBRARY:FILEPATH=${prefix}/lib/lib${python}.dylib \ -DPYTHON_EXECUTABLE:FILEPATH=${prefix}/bin/${python} \ -DVTK_PYTHON_SETUP_ARGS:STRING='--prefix=${prefix} --root=${destroot}' # The VTK_PYTHON_SETUP_ARGS *MUST* be in single quotes } variant py26 conflicts py25 requires shared description {python 2.6 wrapper} { set pyver 2.6 set python python${pyver} set pyport [join [lrange [split ${python} .] 0 1] ""] set pyframe ${prefix}/Library/Frameworks/Python.framework/Versions/${pyver} depends_lib-append \ port:${pyport} configure.args-delete \ -DVTK_WRAP_PYTHON:BOOL=OFF configure.args-append \ -DVTK_WRAP_PYTHON:BOOL=ON \ -DVTK_NO_PYTHON_THREADS:BOOL=OFF \ -DPYTHON_INCLUDE_PATH:FILEPATH=${prefix}/Library/Frameworks/Python.framework/Headers \ -DPYTHON_LIBRARY:FILEPATH=${prefix}/lib/lib${python}.dylib \ -DPYTHON_DEBUG_LIBRARY:FILEPATH=${prefix}/lib/lib${python}.dylib \ -DPYTHON_EXECUTABLE:FILEPATH=${prefix}/bin/${python} \ -DVTK_PYTHON_SETUP_ARGS:STRING='--prefix=${pyframe} --root=${destroot}' # For 2.6, it needs to be installed into ${pyframe}/lib/${python }/site-packages # The VTK_PYTHON_SETUP_ARGS *MUST* be in single quotes post-destroot { # Redefine all the python variables in this clause (they are not carried # through from the definitions above in the variant). set pyver 2.6 set python python${pyver} set pyport [join [lrange [split ${python} .] 0 1] ""] set pyframe ${prefix}/Library/Frameworks/Python.framework/Versions/${pyver} # Reset the name of the vtkpython binary move ${destroot}${prefix}/bin/vtkpython ${destroot}${prefix}/bin/vtk-${branch}-${pyport} # Is it possible to change the python site-package name and have it all work OK? # from: /opt/local/lib/python2.6/site-packages/vtk # to: /opt/local/lib/python2.6/site-packages/vtk-5.4 # Reset the RPATH for all the python .so files set buildBinPath ${build.dir}/bin set vtkLibPath ${prefix}/lib/${distname} set vtkPythonPackage ${destroot}${pyframe}/lib/${python}/site- packages/vtk foreach f [glob ${vtkPythonPackage}/*.so] { foreach dep [exec otool -L ${f}] { if [string match "*libvtk*.dylib" ${dep}] { set newdep [strsed ${dep} #${buildBinPath}#${vtkLibPath}#] system "install_name_tool -change ${dep} ${newdep} ${f}" } } } } } }}} -- Ticket URL: <http://trac.macports.org/ticket/19559#comment:3> MacPorts <http://www.macports.org/> Ports system for Mac OS
#19559: variant variables not carried through to post-destroot ---------------------------------+------------------------------------------ Reporter: dweber@… | Owner: macports-tickets@… Type: enhancement | Status: new Priority: Low | Milestone: MacPorts Future Component: base | Version: 1.7.1 Keywords: variant variables | Port: ---------------------------------+------------------------------------------ Changes (by raimue@…): * type: request => enhancement -- Ticket URL: <http://trac.macports.org/ticket/19559#comment:4> MacPorts <http://www.macports.org/> Ports system for Mac OS
#19559: variant variables not carried through to post-destroot ----------------------------------+----------------------------------------- Reporter: dweber@… | Owner: macports-tickets@… Type: enhancement | Status: closed Priority: Low | Milestone: MacPorts Future Component: base | Version: 1.7.1 Resolution: invalid | Keywords: variant variables Port: | ----------------------------------+----------------------------------------- Changes (by jmr@…): * status: new => closed * resolution: => invalid Comment: Variant bodies are run as procedures. Just using 'set' will create a local variable. Use 'global', or the 'options' infrastructure: {{{ variant foo { options myoption1 myoption1 myoption1 bar myoption2 baz post-destroot { ui_msg "my options are $myoption1 and $myoption2" } } }}} -- Ticket URL: <http://trac.macports.org/ticket/19559#comment:5> MacPorts <http://www.macports.org/> Ports system for Mac OS
participants (1)
-
MacPorts