[75495] trunk/dports/graphics/vigra

Michael Dickens michaelld at macports.org
Fri Feb 4 16:41:09 PST 2011


If you do "otool -L /opt/local/lib/libboost_mpi_python-mt.dylib | grep Python", does it return anything?  If so, does it return the same as "otool -L /opt/local/lib/libboost_python-mt.dylib | grep Python"?  If so, then how about I just pick the first entry returned by the 'find'?  That way there will always just be one file to 'otool', and it will always provide the Python version correctly.

Or, are you saying that you don't want this sort of hackery in a Portfile?  I can always revert to +pythonXY variants, but then the user -must- make sure to use the same XY as that used by Boost.  I still think I'd want to do the check to figure out which version of Python is used & warn the user or something.

Anyway, I'm open to suggestions from the greater MacPorts community here. - MLD

On Feb 4, 2011, at 12:54 PM, Jeremy Huddleston wrote:
> You can't do that boost_python_lib hackery.
>
> Failed to parse file graphics/vigra/Portfile: otool: can't open file: /opt/local/lib/libboost_mpi_python-mt.dylib
> /opt/local/lib/libboost_python-mt.dylib (No such file or directory)
>
> On Jan 26, 2011, at 16:45, michaelld at macports.org wrote:
>
>> Revision: 75495
>> +set python_version ""
>> +# figure out if Boost::Python exists,
>> +# and if so what Python version
>> +set boost_python_lib [exec find /opt/local/lib \
>> +                              -name "lib*boost*python*mt*dylib" \
>> +                              -type f -maxdepth 1 | \
>> +                           awk "{ print \$1 }"]
>> +if {${boost_python_lib} != ""} {
>> +    set python_version [exec otool -L ${boost_python_lib} | \
>> +                            grep Python | awk "{ print \$1 }" | \
>> +                            sed -e "s at .*Versions/\\(.*\\)/Python@\\1@"]
>> +}


More information about the macports-dev mailing list