Resolving Python conflicts (in wxPython)

Mojca Miklavec mojca at macports.org
Fri Aug 16 01:43:02 PDT 2013


On Thu, Aug 15, 2013 at 1:23 PM, Mojca Miklavec wrote:
> On Thu, Aug 15, 2013 at 2:07 AM, Ryan Schmidt wrote:
>> If possible, ports should not conflict. The way to make them not conflict is not to try to install the same file to the same location from multiple ports. Rename the files or install them to different locations.
>>
>> There may be places in the code of the project where the files are referenced by name or location which would have to be patched to accommodate the rename or move. And if it is a public file that other ports are expected to use, then that magnifies the problem since they all would need to know about the rename or move as well.
>
> I inspected the situation a bit.
>
> (1) First about the conflict between py26-* and py27-* (an ancient
> ticket is here for example: https://trac.macports.org/ticket/19190).
> They seem to install exactly the same files to exactly the same
> location (header files, swig interface, python files, ... - all just
> literal copies from the sources). I can resolve the conflict by:
> - manually copying (a nontrivial subset of the files) from sources
> when installing the main py-* port
> - deleting these files in post-destroot phase of py2X-*.
> - making py-* a dependency of py2X-*.

Plus one additional complication.

My new suggested wxWidgets-2.8 port now provides wxWidgets-2.8 and
wxgtk-2.8, and py-wxpython-2.8 provides +carbon and +gtk variant (the
first one depends on wxWidgets-2.8 and the second one on wxgtk-2.8).
This means that the "master" port "py-wxwidgets-2.8 +carbon" would
need to install files to
    /opt/local/Library/Frameworks/wxWidgets.framework/Versions/wxWidgets/2.8
and "py-wxwidgets-2.8 +gtk" would need to install files to
    /opt/local/Library/Frameworks/wxWidgets.framework/Versions/wxGTK/2.8

So I would end up with the following:



PortGroup           python      1.0
PortGroup           wxwidgets   1.0

name                py-wxpython-2.8
...

if {$subport != $name} {

    variant carbon conflicts gtk description {} {
        wxWidgets.use       wxWidgets-2.8
        depends_lib-append  port:wxWidgets-2.8 \
                            port:${name}

        require_active_variants ${name} carbon
        ...
        post-destroot {
            # delete files installed by ${name}
            ...
        }
    }

    variant gtk conflicts carbon description {} {
        wxWidgets.use       wxGTK-2.8
        depends_lib-append  port:wxgtk-2.8 \
                            port:${name}

        require_active_variants ${name} gtk
        ...
        post-destroot {
            # delete files installed by ${name}
            ...
        }
    }
} else {

    variant carbon conflicts gtk description {} {
        wxWidgets.use       wxWidgets-2.8
        post-destroot {
            # install common files for all python flavours
            ...
        }
    }

    variant gtk conflicts carbon description {} {
        wxWidgets.use       wxGTK-2.8
        post-destroot {
            # install common files for all python flavours
            ...
        }
    }
}

Does this sound insane?

Mojca


More information about the macports-dev mailing list