<pre style='margin:0'>
Joshua Root (jmroot) pushed a commit to branch master
in repository macports-ports.

</pre>
<p><a href="https://github.com/macports/macports-ports/commit/dc0835bc3a9f2eb3e718575e0b72388080b5e4f6">https://github.com/macports/macports-ports/commit/dc0835bc3a9f2eb3e718575e0b72388080b5e4f6</a></p>
<pre style="white-space: pre; background: #F8F8F8">The following commit(s) were added to refs/heads/master by this push:
<span style='display:block; white-space:pre;color:#404040;'>     new dc0835bc3a9 python3{7,8,9}: backport universal fix from python310
</span>dc0835bc3a9 is described below

<span style='display:block; white-space:pre;color:#808000;'>commit dc0835bc3a9f2eb3e718575e0b72388080b5e4f6
</span>Author: Joshua Root <jmr@macports.org>
AuthorDate: Tue May 10 20:32:56 2022 +1000

<span style='display:block; white-space:pre;color:#404040;'>    python3{7,8,9}: backport universal fix from python310
</span><span style='display:block; white-space:pre;color:#404040;'>    
</span><span style='display:block; white-space:pre;color:#404040;'>    See: https://trac.macports.org/ticket/63782
</span>---
 lang/python310/Portfile       | 37 ++++++++++++++++++------------------
 lang/python311-devel/Portfile |  2 +-
 lang/python37/Portfile        | 44 +++++++++++++++++++++++--------------------
 lang/python38/Portfile        | 44 +++++++++++++++++++++++--------------------
 lang/python39/Portfile        | 42 +++++++++++++++++++++--------------------
 5 files changed, 90 insertions(+), 79 deletions(-)

