virt-viewer: resolve python3 via meson native binaries

Use meson.native.binaries to point find_program at the versioned
python3 instead of patching meson.build, and keep the reinplace only
for upstream's run_command() calls that bypass the found program.

See: https://trac.macports.org/ticket/71963
This commit is contained in:
Dan R. K. Ports
2026-07-11 23:42:13 -07:00
parent d21426466a
commit 6cb68ae083
+7 -4
View File
@@ -73,12 +73,15 @@ variant bash_completion {
default_variants +vte +bash_completion
# meson.build invokes the unversioned "python3", which MacPorts provides only
# via "port select"; use the versioned interpreter directly.
# meson.build looks up the unversioned "python3", which MacPorts provides only
# via "port select"; point find_program at the versioned interpreter. The
# reinplace works around upstream calling run_command() with the "python3"
# string instead of the program found above.
# https://trac.macports.org/ticket/71963
meson.native.binaries-append \
python3=${prefix}/bin/python${py_branch}
post-patch {
reinplace "s|find_program('python3', required: true)|find_program('${prefix}/bin/python${py_branch}', required: true)|" ${worksrcpath}/meson.build
reinplace "s|'python3', '-c'|'${prefix}/bin/python${py_branch}', '-c'|g" ${worksrcpath}/meson.build
reinplace "s|'python3', '-c'|python3, '-c'|g" ${worksrcpath}/meson.build
}
#