<pre style='margin:0'>
Ken (kencu) pushed a commit to branch master
in repository macports-ports.
</pre>
<p><a href="https://github.com/macports/macports-ports/commit/17a67bbbeb98bfbc27d006d41c699d5c84a489dc">https://github.com/macports/macports-ports/commit/17a67bbbeb98bfbc27d006d41c699d5c84a489dc</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 17a67bb python38: fix build on older systems
</span>17a67bb is described below
<span style='display:block; white-space:pre;color:#808000;'>commit 17a67bbbeb98bfbc27d006d41c699d5c84a489dc
</span>Author: Ken Cunningham <kencu@macports.org>
AuthorDate: Sun Mar 1 15:36:09 2020 -0800
<span style='display:block; white-space:pre;color:#404040;'> python38: fix build on older systems
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> there is no copyfile on Tiger
</span><span style='display:block; white-space:pre;color:#404040;'> work around lack of pthread_threadid_np on < 10.6
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> closes: https://trac.macports.org/ticket/59827
</span><span style='display:block; white-space:pre;color:#404040;'> closes: https://trac.macports.org/ticket/59772
</span>---
lang/python38/Portfile | 4 +-
.../python38/files/patch-no-copyfile-on-Tiger.diff | 68 ++++++++++++++++++++++
.../files/patch-threadid-older-systems.diff | 22 +++++++
3 files changed, 93 insertions(+), 1 deletion(-)
<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 f5559a8..f2194f1 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;'>@@ -37,7 +37,9 @@ patchfiles patch-setup.py.diff \
</span> patch-Lib-ctypes-macholib-dyld.py.diff \
patch-libedit.diff \
patch-configure-xcode4bug.diff \
<span style='display:block; white-space:pre;background:#ffe0e0;'>- patch-_osx_support.py.diff
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ patch-_osx_support.py.diff \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ patch-no-copyfile-on-Tiger.diff \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ patch-threadid-older-systems.diff
</span>
depends_build port:pkgconfig
depends_lib port:bzip2 \
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/lang/python38/files/patch-no-copyfile-on-Tiger.diff b/lang/python38/files/patch-no-copyfile-on-Tiger.diff
</span>new file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 0000000..c3ce5a2
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/lang/python38/files/patch-no-copyfile-on-Tiger.diff
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -0,0 +1,68 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+posix.copyfile does not exist on Tiger.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Python 3.8's posix._fcopyfile implementation unconditionally uses <copyfile.h>,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+which only exists on Leopard ane newer. This patch removes posix._fcopyfile
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+on Tiger - this is okay because the rest of the stdlib uses posix._fcopyfile
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+only conditionally after checking that the function exists
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+(non-Apple systems don't have posix._fcopyfile either).
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+thanks to @dgelessus
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+https://github.com/macports/macports-ports/pull/5987
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- Lib/test/test_shutil.py.orig
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ Lib/test/test_shutil.py
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -2393,7 +2393,7 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ shutil._USE_CP_SENDFILE = True
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-@unittest.skipIf(not MACOS, 'macOS only')
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++@unittest.skipIf(not MACOS or not hasattr(posix, "_fcopyfile"), 'macOS with posix._fcopyfile only')
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ class TestZeroCopyMACOS(_ZeroCopyFileTest, unittest.TestCase):
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ PATCHPOINT = "posix._fcopyfile"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git Modules/clinic/posixmodule.c.h Modules/clinic/posixmodule.c.h
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index c0d1d4d..7052678 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- Modules/clinic/posixmodule.c.h
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ Modules/clinic/posixmodule.c.h
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -4975,7 +4975,7 @@ exit:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return return_value;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if defined(__APPLE__)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if defined(__APPLE__) && MACOSX_VERSION_MAX_ALLOWED >= 1050
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ PyDoc_STRVAR(os__fcopyfile__doc__,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ "_fcopyfile($module, infd, outfd, flags, /)\n"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git Modules/posixmodule.c Modules/posixmodule.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index b09204d..78b2909 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- Modules/posixmodule.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ Modules/posixmodule.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -109,7 +109,7 @@ corresponding Unix manual entries for more information on calls.");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #include <sys/sendfile.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if defined(__APPLE__)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if defined(__APPLE__) && MACOSX_VERSION_MAX_ALLOWED >= 1050
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #include <copyfile.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -9153,7 +9153,7 @@ done:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #endif /* HAVE_SENDFILE */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if defined(__APPLE__)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if defined(__APPLE__) && MACOSX_VERSION_MAX_ALLOWED >= 1050
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /*[clinic input]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ os._fcopyfile
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -14222,7 +14222,7 @@ all_ins(PyObject *m)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if defined(__APPLE__)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if defined(__APPLE__) && MACOSX_VERSION_MAX_ALLOWED >= 1050
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (PyModule_AddIntConstant(m, "_COPYFILE_DATA", COPYFILE_DATA)) return -1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;color:#808080;'>diff --git a/lang/python38/files/patch-threadid-older-systems.diff b/lang/python38/files/patch-threadid-older-systems.diff
</span>new file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 0000000..ab992b2
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/lang/python38/files/patch-threadid-older-systems.diff
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -0,0 +1,22 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Older systems (< 10.6) don't have the kernel support for pthread_threadid_np.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+But they do have pthread_mach_thread_np, which is a similar function, if not quite
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+as ideal in scope. kencu@macports.org
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git Python/thread_pthread.h Python/thread_pthread.h
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index 5678b05..5cfdd17 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- Python/thread_pthread.h
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ Python/thread_pthread.h
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -325,9 +327,12 @@ PyThread_get_thread_native_id(void)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (!initialized)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ PyThread_init_thread();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#ifdef __APPLE__
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if defined(__APPLE__) && MACOSX_VERSION_MAX_ALLOWED >= 1060
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ uint64_t native_id;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ (void) pthread_threadid_np(NULL, &native_id);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#elif defined(__APPLE__) && MACOSX_VERSION_MAX_ALLOWED < 1060
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ uint64_t native_id;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ native_id = pthread_mach_thread_np(pthread_self());
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #elif defined(__linux__)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ pid_t native_id;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ native_id = syscall(SYS_gettid);
</span></pre><pre style='margin:0'>
</pre>