<span style='display:block; white-space:pre;color:#808080;'>diff --git a/lang/python310/Portfile b/lang/python310/Portfile
</span><span style='display:block; white-space:pre;color:#808080;'>index 3fb2e48d705..e1f770f3b89 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/lang/python310/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/lang/python310/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -124,16 +124,7 @@ platform darwin {
</span>         ln -s ${framewdir}/lib/pkgconfig/python-${branch}.pc ${destroot}${prefix}/lib/pkgconfig/
         ln -s ${framewdir}/lib/pkgconfig/python-${branch}-embed.pc ${destroot}${prefix}/lib/pkgconfig/
 
<span style='display:block; white-space:pre;background:#ffe0e0;'>-        # Also make the sysconfig changes in the Makefile
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-        reinplace {s|^\(LINKFORSHARED=\).*$|\1 -L$(LIBPL) -lpython$(VERSION)$(ABIFLAGS) $(LIBS) $(SYSLIBS)|} \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-            ${destroot}${framewdir}/lib/python${branch}/${confdir}/Makefile
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-        reinplace -E {s|-arch [a-z0-9_]+||g} \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-           ${destroot}${framewdir}/lib/python${branch}/${confdir}/Makefile
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-        reinplace "s|-lintl||" \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-           ${destroot}${framewdir}/lib/python${branch}/${confdir}/Makefile
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        set libdir ${destroot}${framewdir}/lib/python${branch}
</span>         # Without this, LINKFORSHARED is set to
         # ... $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)
         # (this becomes Python.framework/Versions/3.10/Python) which doesn't
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -143,23 +134,33 @@ platform darwin {
</span>         set lfs_pattern {^([[:space:]]*'LINKFORSHARED':).*}
         set lfs_replacement "\\1 '-L${framewdir}/lib/python${branch}/${confdir} -lpython${branch} -ldl -framework CoreFoundation',"
         reinplace -E s|${lfs_pattern}|${lfs_replacement}| \
<span style='display:block; white-space:pre;background:#ffe0e0;'>-            ${destroot}${framewdir}/lib/python${branch}/_sysconfigdata__darwin_darwin.py
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+            ${libdir}/_sysconfigdata__darwin_darwin.py
</span> 
         # remove -arch flags from the config
         reinplace -E {s|-arch [a-z0-9_]+||g} \
<span style='display:block; white-space:pre;background:#ffe0e0;'>-            ${destroot}${framewdir}/lib/python${branch}/_sysconfigdata__darwin_darwin.py
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+            ${libdir}/_sysconfigdata__darwin_darwin.py
</span> 
         # also remove gettext overlinking
         reinplace "s|-lintl ||" \
<span style='display:block; white-space:pre;background:#ffe0e0;'>-            ${destroot}${framewdir}/lib/python${branch}/_sysconfigdata__darwin_darwin.py
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+            ${libdir}/_sysconfigdata__darwin_darwin.py
</span> 
<span style='display:block; white-space:pre;background:#e0ffe0;'>+        # recompile the modified file
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        set python_for_build python.exe
</span>         # executable differs depending on filesystem case sensitivity
<span style='display:block; white-space:pre;background:#ffe0e0;'>-        foreach p {python.exe python} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-            if {[file exists ${worksrcpath}/${p}]} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-                set python_for_build $p
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-            }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        if {![file exists ${worksrcpath}/${python_for_build}]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+            set python_for_build python
</span>         }
<span style='display:block; white-space:pre;background:#ffe0e0;'>-        system -W ${worksrcpath} "env DYLD_FRAMEWORK_PATH=. ./${python_for_build} -E -m compileall -d [shellescape ${framewdir}/lib/python${branch}] -o 0 -o 1 -o 2 [shellescape ${destroot}${framewdir}/lib/python${branch}/_sysconfigdata__darwin_darwin.py]"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        system -W ${worksrcpath} "env DYLD_FRAMEWORK_PATH=. ./${python_for_build} -E -m compileall -d [shellescape ${framewdir}/lib/python${branch}] -o 0 -o 1 -o 2 [shellescape ${libdir}/_sysconfigdata__darwin_darwin.py]"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        # Also make the sysconfig changes in the Makefile
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        reinplace {s|^\(LINKFORSHARED=\).*$|\1 -L$(LIBPL) -lpython$(VERSION)$(ABIFLAGS) $(LIBS) $(SYSLIBS)|} \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+            ${libdir}/${confdir}/Makefile
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        reinplace -E {s|-arch [a-z0-9_]+||g} \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+           ${libdir}/${confdir}/Makefile
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        reinplace "s|-lintl||" \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+           ${libdir}/${confdir}/Makefile
</span>     }
 }
 
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/lang/python311-devel/Portfile b/lang/python311-devel/Portfile
</span><span style='display:block; white-space:pre;color:#808080;'>index ac0e54e312b..2d515bbefdf 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/lang/python311-devel/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/lang/python311-devel/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -149,7 +149,7 @@ platform darwin {
</span>         if {![file exists ${worksrcpath}/${python_for_build}]} {
             set python_for_build python
         }
<span style='display:block; white-space:pre;background:#ffe0e0;'>-        system -W ${worksrcpath} "env DYLD_FRAMEWORK_PATH=. ./${python_for_build} -E -m compileall -d [shellescape ${framewdir}/lib/python${branch}] -o 0 -o 1 -o 2 [shellescape ${destroot}${framewdir}/lib/python${branch}/_sysconfigdata__darwin_darwin.py]"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        system -W ${worksrcpath} "env DYLD_FRAMEWORK_PATH=. ./${python_for_build} -E -m compileall -d [shellescape ${framewdir}/lib/python${branch}] -o 0 -o 1 -o 2 [shellescape ${libdir}/_sysconfigdata__darwin_darwin.py]"
</span> 
         # Also make the sysconfig changes in the Makefile
         reinplace {s|^\(LINKFORSHARED=\).*$|\1 -L$(LIBPL) -lpython$(VERSION)$(ABIFLAGS) $(LIBS) $(SYSLIBS)|} \
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/lang/python37/Portfile b/lang/python37/Portfile
</span><span style='display:block; white-space:pre;color:#808080;'>index 007fc4b5fe1..c4458c275bc 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/lang/python37/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/lang/python37/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -8,6 +8,7 @@ name                python37
</span> 
 # Remember to keep py37-tkinter and py37-gdbm's versions sync'd with this
 version             3.7.13
<span style='display:block; white-space:pre;background:#e0ffe0;'>+revision            1
</span> 
 set branch          [join [lrange [split ${version} .] 0 1] .]
 categories          lang
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -111,11 +112,16 @@ platform darwin {
</span>         }
     }
 
