How to extracting a subset of files from one of two distfiles (was: Resolving Python conflicts)
Mojca Miklavec
mojca at macports.org
Wed Aug 21 05:41:07 PDT 2013
Hi,
When trying to resolve a conflict between py26-wxpython-2.8 and
py27-wxpython-2.8 which both try to install files to either
${frameworks_dir}/wxWidgets.framework/Versions/wxWidgets/2.8
or
${frameworks_dir}/Frameworks/wxWidgets.framework/Versions/wxGTK/2.8
depending on whether it tries to install for GTK or Carbon-based
wxWidgets, I came to the following two conclusions:
1.) The python portgroup basically disables *everything* in the main
port, so if I would want the py-wxpython-2.8 port to install anything
at all, I would need to revert everything the portgroup "conveniently"
disabled for me and I have no idea how to do that.
2.) Given that the wxPython ports install some
version&architecture-independent files to the same location as
wxWidgets anyway, I think that it would be best if the wxWidgets-2.8
port would simply extract a small subset of wxPython sources and
copied them to the desired location during the post-destroot phase.
For anyone who doesn't need wxPython this is indeed an overhead, but
it's small compared to the size of wxWidgets and it would bring a lot
benefits/simplicity.
So my question is the following:
I would like to fetch both wxWidgets-2.8.12.tar.bz2 and
wxPython-src-2.8.12.1.tar.bz2 in wxWidgets-2.8, but I would only like
to extract a small number of files from wxPython (3 MB out of 300 MB).
How can I do that?
wxPython does the following for example
extract.post_args "| tar -xf - ${worksrcdir}
${distname}-src-${version}/docs"
but I don't know how to apply post_args to one of the two files only.
Thank you,
Mojca
On Fri, Aug 16, 2013 at 10:43 AM, Mojca Miklavec wrote:
> On Thu, Aug 15, 2013 at 1:23 PM, Mojca Miklavec wrote:
>>
>> (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