How to extracting a subset of files from one of two distfiles (was: Resolving Python conflicts)

Ryan Schmidt ryandesign at macports.org
Wed Aug 21 20:38:56 PDT 2013


On Aug 21, 2013, at 07:41, Mojca Miklavec wrote:

> 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"

Right, something like that is a usual answer (except that I would have appended to the existing post_args instead of repeating the default post_args…), but:

> but I don't know how to apply post_args to one of the two files only.

You can't. You'll have to exclude this file from the regular extraction code (by listing the other files in extract.only), then write a post-extract block to extract what you want from this other file.


As far as I can tell the uncompressed size of wxPython-src-2.8.12.1.tar.bz2 is 123MB. The compressed size is 30MB. Still, that's a lot to download, if all you really want is a couple files. Is there no other smaller file you could download with just those files?



More information about the macports-dev mailing list