root port file python support

Ryan Schmidt ryandesign at macports.org
Fri Apr 9 01:01:48 PDT 2010


On Apr 8, 2010, at 02:17, Mattia Francesco Moro wrote:

> Hi, to all! This is my first mail in dev mailing list.

Welcome!

But this message has nothing to do with the "GSoC - Dynamic Libraries" thread to which you seem to have replied to create it. In the future, please create new threads by using your email program's New Message feature, not by replying to an unrelated topic.


> I have a problem with this portfile: http://trac.macports.org/ticket/23856
> 
> i need to pass on the output of:
> 
> python-config --includes | sed -e 's/-I//' | awk '{print \$1}'
> 
> to configure script. I try in this way:
> 
> http://trac.macports.org/attachment/ticket/23856/Portfile#L121
> 
> but it doesn't work. Any idea?

Portfiles are not shell scripts; you cannot use shell syntax like backticks to run external programs. Portfiles are Tcl scripts. The syntax for executing an external program is to call the exec procedure. For example, instead of 

--with-python-incdir=`${prefix}/bin/python-config --includes | sed -e 's/-I//' | awk '{print \$1}'`

you could use

--with-python-incdir=[exec ${prefix}/bin/python-config --includes | sed -e 's/-I//' | awk '{print \$1}']

However, as expressed in a comment in that ticket, this is a bit complicated, and besides relies on the user having installed and properly set up the python_select port. Instead, consider just using python 2.6. Of course you'll also need to add a dependency on whatever python you choose.



More information about the macports-dev mailing list