swiginac

Mark Brethen mark.brethen at gmail.com
Sat Nov 14 15:29:51 PST 2015


> On Nov 14, 2015, at 3:24 PM, Joshua Root <jmr at macports.org> wrote:
> 
> On 2015-11-15 06:53 , Mark Brethen wrote:
>> 
>>> On Nov 14, 2015, at 1:25 PM, Mark Brethen <mark.brethen at gmail.com> wrote:
>>> 
>>> 
>>>> On Nov 14, 2015, at 1:21 PM, Joshua Root <jmr at macports.org> wrote:
>>>> 
>>>> Forgot to import LooseVersion from distutils.version?
>>> 
>>> Setup.py:
>>> 
>>> from distutils.core import setup, Extension
>>> import distutils
>>> from  sys import argv, exit
>>> import os
>>> from os.path import join as pjoin, sep as psep
>>> import commands
>>> 
>>> Mark
>>> 
>>> 
>>> 
>>> 
>> 
>> Added "from distutils.version import LooseVersion” but still fails:
>> 
>> :info:build running build
>> :info:build running build_py
>> :info:build file swiginac.py (for module swiginac) not found
>> :info:build file swiginac.py (for module swiginac) not found
>> :info:build running build_ext
>> :info:build building '_swiginac' extension
>> :info:build swigging swiginac.i to swiginac_wrap.c
>> :info:build swig -python -o swiginac_wrap.c swiginac.i
>> :info:build /opt/local/share/swig/3.0.7/python/std_common.i:73: Error: Syntax error in input(1).
>> :info:build error: command 'swig' failed with exit status 1
>> 
>> StrictVersion did not work. What is argv.insert()? I could not find any documentation for this command.
> 
> Argv is just a list, so it's the standard list insert method.
> 
> It's not like we support python 2.3 anyway, so just do this:
> 
> --- setup.py.orig	2015-11-15 08:10:37.000000000 +1100
> +++ setup.py	2015-11-15 08:18:00.000000000 +1100
> @@ -42,18 +42,12 @@
> 
> os.chdir(pjoin("src", "swiginac"))
> 
> -# The command line argument for running swig in c++ mode has changed from
> -# Python 2.3 to 2.4. We support both.
> -swig_opt = '--swig-cpp'
> -if distutils.__version__ >= '2.4': swig_opt = '--swig-opts=-c++'
> -
> if argv[1] == 'build':
>     argv[1] = 'build_ext'
> -if argv[1] == 'build_ext':
> -    argv.insert(2, swig_opt)
> -
> +
> e = Extension(name='_swiginac',
>               sources=['swiginac.i'],
> +              swig_opts=['-c++'],
>               **pkgconfig("ginac")
>              )
> 
> 
> - Josh

That did it. For some reason argv.insert did not work. 

Here is a listing of the contents for this port:

$ port contents py27-swiginac
Port py27-swiginac contains:
  /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Symbolic-0.3-py2.7.egg-info
  /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Symbolic/__init__.py
  /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Symbolic/__init__.pyc
  /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/_swiginac.so
  /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/swiginac-1.5.1-py2.7.egg-info
  /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/swiginac.py
  /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/swiginac.pyc
  /opt/local/share/doc/py27-swiginac/ChangeLog
  /opt/local/share/doc/py27-swiginac/README.txt
  /opt/local/share/doc/py27-swiginac/doc/examples/T0d.py
  /opt/local/share/doc/py27-swiginac/doc/examples/functions.py
  /opt/local/share/doc/py27-swiginac/doc/html4css1.css
  /opt/local/share/doc/py27-swiginac/doc/swiginac-doc.css
  /opt/local/share/doc/py27-swiginac/doc/swiginac_attributes.html
  /opt/local/share/doc/py27-swiginac/doc/swiginac_attributes.txt
  /opt/local/share/doc/py27-swiginac/doc/swiginac_basics.py
  /opt/local/share/doc/py27-swiginac/doc/swiginac_basics.py.html
  /opt/local/share/doc/py27-swiginac/doc/swiginac_basics.py.txt
  /opt/local/share/doc/py27-swiginac/doc/swiginac_overview.py.html
  /opt/local/share/doc/py27-swiginac/doc/swiginac_overview.py.txt
  /opt/local/share/doc/py27-swiginac/doc/swiginac_tutorial.py.html
  /opt/local/share/doc/py27-swiginac/doc/swiginac_tutorial.py.txt



Thanks!

Mark






More information about the macports-dev mailing list