On 2021/08/14 14:05, Stuart Henderson wrote:
> On 2021/08/14 11:59, Yifei Zhan wrote:
> > Hi,
> > 
> > At the moment portgen will add 
> > 
> >   `MODPY_VERSION = ${MODPY_DEFAULT_VERSION_3}` 
> > 
> > to new python3 port's Makefile by default, which seems to be outdated.
> > 
> > The following patch stop that from happening.
> > 
> > comment? feedback?
> > 
> > Index: infrastructure/lib/OpenBSD/PortGen/Port/PyPI.pm
> > ===================================================================
> > RCS file: /cvs/ports/infrastructure/lib/OpenBSD/PortGen/Port/PyPI.pm,v
> > retrieving revision 1.19
> > diff -u -r1.19 PyPI.pm
> > --- infrastructure/lib/OpenBSD/PortGen/Port/PyPI.pm 30 Apr 2020 23:04:48 
> > -0000      1.19
> > +++ infrastructure/lib/OpenBSD/PortGen/Port/PyPI.pm 14 Aug 2021 11:48:17 
> > -0000
> > @@ -119,7 +119,7 @@
> >             $self->{reset_values}{MODPY_VERSION} = 1;
> >             $self->set_other( 'FLAVORS', "python$_" ) for @versions;
> >             $self->set_other( 'FLAVOR', "python$versions[-1]" );
> > -   } elsif ( @versions && $versions[0] != 2 ) {
> > +   } elsif ( @versions && $versions[0] != 2 && $versions[0] != 3 ) {
> >             $self->{reset_values}{$_} = 1 for qw( FLAVORS FLAVOR );
> >             $self->set_other(
> >                     MODPY_VERSION => "\${MODPY_DEFAULT_VERSION_$_}" )
> > 
> 
> That's not quite right, it needs to do the following:
> 
> - if the port is python 2 only, set MODPY_VERSION = ${MODPY_DEFAULT_VERSION_2}
> 
> - if the port is python 3 only, set FLAVOR = python3 / FLAVORS = python3

PS non-obvious piece of information that you might not have discovered
yet and which IIRC is needed when changing this: portgen uses
ports/infrastructure/templates/Makefile.template to fill things in

> - undecided about ports which support py2+3; I think at this point we should
> probably treat them the same as py3-only because we don't really want to be
> importing new py2 ports, i.e. also FLAVOR = python3 / FLAVORS = python3
> 
> (Related issue with portgen, get_deps returns all deps, it should skip py2
> deps for a py3 port, otherwise it tries to create ports for things which
> are unused in py3-land because they're part of python itself, it would
> be nice to solve this automatically, but at least it means that when
> portgen-created ports are reviewed that should be taken into account).
> 

Reply via email to