<span style='display:block; white-space:pre;background:#ffe0e0;'>-    post-build {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-        set buildlibdir [lindex [glob -directory ${worksrcpath}/build lib.*-*-*-${branch}] 0]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-        # preserve mtime of sysconfig data file to avoid rebuilding things after changing it
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-        set oldmtime [file mtime ${buildlibdir}/_sysconfigdata_m_darwin_darwin.py]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+    post-destroot {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        foreach dir { Headers Resources Python Versions/Current } {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+            file delete ${destroot}${framewpath}/${dir}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        }
</span> 
<span style='display:block; white-space:pre;background:#e0ffe0;'>+        ln -s ${framewdir}/share/man/man1/python${branch}.1 ${destroot}${prefix}/share/man/man1/
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        ln -s ${framewdir}/lib/pkgconfig/python-${branch}.pc ${destroot}${prefix}/lib/pkgconfig/
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        ln -s ${framewdir}/lib/pkgconfig/python-${branch}.pc ${destroot}${prefix}/lib/pkgconfig/python-${branch}m.pc
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        set libdir ${destroot}${framewdir}/lib/python${branch}
</span>         # Without this, LINKFORSHARED is set to
         # ... $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)
         # (this becomes Python.framework/Versions/3.7/Python) which doesn't
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -125,37 +131,35 @@ platform darwin {
</span>         set lfs_pattern {^([[:space:]]*'LINKFORSHARED':).*}
         set lfs_replacement "\\1 '-L${framewdir}/lib/python${branch}/${confdir} -lpython${branch}m -ldl -framework CoreFoundation',"
         reinplace -E s|${lfs_pattern}|${lfs_replacement}| \
<span style='display:block; white-space:pre;background:#ffe0e0;'>-            ${buildlibdir}/_sysconfigdata_m_darwin_darwin.py
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+            ${libdir}/_sysconfigdata_m_darwin_darwin.py
</span> 
         # remove -arch flags from the config
         reinplace -E {s|-arch [a-z0-9_]+||g} \
<span style='display:block; white-space:pre;background:#ffe0e0;'>-            ${buildlibdir}/_sysconfigdata_m_darwin_darwin.py
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+            ${libdir}/_sysconfigdata_m_darwin_darwin.py
</span> 
         # also remove gettext overlinking
         reinplace "s|-lintl||" \
<span style='display:block; white-space:pre;background:#ffe0e0;'>-            ${buildlibdir}/_sysconfigdata_m_darwin_darwin.py
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+            ${libdir}/_sysconfigdata_m_darwin_darwin.py
</span> 
<span style='display:block; white-space:pre;background:#ffe0e0;'>-        file mtime ${buildlibdir}/_sysconfigdata_m_darwin_darwin.py $oldmtime
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-    }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-    post-destroot {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-        foreach dir { Headers Resources Python Versions/Current } {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-            file delete ${destroot}${framewpath}/${dir}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        # recompile the modified file
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        set python_for_build python.exe
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        # executable differs depending on filesystem case sensitivity
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        if {![file exists ${worksrcpath}/${python_for_build}]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+            set python_for_build python
</span>         }
<span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-        ln -s ${framewdir}/share/man/man1/python${branch}.1 ${destroot}${prefix}/share/man/man1/
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-        ln -s ${framewdir}/lib/pkgconfig/python-${branch}.pc ${destroot}${prefix}/lib/pkgconfig/
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-        ln -s ${framewdir}/lib/pkgconfig/python-${branch}.pc ${destroot}${prefix}/lib/pkgconfig/python-${branch}m.pc
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        system -W ${worksrcpath} "env DYLD_FRAMEWORK_PATH=. ./${python_for_build} -E -m compileall -d [shellescape ${framewdir}/lib/python${branch}] [shellescape ${libdir}/_sysconfigdata_m_darwin_darwin.py]"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        system -W ${worksrcpath} "env DYLD_FRAMEWORK_PATH=. ./${python_for_build} -E -O -m compileall -d [shellescape ${framewdir}/lib/python${branch}] [shellescape ${libdir}/_sysconfigdata_m_darwin_darwin.py]"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        system -W ${worksrcpath} "env DYLD_FRAMEWORK_PATH=. ./${python_for_build} -E -OO -m compileall -d [shellescape ${framewdir}/lib/python${branch}] [shellescape ${libdir}/_sysconfigdata_m_darwin_darwin.py]"
</span> 
         # Also make the sysconfig changes in the Makefile
         reinplace {s|^\(LINKFORSHARED=\).*$|\1 -L$(LIBPL) -lpython$(VERSION)$(ABIFLAGS) $(LIBS) $(SYSLIBS)|} \
<span style='display:block; white-space:pre;background:#ffe0e0;'>-            ${destroot}${framewdir}/lib/python${branch}/${confdir}/Makefile
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+            ${libdir}/${confdir}/Makefile
</span> 
         reinplace -E {s|-arch [a-z0-9_]+||g} \
<span style='display:block; white-space:pre;background:#ffe0e0;'>-           ${destroot}${framewdir}/lib/python${branch}/${confdir}/Makefile
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+           ${libdir}/${confdir}/Makefile
</span> 
         reinplace "s|-lintl||" \
<span style='display:block; white-space:pre;background:#ffe0e0;'>-           ${destroot}${framewdir}/lib/python${branch}/${confdir}/Makefile
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+           ${libdir}/${confdir}/Makefile
</span>     }
 }
 
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/lang/python38/Portfile b/lang/python38/Portfile
</span><span style='display:block; white-space:pre;color:#808080;'>index 296c71d632d..67d2c2cb423 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/lang/python38/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/lang/python38/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -8,6 +8,7 @@ name                python38
</span> epoch               1
 # Remember to keep py38-tkinter, py38-htmldocs, and py38-gdbm's versions sync'd with this
 version             3.8.13
<span style='display:block; white-space:pre;background:#e0ffe0;'>+revision            1
</span> 
 set major           [lindex [split $version .] 0]
 set branch          [join [lrange [split ${version} .] 0 1] .]
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -118,11 +119,16 @@ platform darwin {
</span>         }
     }
 
<span style='display:block; white-space:pre;background:#ffe0e0;'>-    post-build {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-        set buildlibdir [lindex [glob -directory ${worksrcpath}/build lib.*-*-*-${branch}] 0]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-        # preserve mtime of sysconfig data file to avoid rebuilding things after changing it
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-        set oldmtime [file mtime ${buildlibdir}/_sysconfigdata__darwin_darwin.py]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+    post-destroot {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        foreach dir { Headers Resources Python Versions/Current } {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+            file delete ${destroot}${framewpath}/${dir}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        }
</span> 
<span style='display:block; white-space:pre;background:#e0ffe0;'>+        ln -s ${framewdir}/share/man/man1/python${branch}.1 ${destroot}${prefix}/share/man/man1/
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        ln -s ${framewdir}/lib/pkgconfig/python-${branch}.pc ${destroot}${prefix}/lib/pkgconfig/
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        ln -s ${framewdir}/lib/pkgconfig/python-${branch}-embed.pc ${destroot}${prefix}/lib/pkgconfig/
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        set libdir ${destroot}${framewdir}/lib/python${branch}
</span>         # Without this, LINKFORSHARED is set to
         # ... $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)
         # (this becomes Python.framework/Versions/3.8/Python) which doesn't
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -132,37 +138,35 @@ platform darwin {
</span>         set lfs_pattern {^([[:space:]]*'LINKFORSHARED':).*}
         set lfs_replacement "\\1 '-L${framewdir}/lib/python${branch}/${confdir} -lpython${branch} -ldl -framework CoreFoundation',"
         reinplace -E s|${lfs_pattern}|${lfs_replacement}| \
<span style='display:block; white-space:pre;background:#ffe0e0;'>-            ${buildlibdir}/_sysconfigdata__darwin_darwin.py
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+            ${libdir}/_sysconfigdata__darwin_darwin.py
</span> 
         # remove -arch flags from the config
         reinplace -E {s|-arch [a-z0-9_]+||g} \
<span style='display:block; white-space:pre;background:#ffe0e0;'>-            ${buildlibdir}/_sysconfigdata__darwin_darwin.py
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+            ${libdir}/_sysconfigdata__darwin_darwin.py
</span> 
         # also remove gettext overlinking
         reinplace "s|-lintl||" \
<span style='display:block; white-space:pre;background:#ffe0e0;'>-            ${buildlibdir}/_sysconfigdata__darwin_darwin.py
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+            ${libdir}/_sysconfigdata__darwin_darwin.py
</span> 
<span style='display:block; white-space:pre;background:#ffe0e0;'>-        file mtime ${buildlibdir}/_sysconfigdata__darwin_darwin.py $oldmtime
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-    }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-    post-destroot {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-        foreach dir { Headers Resources Python Versions/Current } {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-            file delete ${destroot}${framewpath}/${dir}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        # recompile the modified file
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        set python_for_build python.exe
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        # executable differs depending on filesystem case sensitivity
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        if {![file exists ${worksrcpath}/${python_for_build}]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+            set python_for_build python
</span>         }
<span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-        ln -s ${framewdir}/share/man/man1/python${branch}.1 ${destroot}${prefix}/share/man/man1/
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-        ln -s ${framewdir}/lib/pkgconfig/python-${branch}.pc ${destroot}${prefix}/lib/pkgconfig/
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-        ln -s ${framewdir}/lib/pkgconfig/python-${branch}-embed.pc ${destroot}${prefix}/lib/pkgconfig/
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        system -W ${worksrcpath} "env DYLD_FRAMEWORK_PATH=. ./${python_for_build} -E -m compileall -d [shellescape ${framewdir}/lib/python${branch}] [shellescape ${libdir}/_sysconfigdata__darwin_darwin.py]"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        system -W ${worksrcpath} "env DYLD_FRAMEWORK_PATH=. ./${python_for_build} -E -O -m compileall -d [shellescape ${framewdir}/lib/python${branch}] [shellescape ${libdir}/_sysconfigdata__darwin_darwin.py]"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        system -W ${worksrcpath} "env DYLD_FRAMEWORK_PATH=. ./${python_for_build} -E -OO -m compileall -d [shellescape ${framewdir}/lib/python${branch}] [shellescape ${libdir}/_sysconfigdata__darwin_darwin.py]"
</span> 
         # Also make the sysconfig changes in the Makefile
         reinplace {s|^\(LINKFORSHARED=\).*$|\1 -L$(LIBPL) -lpython$(VERSION)$(ABIFLAGS) $(LIBS) $(SYSLIBS)|} \
<span style='display:block; white-space:pre;background:#ffe0e0;'>-            ${destroot}${framewdir}/lib/python${branch}/${confdir}/Makefile
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+            ${libdir}/${confdir}/Makefile
</span> 
         reinplace -E {s|-arch [a-z0-9_]+||g} \
<span style='display:block; white-space:pre;background:#ffe0e0;'>-           ${destroot}${framewdir}/lib/python${branch}/${confdir}/Makefile
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+           ${libdir}/${confdir}/Makefile
</span> 
         reinplace "s|-lintl||" \
<span style='display:block; white-space:pre;background:#ffe0e0;'>-           ${destroot}${framewdir}/lib/python${branch}/${confdir}/Makefile
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+           ${libdir}/${confdir}/Makefile
</span>     }
 }
 
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/lang/python39/Portfile b/lang/python39/Portfile
</span><span style='display:block; white-space:pre;color:#808080;'>index 268e8961182..ed97cd9c7ee 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/lang/python39/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/lang/python39/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -7,6 +7,7 @@ name                python39
</span> 
 # Remember to keep py39-tkinter and py39-gdbm's versions sync'd with this
 version             3.9.12
<span style='display:block; white-space:pre;background:#e0ffe0;'>+revision            1
</span> 
 set branch          [join [lrange [split ${version} .] 0 1] .]
 categories          lang
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -113,11 +114,16 @@ platform darwin {
</span>         }
     }
 
<span style='display:block; white-space:pre;background:#ffe0e0;'>-    post-build {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-        set buildlibdir [lindex [glob -directory ${worksrcpath}/build lib.*-*-*-${branch}] 0]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-        # preserve mtime of sysconfig data file to avoid rebuilding things after changing it
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-        set oldmtime [file mtime ${buildlibdir}/_sysconfigdata__darwin_darwin.py]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+    post-destroot {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        foreach dir { Headers Resources Python Versions/Current } {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+            file delete ${destroot}${framewpath}/${dir}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        }
</span> 
<span style='display:block; white-space:pre;background:#e0ffe0;'>+        ln -s ${framewdir}/share/man/man1/python${branch}.1 ${destroot}${prefix}/share/man/man1/
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        ln -s ${framewdir}/lib/pkgconfig/python-${branch}.pc ${destroot}${prefix}/lib/pkgconfig/
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        ln -s ${framewdir}/lib/pkgconfig/python-${branch}-embed.pc ${destroot}${prefix}/lib/pkgconfig/
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        set libdir ${destroot}${framewdir}/lib/python${branch}
</span>         # Without this, LINKFORSHARED is set to
         # ... $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)
         # (this becomes Python.framework/Versions/3.9/Python) which doesn't
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -127,37 +133,33 @@ platform darwin {
</span>         set lfs_pattern {^([[:space:]]*'LINKFORSHARED':).*}
         set lfs_replacement "\\1 '-L${framewdir}/lib/python${branch}/${confdir} -lpython${branch} -ldl -framework CoreFoundation',"
         reinplace -E s|${lfs_pattern}|${lfs_replacement}| \
<span style='display:block; white-space:pre;background:#ffe0e0;'>-            ${buildlibdir}/_sysconfigdata__darwin_darwin.py
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+            ${libdir}/_sysconfigdata__darwin_darwin.py
</span> 
         # remove -arch flags from the config
         reinplace -E {s|-arch [a-z0-9_]+||g} \
<span style='display:block; white-space:pre;background:#ffe0e0;'>-            ${buildlibdir}/_sysconfigdata__darwin_darwin.py
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+            ${libdir}/_sysconfigdata__darwin_darwin.py
</span> 
         # also remove gettext overlinking
         reinplace "s|-lintl||" \
<span style='display:block; white-space:pre;background:#ffe0e0;'>-            ${buildlibdir}/_sysconfigdata__darwin_darwin.py
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+            ${libdir}/_sysconfigdata__darwin_darwin.py
</span> 
<span style='display:block; white-space:pre;background:#ffe0e0;'>-        file mtime ${buildlibdir}/_sysconfigdata__darwin_darwin.py $oldmtime
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-    }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-    post-destroot {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-        foreach dir { Headers Resources Python Versions/Current } {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-            file delete ${destroot}${framewpath}/${dir}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        # recompile the modified file
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        set python_for_build python.exe
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        # executable differs depending on filesystem case sensitivity
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        if {![file exists ${worksrcpath}/${python_for_build}]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+            set python_for_build python
</span>         }
<span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-        ln -s ${framewdir}/share/man/man1/python${branch}.1 ${destroot}${prefix}/share/man/man1/
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-        ln -s ${framewdir}/lib/pkgconfig/python-${branch}.pc ${destroot}${prefix}/lib/pkgconfig/
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-        ln -s ${framewdir}/lib/pkgconfig/python-${branch}-embed.pc ${destroot}${prefix}/lib/pkgconfig/
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        system -W ${worksrcpath} "env DYLD_FRAMEWORK_PATH=. ./${python_for_build} -E -m compileall -d [shellescape ${framewdir}/lib/python${branch}] -o 0 -o 1 -o 2 [shellescape ${libdir}/_sysconfigdata__darwin_darwin.py]"
</span> 
         # Also make the sysconfig changes in the Makefile
         reinplace {s|^\(LINKFORSHARED=\).*$|\1 -L$(LIBPL) -lpython$(VERSION)$(ABIFLAGS) $(LIBS) $(SYSLIBS)|} \
<span style='display:block; white-space:pre;background:#ffe0e0;'>-            ${destroot}${framewdir}/lib/python${branch}/${confdir}/Makefile
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+            ${libdir}/${confdir}/Makefile
</span> 
         reinplace -E {s|-arch [a-z0-9_]+||g} \
<span style='display:block; white-space:pre;background:#ffe0e0;'>-           ${destroot}${framewdir}/lib/python${branch}/${confdir}/Makefile
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+           ${libdir}/${confdir}/Makefile
</span> 
         reinplace "s|-lintl||" \
<span style='display:block; white-space:pre;background:#ffe0e0;'>-           ${destroot}${framewdir}/lib/python${branch}/${confdir}/Makefile
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+           ${libdir}/${confdir}/Makefile
</span>     }
 }
 
</pre><pre style='margin:0'>

</pre>