swiginac

Mark Brethen mark.brethen at gmail.com
Sat Nov 14 10:56:11 PST 2015


> On Nov 14, 2015, at 10:38 AM, Joshua Root <jmr at macports.org> wrote:
> 
> On 2015-11-15 02:57 , Mark Brethen wrote:
>> swig_opt = '--swig-cpp'
>> if distutils.__version__ >= '2.4': swig_opt = '--swig-opts=-c++'
> 
> OK, looks like the setup.py is busted after all (and always was...):
> 
> This is a string comparison, which does not correctly compare version
> numbers like 2.7.10 (the current version) and 2.4. One of the classes
> from distutils.version should be used instead (StrictVersion or
> LooseVersion).
> 
> - Josh

I patched that line to: if LooseVersion(distutils.__version__) >= LooseVersion("2.4”): swig_opt = '--swig-opts=-c++'

Now I get this error: 

:debug:build Executing command line:  cd "/opt/local/var/macports/build/_Users_marbre_ports_python_py-swiginac/py27-swiginac/work/swiginac-1.5.1.1" && /opt/local/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7 setup.py --no-user-cfg build 
:info:build Traceback (most recent call last):
:info:build   File "setup.py", line 48, in <module>
:info:build     if LooseVersion(distutils.__version__) >= LooseVersion("2.4"): swig_opt = '--swig-opts=-c++'
:info:build NameError: name 'LooseVersion' is not defined

Also, at the very top of setup.py there is: #!/usr/bin/env python

Should the be changed to ${prefix}/bin or something else?

Mark






More information about the macports-dev mailing list