[76478] trunk/dports/devel/redo/Portfile

Ryan Schmidt ryandesign at macports.org
Thu Feb 24 21:03:13 PST 2011


On Feb 24, 2011, at 15:58, singingwolfboy at macports.org wrote:

> Revision: 76478
>          http://trac.macports.org/changeset/76478
> Author:   singingwolfboy at macports.org
> Date:     2011-02-24 13:58:33 -0800 (Thu, 24 Feb 2011)
> Log Message:
> -----------
> Updated redo to 0.06. Docs can no longer be pulled from git, so added python dependencies to doc variant.


> depends_lib             bin:python:python_select
> variant doc description {Build and install man pages} {
> -    # The documentation requires pandoc to build...    
> -    #depends_build       bin:pandoc:pandoc
> -    # ... but if we don't have pandoc already installed, we can just grab
> -    # the pregenerated documentation.
> -    post-fetch {
> -        if {[file isfile "${prefix}/bin/pandoc"] == 0} {
> -            system "cd ${worksrcpath} && ${build.cmd} Documentation/git-import"
> -        }
> +    # The documentation requires some python modules to build
> +    depends_build       port:py27-beautifulsoup port:py27-markdown
> +    # make sure we use macports python, since that's required to build docs
> +    configure {
> +        eval reinplace "s|#!/usr/|#!${prefix}/|" [glob ${worksrcpath}/*]

So, for one thing, the configure phase you've added here in the doc variant is the same configure phase you already have in the python_select variant. What happens if the user selects both of these? Instead, why not make the doc variant depend on the python_select variant and remove the duplicate code from the doc variant?

Second, the a problem with this strategy in the first place is that you're declaring a dependency on the binary "python", and telling MacPorts to install python_select if it can't find one, and then making the scripts run "/opt/local/bin/python". But /usr/bin/python will satisfy the dependency; MacPorts would never install python_select in response to this dependency declaration.

Third, just installing "python_select" doesn't create /opt/local/bin/python; the user would have to run python_select and select a particular python to make that work. The python selected by python_select is supposed to be for the user's use only; ports installed by MacPorts should not be trying to make use of that. Instead, ports should depend on a specific version of python, and use that python binary.





More information about the macports-dev mailing list