Reversing use_bzip2

Mojca Miklavec mojca at
Thu Sep 14 09:30:44 UTC 2017

On 13 September 2017 at 15:42, Rainer Müller wrote:
> On 2017-09-13 11:48, Mojca Miklavec wrote:
>> When trying to update x86_64-w64-mingw32-gcc I noticed that GCC 7.2 no
>> longer provides bzip2 sources, but I'm not sure how to tell the
>> Portfile that it should use xz instead of bzip2 given that the
>> crossgcc group already contains "use_bzip2 yes".
> Normally, this would be as simple as 'use_xz yes' in the Portfile to
> override the 'use_bzip2 yes' of the PortGroup. However, the port group
> also explicitly sets the distfiles option, which is required for the
> mirror tag for gcc and possibly a libc to be bundled. This option
> hardcodes .tar.bz2 in the port group. Unfortunately, using
> ${extract.suffix} would not make a difference as the variable will be
> expanded directly.
> Therefore you also need to override these options:
>  use_xz yes
>  distfiles       gcc-${version}.tar.xz:gcc
>  extract.only    gcc-${version}.tar.xz
> To make this easier for the gcc ports, we could pass the suffix to
> crossgcc.setup as an optional parameter and use that instead of always
> hardcoding bz2.

That sounds weird and ugly because each and every single port would
have to do that.

Maybe there could be a conditional in the PortGroup checking if the
version is higher (or equal) than 7 and if so, use xz.

Would it be difficult to make "use_bzip2 no" revert any changes
introduced by "use_bzip2 yes"?

I can try to patch the PortGroup, but I'm slightly less comfortable
patching the sources that handle "use_bzip2".


More information about the macports-dev mailing list