[43024] trunk/dports/x11/xorg-xcb-proto/Portfile

Ryan Schmidt ryandesign at macports.org
Wed Dec 3 13:37:34 PST 2008


On Dec 3, 2008, at 14:58, jeremyhu at macports.org wrote:

> Revision: 43024
>           http://trac.macports.org/changeset/43024
> Author:   jeremyhu at macports.org
> Date:     2008-12-03 12:58:44 -0800 (Wed, 03 Dec 2008)
> Log Message:
> -----------
> Added missing dependencies on python and libxml2 - bug #17499


> +set pyversion   2.6
> +depends_run     port:libxml2 \
> +                port:python[strsed ${pyversion} {g/[.]//}]
> +configure.env   PYTHON=${prefix}/bin/python${pyversion}
> +
> +variant python25 description {Use python 2.5 for xcbgen} {
> +    depends_run-delete      port:python[strsed ${pyversion} {g/ 
> [.]//}]
> +    configure.env-delete    PYTHON=${prefix}/bin/python${pyversion}
> +
> +    set pyversion           2.5
> +
> +    depends_lib-append      port:python[strsed ${pyversion} {g/ 
> [.]//}]
> +    configure.env-append    PYTHON=${prefix}/bin/python${pyversion}
> +}
> +
> +variant python30 description {Use python 3.0 for xcbgen} {
> +    depends_run-delete      port:python[strsed ${pyversion} {g/ 
> [.]//}]
> +    configure.env-delete    PYTHON=${prefix}/bin/python${pyversion}
> +
> +    set pyversion           3.0
> +
> +    depends_lib-append      port:python[strsed ${pyversion} {g/ 
> [.]//}]
> +    configure.env-append    PYTHON=${prefix}/bin/python${pyversion}
> +}

Presumably only one python version can be selected at a time? Right  
now, nothing prevents a user from selecting both the +python25 and  
+python30 variants.

You should add a variant for python26 as well. You should mark all  
three variants as conflicting with one another. And you should have  
the new +python26 variant be the default, unless the user has chosen  
another one.

You should also use configure.python instead of configure.env-append  
PYTHON=. I didn't remember if that was already in MacPorts 1.6.0 or  
whether it'll be new to 1.7.0, but the ChangeLog seems to indicate it  
was in 1.6.0.

I don't think I've seen a strsed (or, any other string manipulation  
command) used as part of a depspec. Does that really work? I removed  
it in my patch and just wrote out the numbers. It also helps when  
people want to grep the portfiles to see e.g. what all depends on  
python26 ("grep :python26 */*/Portfile").

Your python26 was a runtime dependency but your python25 and python30  
were library dependencies. I didn't know which is right. I made them  
all library dependencies in my version.

Attached is my patch, though again I haven't tested it.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: xorg-xcb-proto.diff
Type: application/octet-stream
Size: 1867 bytes
Desc: not available
URL: <http://lists.macosforge.org/pipermail/macports-dev/attachments/20081203/52cfcd95/attachment.obj>


More information about the macports-dev mailing list