portfile questions

Joshua Root jmr at macports.org
Wed Sep 13 05:54:14 UTC 2023


On 13/9/2023 14:12, Langer, Stephen A. (Fed) via macports-dev wrote:
> Hi --
> 
> I'm getting ready to update the oof2 and oofcanvas ports and have a few 
> questions.   I created the initial portfiles with a lot of help from the 
> admins and I'm still more or less a novice at this.
> 
> The original versions were built with distutils, but the new ones use 
> cmake.  The installed files include an executable python script, a bunch 
> of python  modules, and some libraries built from C++ code.   I think I 
> should use the cmake portgroup instead of the python portgroup, because 
> doesn't the portgroup determine if the build is done with cmake or 
> python.  I see that some other ports use both so I am missing something.

The cmake portgroup mostly sets up the configure phase. The python 
portgroup disables the configure phase entirely by default. Anything set 
up by a portgroup can be overridden in the Portfile, so both of these 
can be used together under some conditions -- whether it's worth doing 
so depends on just how the build system works.

(You can certainly end up in a situation where using a portgroup creates 
more work than it saves, if it wasn't designed for what you want to do 
and you have to fight against it.)

> If I use the python portgroup, then I'd have subports pyXY-oof2 and 
> pyXY-oofcanvas.  Would users of the old oof2 and oofcanvas ports know to 
> upgrade to the new ports?

Not necessarily unless you mark the old ports as replaced_by the new 
ones. <https://trac.macports.org/wiki/PortfileRecipes#replaced-by>

> If the new portfile doesn't use the python portgroup, I assume I should 
> just offer variants for different python versions. Is there a standard 
> way to choose the default variant, to reduce the chances of installing 
> extra python versions if a user doesn't already have the one I've chosen 
> as the default?

The default should be the one that was the latest stable Python version 
on January 1st. So currently 3.11. 
<https://trac.macports.org/wiki/Python#VersionPolicy>

- Josh


More information about the macports-dev mailing list