I'm sending this reply back to the list so others can benefit from the 
discussion.


On Apr 24, 2011, at 13:48, Andrea D'Amore wrote:
> On Sun, Apr 24, 2011 at 3:27 AM, Ryan Schmidt wrote:
>>> @@ -0,0 +1,51 @@
>> Don't forget to put the standard modeline here.
> 
> I'm not on my usual system ATM, I forgot to set subversion's
> auto-props for Portfile, is this related?
> I never explicitly put modeline on my system as well.

The modeline is not related to Subversion properties; it's something you would 
manually put in the first line of the portfile. It's not required, but a good 
idea, as it instructs text editors what kind of file this is and how it's 
formatted. The guide explains further, and shows the standard modeline that we 
want to use.

http://guide.macports.org/#development.creating-portfile


>>> +use_configure       no
>> 
>> Because you're not using a standard configure script, you need to manually 
>> handle UsingTheRightCompiler, build_arch and a universal variant.
> 
> I'll read the wiki page, I admit I never quite figured what archs
> Portfiles should provide…

The portfile should respect the user's choice of build_arch, and offer a 
universal variant which respects the user's choice of universal_archs. There 
are many portfiles with "use_configure no" that show how this is done manually. 
And the UsingTheRightCompiler page explains itself pretty well. These concepts 
are related -- if a port uses "use_configure no" it probably needs to manually 
handle both UsingTheRightCompiler and using the right architecture, in addition 
to other details which are probably more obvious, like using the right 
libraries (by supplying environment variables like CPPFLAGS and LDFLAGS, 
patching the makefile, or other methods). It might be nice to have a single 
document encompassing all of a portfile author's responsibilities when using 
"use_configure no".


>> The patchfile hardcodes /opt/local; please arrange to use ${prefix} instead.
> 
> I started with a post-patch augmented phase only, then realized I had
> to change other raws and went with a patchfile but I diffed the
> Makefile after "port patch" so ${prefix}'s value ended being there.

Yup, I've seen it happen before. That's why I have an email rule highlighting 
MacPorts commits containing the string "/opt/local"!


>> You can simplify this using xinstall's -W argument.
> 
> Right, will do.
> 
>>> +    file copy {*}[glob ${worksrcpath}/examples/*] 
>>> ${destroot}${prefix}/share/examples/${name}
>> What's this "{*}" doing?
> 
> Expansion [1],
> [1] http://wiki.tcl.tk/17158

Interesting! I was not aware of that. Thanks.


> IIRC I have this habit from xinstall that likes an
> expanded list but not a single string with more files so [glob ]
> doesn't working good.
> 
> I intented to work on xinstall recursive copying (there should be a
> ticket about it) but I hadn't much time…

Oh, yes. I remember this problem now. I know that the guide says that if you 
want to use glob with xinstall, you stick an eval in front of it:

eval xinstall [glob pattern] directory

http://guide.macports.org/#reference.tcl-extensions

I don't know whether there is any functional difference for us between "eval 
... [glob ...]" and "... {*}[glob ...]". The one problem I see is that the page 
you referred me to says {*} is a Tcl 8.5 addition. We still allow users to use 
MacPorts on Tiger, which has Tcl 8.4. I tested this port on Tiger, and it 
failed. (Fixed in r78226.) So we should avoid Tcl 8.5 constructs where 
alternatives exist, until such a time that it's actually impossible to use 
MacPorts on Tiger (for example if a necessary change in base cannot be made 
Tiger-compatible).



_______________________________________________
macports-dev mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macports-dev

Reply via email to