You've already forked macports-ports
mirror of
https://github.com/macports/macports-ports.git
synced 2026-07-12 18:20:25 -07:00
Remove Tiger workarounds from my ports
This commit is contained in:
@@ -2,7 +2,6 @@
|
||||
|
||||
PortSystem 1.0
|
||||
PortGroup github 1.0
|
||||
PortGroup xcodeversion 1.0
|
||||
|
||||
name libsdl12
|
||||
github.setup libsdl-org SDL-1.2 18bc4d1a1d27b0cf5b06be9322c65ca88282b1ee
|
||||
@@ -27,20 +26,11 @@ github.tarball_from archive
|
||||
checksums rmd160 499e7e95862dd0d029fdef2a98685fc4f0bc8637 \
|
||||
sha256 f5fa17102e77bffd9e644f6c4cf1c9a91dc586f57b1402f2c95c3f972687e92b
|
||||
|
||||
minimum_xcodeversions {8 2.4.1}
|
||||
|
||||
configure.args --disable-esd \
|
||||
--disable-nasm \
|
||||
--disable-pulseaudio \
|
||||
--without-x
|
||||
|
||||
platform darwin 8 powerpc {
|
||||
if {![catch {sysctl hw.vectorunit} result] && $result > 0} {
|
||||
# Work around buggy header. https://trac.macports.org/ticket/50032
|
||||
configure.cflags-append -faltivec
|
||||
}
|
||||
}
|
||||
|
||||
variant x11 {
|
||||
configure.args-delete --without-x
|
||||
configure.args-append --x-includes=${prefix}/include \
|
||||
|
||||
@@ -26,11 +26,6 @@ checksums md5 3579164bccaef09e36c0af7f4fd5c7c7 \
|
||||
patchfiles config_Makefile.darwin.patch
|
||||
patchfiles-append SYSTEM.patch
|
||||
|
||||
platform darwin 8 {
|
||||
# Undefined symbols: CGLReleasePixelFormat, CGLReleaseContext
|
||||
patchfiles-append patch-glew-tiger.diff
|
||||
}
|
||||
|
||||
post-patch {
|
||||
reinplace "s:/usr/X11R6:${prefix}:g" ${worksrcpath}/config/Makefile.darwin
|
||||
}
|
||||
|
||||
@@ -1,60 +0,0 @@
|
||||
--- auto/src/glewinfo_tail.c.orig
|
||||
+++ auto/src/glewinfo_tail.c
|
||||
@@ -448,7 +448,7 @@ GLboolean glewCreateContext (struct createParams *params)
|
||||
if (error) return GL_TRUE;
|
||||
error = CGLCreateContext(pf, NULL, &ctx);
|
||||
if (error) return GL_TRUE;
|
||||
- CGLReleasePixelFormat(pf);
|
||||
+ CGLDestroyPixelFormat(pf);
|
||||
octx = CGLGetCurrentContext();
|
||||
error = CGLSetCurrentContext(ctx);
|
||||
if (error) return GL_TRUE;
|
||||
@@ -462,7 +462,7 @@ GLboolean glewCreateContext (struct createParams *params)
|
||||
void glewDestroyContext ()
|
||||
{
|
||||
CGLSetCurrentContext(octx);
|
||||
- CGLReleaseContext(ctx);
|
||||
+ CGLDestroyContext(ctx);
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------------ */
|
||||
--- src/glewinfo.c.orig
|
||||
+++ src/glewinfo.c
|
||||
@@ -16731,7 +16731,7 @@ GLboolean glewCreateContext (struct createParams *params)
|
||||
if (error) return GL_TRUE;
|
||||
error = CGLCreateContext(pf, NULL, &ctx);
|
||||
if (error) return GL_TRUE;
|
||||
- CGLReleasePixelFormat(pf);
|
||||
+ CGLDestroyPixelFormat(pf);
|
||||
octx = CGLGetCurrentContext();
|
||||
error = CGLSetCurrentContext(ctx);
|
||||
if (error) return GL_TRUE;
|
||||
@@ -16745,7 +16745,7 @@ GLboolean glewCreateContext (struct createParams *params)
|
||||
void glewDestroyContext ()
|
||||
{
|
||||
CGLSetCurrentContext(octx);
|
||||
- CGLReleaseContext(ctx);
|
||||
+ CGLDestroyContext(ctx);
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------------ */
|
||||
--- src/visualinfo.c.orig
|
||||
+++ src/visualinfo.c
|
||||
@@ -1154,7 +1154,7 @@ GLboolean CreateContext (GLContext* ctx)
|
||||
if (error) return GL_TRUE;
|
||||
error = CGLCreateContext(pf, NULL, &ctx->ctx);
|
||||
if (error) return GL_TRUE;
|
||||
- CGLReleasePixelFormat(pf);
|
||||
+ CGLDestroyPixelFormat(pf);
|
||||
ctx->octx = CGLGetCurrentContext();
|
||||
error = CGLSetCurrentContext(ctx->ctx);
|
||||
if (error) return GL_TRUE;
|
||||
@@ -1165,7 +1165,7 @@ void DestroyContext (GLContext* ctx)
|
||||
{
|
||||
if (NULL == ctx) return;
|
||||
CGLSetCurrentContext(ctx->octx);
|
||||
- if (NULL != ctx->ctx) CGLReleaseContext(ctx->ctx);
|
||||
+ if (NULL != ctx->ctx) CGLDestroyContext(ctx->ctx);
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------------ */
|
||||
@@ -174,11 +174,9 @@ variant universal {
|
||||
reinplace \
|
||||
"s|UNIVERSAL_ARCH_FLAGS=\".*\"|UNIVERSAL_ARCH_FLAGS=\"${universal_arch_flags}\"|" \
|
||||
${worksrcpath}/configure
|
||||
if {${os.major} >= 9} {
|
||||
reinplace \
|
||||
"s|ARCH_RUN_32BIT=\".*\"|ARCH_RUN_32BIT=\"arch ${arch_run_32bit}\"|" \
|
||||
${worksrcpath}/configure
|
||||
}
|
||||
reinplace \
|
||||
"s|ARCH_RUN_32BIT=\".*\"|ARCH_RUN_32BIT=\"arch ${arch_run_32bit}\"|" \
|
||||
${worksrcpath}/configure
|
||||
}
|
||||
if {${configure.sdkroot} != ""} {
|
||||
configure.args-append --enable-universalsdk=${configure.sdkroot}
|
||||
|
||||
@@ -99,11 +99,6 @@ subport ${name}-bootstrap {
|
||||
# sterilize PATH
|
||||
configure.env-append PATH=/usr/bin:/bin:/usr/sbin:/sbin
|
||||
build.env-append PATH=/usr/bin:/bin:/usr/sbin:/sbin
|
||||
|
||||
if {${os.platform} eq "darwin" && ${os.major} < 9} {
|
||||
notes-append "${name}-bootstrap on Tiger cannot build these modules, which can be\
|
||||
built by the full ${name} port: gdbm, hashlib, locale, sqlite3, ssl"
|
||||
}
|
||||
}
|
||||
# Also needed by later clangs.
|
||||
if {${os.platform} eq "darwin" && ${os.major} < 11 && ${cxx_stdlib} eq "libc++"} {
|
||||
@@ -113,8 +108,8 @@ if {${os.platform} eq "darwin" && ${os.major} < 11 && ${cxx_stdlib} eq "libc++"}
|
||||
configure.args-append \
|
||||
--enable-framework=${frameworks_dir} \
|
||||
--enable-ipv6
|
||||
if {${subport} eq ${name} || (${os.platform} eq "darwin" && ${os.major} >= 9)} {
|
||||
# Tiger has no system libexpat or libffi, so we can't use them for the bootstrap port
|
||||
if {${subport} eq ${name} || ${os.platform} eq "darwin"} {
|
||||
# Non-darwin may not have a system libexpat or libffi, so we can't use them for the bootstrap port
|
||||
configure.args-append \
|
||||
--with-system-expat \
|
||||
--with-system-ffi
|
||||
|
||||
@@ -36,9 +36,8 @@ patchfiles patch-setup.py.diff \
|
||||
dangling-symlinks.patch
|
||||
|
||||
if {${os.platform} eq "darwin" && ${os.major} <= 10} {
|
||||
# work around no copyfile and/or pthread_threadid_np on older systems
|
||||
patchfiles-append patch-no-copyfile-on-Tiger.diff \
|
||||
patch-threadid-older-systems.diff
|
||||
# work around no pthread_threadid_np on older systems
|
||||
patchfiles-append patch-threadid-older-systems.diff
|
||||
}
|
||||
|
||||
depends_build path:bin/pkg-config:pkgconfig
|
||||
@@ -100,11 +99,6 @@ destroot.target frameworkinstall maninstall
|
||||
platform darwin {
|
||||
set abiflags {}
|
||||
|
||||
if {${os.major} < 9} {
|
||||
# Fixes the return type of `ttyname_r`
|
||||
configure.cppflags-append -D__DARWIN_UNIX03=1
|
||||
}
|
||||
|
||||
post-configure {
|
||||
# poll() misbehaves on 10.8 and older
|
||||
# See https://trac.macports.org/ticket/18376
|
||||
|
||||
@@ -1,77 +0,0 @@
|
||||
posix.copyfile does not exist on Tiger.
|
||||
|
||||
Python 3.8's posix._fcopyfile implementation unconditionally uses <copyfile.h>,
|
||||
which only exists on Leopard ane newer. This patch removes posix._fcopyfile
|
||||
on Tiger - this is okay because the rest of the stdlib uses posix._fcopyfile
|
||||
only conditionally after checking that the function exists
|
||||
(non-Apple systems don't have posix._fcopyfile either).
|
||||
|
||||
|
||||
thanks to @dgelessus
|
||||
https://github.com/macports/macports-ports/pull/5987
|
||||
|
||||
|
||||
diff --git Lib/test/test_shutil.py Lib/test/test_shutil.py
|
||||
index e56b337..fdc53e3 100644
|
||||
--- Lib/test/test_shutil.py
|
||||
+++ Lib/test/test_shutil.py
|
||||
@@ -2451,7 +2451,7 @@ class TestZeroCopySendfile(_ZeroCopyFileTest, unittest.TestCase):
|
||||
shutil._USE_CP_SENDFILE = True
|
||||
|
||||
|
||||
-@unittest.skipIf(not MACOS, 'macOS only')
|
||||
+@unittest.skipIf(not MACOS or not hasattr(posix, "_fcopyfile"), 'macOS with posix._fcopyfile only')
|
||||
class TestZeroCopyMACOS(_ZeroCopyFileTest, unittest.TestCase):
|
||||
PATCHPOINT = "posix._fcopyfile"
|
||||
|
||||
diff --git Modules/clinic/posixmodule.c.h Modules/clinic/posixmodule.c.h
|
||||
index 41baa45..3965876 100644
|
||||
--- Modules/clinic/posixmodule.c.h
|
||||
+++ Modules/clinic/posixmodule.c.h
|
||||
@@ -5505,7 +5505,7 @@ exit:
|
||||
|
||||
#endif /* defined(HAVE_SENDFILE) && !defined(__APPLE__) && !(defined(__FreeBSD__) || defined(__DragonFly__)) */
|
||||
|
||||
-#if defined(__APPLE__)
|
||||
+#if defined(__APPLE__) && MAC_OS_X_VERSION_MIN_REQUIRED >= 1050
|
||||
|
||||
PyDoc_STRVAR(os__fcopyfile__doc__,
|
||||
"_fcopyfile($module, in_fd, out_fd, flags, /)\n"
|
||||
--- Modules/posixmodule.c.orig 2021-12-07 05:23:39.000000000 +1100
|
||||
+++ Modules/posixmodule.c 2021-12-12 04:17:03.000000000 +1100
|
||||
@@ -63,6 +63,8 @@
|
||||
*/
|
||||
#if defined(__APPLE__)
|
||||
|
||||
+#include <AvailabilityMacros.h>
|
||||
+
|
||||
#if defined(__has_builtin)
|
||||
#if __has_builtin(__builtin_available)
|
||||
#define HAVE_BUILTIN_AVAILABLE 1
|
||||
@@ -231,7 +233,7 @@ corresponding Unix manual entries for mo
|
||||
# include <sys/sendfile.h>
|
||||
#endif
|
||||
|
||||
-#if defined(__APPLE__)
|
||||
+#if defined(__APPLE__) && MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
|
||||
# include <copyfile.h>
|
||||
#endif
|
||||
|
||||
@@ -9990,7 +9992,7 @@ done:
|
||||
#endif /* HAVE_SENDFILE */
|
||||
|
||||
|
||||
-#if defined(__APPLE__)
|
||||
+#if defined(__APPLE__) && MAC_OS_X_VERSION_MIN_REQUIRED >= 1050
|
||||
/*[clinic input]
|
||||
os._fcopyfile
|
||||
|
||||
@@ -15397,7 +15399,7 @@ all_ins(PyObject *m)
|
||||
if (PyModule_AddIntMacro(m, EFD_SEMAPHORE)) return -1;
|
||||
#endif
|
||||
|
||||
-#if defined(__APPLE__)
|
||||
+#if defined(__APPLE__) && MAC_OS_X_VERSION_MIN_REQUIRED >= 1050
|
||||
if (PyModule_AddIntConstant(m, "_COPYFILE_DATA", COPYFILE_DATA)) return -1;
|
||||
#endif
|
||||
|
||||
@@ -34,9 +34,8 @@ patchfiles patch-setup.py.diff \
|
||||
configure-disable-libuuid.patch
|
||||
|
||||
if {${os.platform} eq "darwin" && ${os.major} <= 10} {
|
||||
# work around no copyfile and/or pthread_threadid_np on older systems
|
||||
patchfiles-append patch-no-copyfile-on-Tiger.diff \
|
||||
patch-threadid-older-systems.diff
|
||||
# work around no pthread_threadid_np on older systems
|
||||
patchfiles-append patch-threadid-older-systems.diff
|
||||
}
|
||||
|
||||
if {${configure.build_arch} in "ppc ppc64"} {
|
||||
@@ -107,11 +106,6 @@ destroot.target frameworkinstall maninstall
|
||||
platform darwin {
|
||||
set abiflags {}
|
||||
|
||||
if {${os.major} < 9} {
|
||||
# Fixes the return type of `ttyname_r`
|
||||
configure.cppflags-append -D__DARWIN_UNIX03=1
|
||||
}
|
||||
|
||||
post-configure {
|
||||
# poll() misbehaves on 10.8 and older
|
||||
# See https://trac.macports.org/ticket/18376
|
||||
|
||||
@@ -1,77 +0,0 @@
|
||||
posix.copyfile does not exist on Tiger.
|
||||
|
||||
Python 3.8's posix._fcopyfile implementation unconditionally uses <copyfile.h>,
|
||||
which only exists on Leopard ane newer. This patch removes posix._fcopyfile
|
||||
on Tiger - this is okay because the rest of the stdlib uses posix._fcopyfile
|
||||
only conditionally after checking that the function exists
|
||||
(non-Apple systems don't have posix._fcopyfile either).
|
||||
|
||||
|
||||
thanks to @dgelessus
|
||||
https://github.com/macports/macports-ports/pull/5987
|
||||
|
||||
|
||||
diff --git Lib/test/test_shutil.py Lib/test/test_shutil.py
|
||||
index e56b337..fdc53e3 100644
|
||||
--- Lib/test/test_shutil.py
|
||||
+++ Lib/test/test_shutil.py
|
||||
@@ -2451,7 +2451,7 @@ class TestZeroCopySendfile(_ZeroCopyFileTest, unittest.TestCase):
|
||||
shutil._USE_CP_SENDFILE = True
|
||||
|
||||
|
||||
-@unittest.skipIf(not MACOS, 'macOS only')
|
||||
+@unittest.skipIf(not MACOS or not hasattr(posix, "_fcopyfile"), 'macOS with posix._fcopyfile only')
|
||||
class TestZeroCopyMACOS(_ZeroCopyFileTest, unittest.TestCase):
|
||||
PATCHPOINT = "posix._fcopyfile"
|
||||
|
||||
diff --git Modules/clinic/posixmodule.c.h Modules/clinic/posixmodule.c.h
|
||||
index 41baa45..3965876 100644
|
||||
--- Modules/clinic/posixmodule.c.h
|
||||
+++ Modules/clinic/posixmodule.c.h
|
||||
@@ -5505,7 +5505,7 @@ exit:
|
||||
|
||||
#endif /* defined(HAVE_SENDFILE) && !defined(__APPLE__) && !(defined(__FreeBSD__) || defined(__DragonFly__)) */
|
||||
|
||||
-#if defined(__APPLE__)
|
||||
+#if defined(__APPLE__) && MAC_OS_X_VERSION_MIN_REQUIRED >= 1050
|
||||
|
||||
PyDoc_STRVAR(os__fcopyfile__doc__,
|
||||
"_fcopyfile($module, in_fd, out_fd, flags, /)\n"
|
||||
--- Modules/posixmodule.c.orig 2021-12-09 09:24:29.000000000 +1100
|
||||
+++ Modules/posixmodule.c 2021-12-12 04:50:08.000000000 +1100
|
||||
@@ -67,6 +67,8 @@
|
||||
*/
|
||||
#if defined(__APPLE__)
|
||||
|
||||
+#include <AvailabilityMacros.h>
|
||||
+
|
||||
#if defined(__has_builtin)
|
||||
#if __has_builtin(__builtin_available)
|
||||
#define HAVE_BUILTIN_AVAILABLE 1
|
||||
@@ -235,7 +237,7 @@ corresponding Unix manual entries for mo
|
||||
# include <sys/sendfile.h>
|
||||
#endif
|
||||
|
||||
-#if defined(__APPLE__)
|
||||
+#if defined(__APPLE__) && MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
|
||||
# include <copyfile.h>
|
||||
#endif
|
||||
|
||||
@@ -10001,7 +10003,7 @@ done:
|
||||
#endif /* HAVE_SENDFILE */
|
||||
|
||||
|
||||
-#if defined(__APPLE__)
|
||||
+#if defined(__APPLE__) && MAC_OS_X_VERSION_MIN_REQUIRED >= 1050
|
||||
/*[clinic input]
|
||||
os._fcopyfile
|
||||
|
||||
@@ -15415,7 +15417,7 @@ all_ins(PyObject *m)
|
||||
if (PyModule_AddIntMacro(m, EFD_SEMAPHORE)) return -1;
|
||||
#endif
|
||||
|
||||
-#if defined(__APPLE__)
|
||||
+#if defined(__APPLE__) && MAC_OS_X_VERSION_MIN_REQUIRED >= 1050
|
||||
if (PyModule_AddIntConstant(m, "_COPYFILE_DATA", COPYFILE_DATA)) return -1;
|
||||
#endif
|
||||
|
||||
@@ -35,9 +35,8 @@ patchfiles patch-Lib-cgi.py.diff \
|
||||
configure-disable-system-libffi.patch
|
||||
|
||||
if {${os.platform} eq "darwin" && ${os.major} <= 10} {
|
||||
# work around no copyfile and/or pthread_threadid_np on older systems
|
||||
patchfiles-append patch-no-copyfile-on-Tiger.diff \
|
||||
patch-threadid-older-systems.diff
|
||||
# work around no pthread_threadid_np on older systems
|
||||
patchfiles-append patch-threadid-older-systems.diff
|
||||
}
|
||||
|
||||
depends_build path:bin/pkg-config:pkgconfig
|
||||
@@ -92,11 +91,6 @@ destroot.target frameworkinstall maninstall
|
||||
platform darwin {
|
||||
set abiflags {}
|
||||
|
||||
# Fixes the return type of `ttyname_r`
|
||||
if {${os.major} < 9} {
|
||||
configure.cppflags-append -D__DARWIN_UNIX03=1
|
||||
}
|
||||
|
||||
post-configure {
|
||||
# poll() misbehaves on 10.8 and older
|
||||
# See https://trac.macports.org/ticket/18376
|
||||
|
||||
@@ -1,77 +0,0 @@
|
||||
posix.copyfile does not exist on Tiger.
|
||||
|
||||
Python 3.8's posix._fcopyfile implementation unconditionally uses <copyfile.h>,
|
||||
which only exists on Leopard ane newer. This patch removes posix._fcopyfile
|
||||
on Tiger - this is okay because the rest of the stdlib uses posix._fcopyfile
|
||||
only conditionally after checking that the function exists
|
||||
(non-Apple systems don't have posix._fcopyfile either).
|
||||
|
||||
|
||||
thanks to @dgelessus
|
||||
https://github.com/macports/macports-ports/pull/5987
|
||||
|
||||
|
||||
diff --git Lib/test/test_shutil.py Lib/test/test_shutil.py
|
||||
index e56b337..fdc53e3 100644
|
||||
--- Lib/test/test_shutil.py
|
||||
+++ Lib/test/test_shutil.py
|
||||
@@ -2451,7 +2451,7 @@ class TestZeroCopySendfile(_ZeroCopyFileTest, unittest.TestCase):
|
||||
shutil._USE_CP_SENDFILE = True
|
||||
|
||||
|
||||
-@unittest.skipIf(not MACOS, 'macOS only')
|
||||
+@unittest.skipIf(not MACOS or not hasattr(posix, "_fcopyfile"), 'macOS with posix._fcopyfile only')
|
||||
class TestZeroCopyMACOS(_ZeroCopyFileTest, unittest.TestCase):
|
||||
PATCHPOINT = "posix._fcopyfile"
|
||||
|
||||
diff --git Modules/clinic/posixmodule.c.h Modules/clinic/posixmodule.c.h
|
||||
index 41baa45..3965876 100644
|
||||
--- Modules/clinic/posixmodule.c.h
|
||||
+++ Modules/clinic/posixmodule.c.h
|
||||
@@ -5505,7 +5505,7 @@ exit:
|
||||
|
||||
#endif /* defined(HAVE_SENDFILE) && !defined(__APPLE__) && !(defined(__FreeBSD__) || defined(__DragonFly__)) */
|
||||
|
||||
-#if defined(__APPLE__)
|
||||
+#if defined(__APPLE__) && MAC_OS_X_VERSION_MIN_REQUIRED >= 1050
|
||||
|
||||
PyDoc_STRVAR(os__fcopyfile__doc__,
|
||||
"_fcopyfile($module, in_fd, out_fd, flags, /)\n"
|
||||
--- Modules/posixmodule.c.orig 2021-12-09 09:24:29.000000000 +1100
|
||||
+++ Modules/posixmodule.c 2021-12-12 04:50:08.000000000 +1100
|
||||
@@ -67,6 +67,8 @@
|
||||
*/
|
||||
#if defined(__APPLE__)
|
||||
|
||||
+#include <AvailabilityMacros.h>
|
||||
+
|
||||
#if defined(__has_builtin)
|
||||
#if __has_builtin(__builtin_available)
|
||||
#define HAVE_BUILTIN_AVAILABLE 1
|
||||
@@ -235,7 +237,7 @@ corresponding Unix manual entries for mo
|
||||
# include <sys/sendfile.h>
|
||||
#endif
|
||||
|
||||
-#if defined(__APPLE__)
|
||||
+#if defined(__APPLE__) && MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
|
||||
# include <copyfile.h>
|
||||
#endif
|
||||
|
||||
@@ -10001,7 +10003,7 @@ done:
|
||||
#endif /* HAVE_SENDFILE */
|
||||
|
||||
|
||||
-#if defined(__APPLE__)
|
||||
+#if defined(__APPLE__) && MAC_OS_X_VERSION_MIN_REQUIRED >= 1050
|
||||
/*[clinic input]
|
||||
os._fcopyfile
|
||||
|
||||
@@ -15415,7 +15417,7 @@ all_ins(PyObject *m)
|
||||
if (PyModule_AddIntMacro(m, EFD_SEMAPHORE)) return -1;
|
||||
#endif
|
||||
|
||||
-#if defined(__APPLE__)
|
||||
+#if defined(__APPLE__) && MAC_OS_X_VERSION_MIN_REQUIRED >= 1050
|
||||
if (PyModule_AddIntConstant(m, "_COPYFILE_DATA", COPYFILE_DATA)) return -1;
|
||||
#endif
|
||||
|
||||
@@ -34,9 +34,8 @@ patchfiles patch-configure.diff \
|
||||
configure-disable-system-libffi.patch
|
||||
|
||||
if {${os.platform} eq "darwin" && ${os.major} <= 10} {
|
||||
# work around no copyfile and/or pthread_threadid_np on older systems
|
||||
patchfiles-append patch-no-copyfile-on-Tiger.diff \
|
||||
patch-threadid-older-systems.diff
|
||||
# work around no pthread_threadid_np on older systems
|
||||
patchfiles-append patch-threadid-older-systems.diff
|
||||
}
|
||||
|
||||
depends_build path:bin/pkg-config:pkgconfig
|
||||
@@ -125,10 +124,6 @@ platform darwin {
|
||||
if {[vercmp $macosx_deployment_target <= 10.5]} {
|
||||
configure.cppflags-append -D_DARWIN_USE_64_BIT_INODE
|
||||
}
|
||||
if {${os.major} < 9} {
|
||||
# Fixes the return type of `ttyname_r`
|
||||
configure.cppflags-append -D__DARWIN_UNIX03=1
|
||||
}
|
||||
|
||||
post-configure {
|
||||
# poll() misbehaves on 10.8 and older
|
||||
|
||||
@@ -1,77 +0,0 @@
|
||||
posix.copyfile does not exist on Tiger.
|
||||
|
||||
Python 3.8's posix._fcopyfile implementation unconditionally uses <copyfile.h>,
|
||||
which only exists on Leopard ane newer. This patch removes posix._fcopyfile
|
||||
on Tiger - this is okay because the rest of the stdlib uses posix._fcopyfile
|
||||
only conditionally after checking that the function exists
|
||||
(non-Apple systems don't have posix._fcopyfile either).
|
||||
|
||||
|
||||
thanks to @dgelessus
|
||||
https://github.com/macports/macports-ports/pull/5987
|
||||
|
||||
|
||||
diff --git Lib/test/test_shutil.py Lib/test/test_shutil.py
|
||||
index e56b337..fdc53e3 100644
|
||||
--- Lib/test/test_shutil.py
|
||||
+++ Lib/test/test_shutil.py
|
||||
@@ -2451,7 +2451,7 @@ class TestZeroCopySendfile(_ZeroCopyFileTest, unittest.TestCase):
|
||||
shutil._USE_CP_SENDFILE = True
|
||||
|
||||
|
||||
-@unittest.skipIf(not MACOS, 'macOS only')
|
||||
+@unittest.skipIf(not MACOS or not hasattr(posix, "_fcopyfile"), 'macOS with posix._fcopyfile only')
|
||||
class TestZeroCopyMACOS(_ZeroCopyFileTest, unittest.TestCase):
|
||||
PATCHPOINT = "posix._fcopyfile"
|
||||
|
||||
diff --git Modules/clinic/posixmodule.c.h Modules/clinic/posixmodule.c.h
|
||||
index 41baa45..3965876 100644
|
||||
--- Modules/clinic/posixmodule.c.h
|
||||
+++ Modules/clinic/posixmodule.c.h
|
||||
@@ -5505,7 +5505,7 @@ exit:
|
||||
|
||||
#endif /* defined(HAVE_SENDFILE) && !defined(__APPLE__) && !(defined(__FreeBSD__) || defined(__DragonFly__)) */
|
||||
|
||||
-#if defined(__APPLE__)
|
||||
+#if defined(__APPLE__) && MAC_OS_X_VERSION_MIN_REQUIRED >= 1050
|
||||
|
||||
PyDoc_STRVAR(os__fcopyfile__doc__,
|
||||
"_fcopyfile($module, in_fd, out_fd, flags, /)\n"
|
||||
--- Modules/posixmodule.c.orig 2021-12-09 09:24:29.000000000 +1100
|
||||
+++ Modules/posixmodule.c 2021-12-12 04:50:08.000000000 +1100
|
||||
@@ -67,6 +67,8 @@
|
||||
*/
|
||||
#if defined(__APPLE__)
|
||||
|
||||
+#include <AvailabilityMacros.h>
|
||||
+
|
||||
#if defined(__has_builtin)
|
||||
#if __has_builtin(__builtin_available)
|
||||
#define HAVE_BUILTIN_AVAILABLE 1
|
||||
@@ -235,7 +237,7 @@ corresponding Unix manual entries for mo
|
||||
# include <sys/sendfile.h>
|
||||
#endif
|
||||
|
||||
-#if defined(__APPLE__)
|
||||
+#if defined(__APPLE__) && MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
|
||||
# include <copyfile.h>
|
||||
#endif
|
||||
|
||||
@@ -10001,7 +10003,7 @@ done:
|
||||
#endif /* HAVE_SENDFILE */
|
||||
|
||||
|
||||
-#if defined(__APPLE__)
|
||||
+#if defined(__APPLE__) && MAC_OS_X_VERSION_MIN_REQUIRED >= 1050
|
||||
/*[clinic input]
|
||||
os._fcopyfile
|
||||
|
||||
@@ -15415,7 +15417,7 @@ all_ins(PyObject *m)
|
||||
if (PyModule_AddIntMacro(m, EFD_SEMAPHORE)) return -1;
|
||||
#endif
|
||||
|
||||
-#if defined(__APPLE__)
|
||||
+#if defined(__APPLE__) && MAC_OS_X_VERSION_MIN_REQUIRED >= 1050
|
||||
if (PyModule_AddIntConstant(m, "_COPYFILE_DATA", COPYFILE_DATA)) return -1;
|
||||
#endif
|
||||
|
||||
@@ -36,9 +36,8 @@ patchfiles patch-setup.py.diff \
|
||||
implicit-int.patch
|
||||
|
||||
if {${os.platform} eq "darwin" && ${os.major} <= 10} {
|
||||
# work around no copyfile and/or pthread_threadid_np on older systems
|
||||
patchfiles-append patch-no-copyfile-on-Tiger.diff \
|
||||
patch-threadid-older-systems.diff
|
||||
# work around no pthread_threadid_np on older systems
|
||||
patchfiles-append patch-threadid-older-systems.diff
|
||||
}
|
||||
|
||||
depends_build path:bin/pkg-config:pkgconfig
|
||||
@@ -99,11 +98,6 @@ destroot.target frameworkinstall maninstall
|
||||
platform darwin {
|
||||
set abiflags {}
|
||||
|
||||
if {${os.major} < 9} {
|
||||
# Fixes the return type of `ttyname_r`
|
||||
configure.cppflags-append -D__DARWIN_UNIX03=1
|
||||
}
|
||||
|
||||
post-configure {
|
||||
# poll() misbehaves on 10.8 and older
|
||||
# See https://trac.macports.org/ticket/18376
|
||||
|
||||
@@ -1,79 +0,0 @@
|
||||
posix.copyfile does not exist on Tiger.
|
||||
|
||||
Python 3.8's posix._fcopyfile implementation unconditionally uses <copyfile.h>,
|
||||
which only exists on Leopard ane newer. This patch removes posix._fcopyfile
|
||||
on Tiger - this is okay because the rest of the stdlib uses posix._fcopyfile
|
||||
only conditionally after checking that the function exists
|
||||
(non-Apple systems don't have posix._fcopyfile either).
|
||||
|
||||
|
||||
thanks to @dgelessus
|
||||
https://github.com/macports/macports-ports/pull/5987
|
||||
|
||||
|
||||
diff --git Lib/test/test_shutil.py Lib/test/test_shutil.py
|
||||
index e56b337..fdc53e3 100644
|
||||
--- Lib/test/test_shutil.py
|
||||
+++ Lib/test/test_shutil.py
|
||||
@@ -2468,7 +2468,7 @@ class TestZeroCopySendfile(_ZeroCopyFileTest, unittest.TestCase):
|
||||
shutil._USE_CP_SENDFILE = True
|
||||
|
||||
|
||||
-@unittest.skipIf(not MACOS, 'macOS only')
|
||||
+@unittest.skipIf(not MACOS or not hasattr(posix, "_fcopyfile"), 'macOS with posix._fcopyfile only')
|
||||
class TestZeroCopyMACOS(_ZeroCopyFileTest, unittest.TestCase):
|
||||
PATCHPOINT = "posix._fcopyfile"
|
||||
|
||||
diff --git Modules/clinic/posixmodule.c.h Modules/clinic/posixmodule.c.h
|
||||
index 41baa45..3965876 100644
|
||||
--- Modules/clinic/posixmodule.c.h
|
||||
+++ Modules/clinic/posixmodule.c.h
|
||||
@@ -5505,7 +5505,7 @@ exit:
|
||||
|
||||
#endif /* defined(HAVE_SENDFILE) && !defined(__APPLE__) && !(defined(__FreeBSD__) || defined(__DragonFly__)) */
|
||||
|
||||
-#if defined(__APPLE__)
|
||||
+#if defined(__APPLE__) && MAC_OS_X_VERSION_MIN_REQUIRED >= 1050
|
||||
|
||||
PyDoc_STRVAR(os__fcopyfile__doc__,
|
||||
"_fcopyfile($module, in_fd, out_fd, flags, /)\n"
|
||||
diff --git Modules/posixmodule.c Modules/posixmodule.c
|
||||
index 01e8bcb..ff7fb30 100644
|
||||
--- Modules/posixmodule.c
|
||||
+++ Modules/posixmodule.c
|
||||
@@ -56,6 +56,8 @@
|
||||
*/
|
||||
#if defined(__APPLE__)
|
||||
|
||||
+#include <AvailabilityMacros.h>
|
||||
+
|
||||
#if defined(__has_builtin)
|
||||
#if __has_builtin(__builtin_available)
|
||||
#define HAVE_BUILTIN_AVAILABLE 1
|
||||
@@ -224,7 +226,7 @@ corresponding Unix manual entries for more information on calls.");
|
||||
# include <sys/sendfile.h>
|
||||
#endif
|
||||
|
||||
-#if defined(__APPLE__)
|
||||
+#if defined(__APPLE__) && MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
|
||||
# include <copyfile.h>
|
||||
#endif
|
||||
|
||||
@@ -9905,7 +9907,7 @@ done:
|
||||
#endif /* HAVE_SENDFILE */
|
||||
|
||||
|
||||
-#if defined(__APPLE__)
|
||||
+#if defined(__APPLE__) && MAC_OS_X_VERSION_MIN_REQUIRED >= 1050
|
||||
/*[clinic input]
|
||||
os._fcopyfile
|
||||
|
||||
@@ -15110,7 +15112,7 @@ all_ins(PyObject *m)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
-#if defined(__APPLE__)
|
||||
+#if defined(__APPLE__) && MAC_OS_X_VERSION_MIN_REQUIRED >= 1050
|
||||
if (PyModule_AddIntConstant(m, "_COPYFILE_DATA", COPYFILE_DATA)) return -1;
|
||||
#endif
|
||||
|
||||
@@ -62,12 +62,6 @@ set pf_setgid_group _postdrop
|
||||
set config_files [list main.cf master.cf access aliases canonical generic \
|
||||
header_checks relocated transport virtual]
|
||||
|
||||
# Beginning with Mac OS X 10.5, the user 'postfix' changed to '_postfix'
|
||||
platform darwin 8 {
|
||||
set pf_mail_owner postfix
|
||||
set pf_setgid_group postdrop
|
||||
}
|
||||
|
||||
configure {
|
||||
set config_cmd "${build.cmd} makefiles CC='${configure.cc}' \
|
||||
OPT='${configure.optflags}' CCARGS='${CCARGS}' AUXLIBS='${AUXLIBS}'"
|
||||
|
||||
@@ -85,11 +85,6 @@ configure.args --disable-silent-rules \
|
||||
--with-libidn2=${prefix} \
|
||||
--enable-doh
|
||||
|
||||
platform darwin 8 {
|
||||
configure.args-append --with-dlopen=no \
|
||||
--with-gssapi=no
|
||||
}
|
||||
|
||||
platform darwin 9 {
|
||||
configure.args-append --with-dlopen=no
|
||||
}
|
||||
|
||||
@@ -91,11 +91,6 @@ configure.args --disable-silent-rules \
|
||||
--with-libidn2=${prefix} \
|
||||
--enable-doh
|
||||
|
||||
platform darwin 8 {
|
||||
configure.args-append --with-dlopen=no \
|
||||
--with-gssapi=no
|
||||
}
|
||||
|
||||
platform darwin 9 {
|
||||
configure.args-append --with-dlopen=no
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user