[MacPorts] #19559: variant variables not carried through to post-destroot

MacPorts noreply at macports.org
Thu May 7 10:42:16 PDT 2009


#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


More information about the macports-tickets mailing list