Opened 6 years ago

Closed 4 years ago

#57927 closed enhancement (fixed)

waf PortGroup: make the python version configurable

Reported by: yan12125 (Chih-Hsuan Yen) Owned by: Ionic (Mihai Moldovan)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc: raimue (Rainer Müller), ryandesign (Ryan Carsten Schmidt), i0ntempest
Port: mpv

Description

Currently in _resources/port1.0/group/waf-1.0.tcl, Python 2.7 is hard-coded. It would be great to get the Python version configurable, so that ports using waf (e.g. mpv) can gradually move from Python 2.7 to Python 3.x.

For now the mpv port still uses Python 2.7 to build even with variant +python37. See https://github.com/macports/macports-ports/pull/3431 for some related discussions.

Attachments (1)

waf.diff (1.6 KB) - added by ryandesign (Ryan Carsten Schmidt) 4 years ago.
proposal 1

Download all attachments as: .zip

Change History (10)

comment:1 Changed 6 years ago by mf2k (Frank Schima)

Owner: set to Ionic
Status: newassigned

Don't forget to assign to the maintainer(s).

comment:2 Changed 6 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: raimue added

Cc'ing Rainer who made the waf portgroup.

comment:3 Changed 5 years ago by raimue (Rainer Müller)

Looking at the port group, the waf.python option is already configurable. Maybe the automatic build dependency on the chosen python version could be handled better. But what else would be required here?

comment:4 Changed 4 years ago by i0ntempest

Ran in to this while trying to fix #61042. I couldn't find a way to change waf.python, nor did I find any documentation about it.

Last edited 4 years ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

comment:5 Changed 4 years ago by ryandesign (Ryan Carsten Schmidt)

Rainer, it isn't configurable. That is, a maintainer could certainly change the value of waf.python in their portfile but that would have no effect on the configure.cmd and build.cmd that the portgroup already sets (the portgroup would need to use defaults for configure.cmd and build.cmd instead), and as you say the python dependency is not handled in a configurable way either. I'll see what I can do to improve the situation. I'll try to introduce a python version variable.

comment:6 Changed 4 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: ryandesign added

Changed 4 years ago by ryandesign (Ryan Carsten Schmidt)

Attachment: waf.diff added

proposal 1

comment:7 Changed 4 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: i0ntempest added

Try this patch. I haven't fully tested it. Let me know if the interface seems reasonable.

comment:8 Changed 4 years ago by i0ntempest

Thanks, seems good. I've modified mpv based on this, will push after you push this.

comment:9 Changed 4 years ago by ryandesign (Ryan Carsten Schmidt)

Resolution: fixed
Status: assignedclosed

In dbfd0d5394af692cbae759a31d1520634db3ab28/macports-ports (master):

waf-1.0.tcl: Make python version configurable

Closes: #57927

Note: See TracTickets for help on using tickets.