From 40b4e1a5e9280d2a1224a0f5aea17a16b0170ea8 Mon Sep 17 00:00:00 2001 From: purplerain Date: Thu, 19 Sep 2024 05:57:48 +0000 Subject: [PATCH] UPDATE: lang/python 3.11.9 > 3.11.10 --- lang/python/3/Makefile | 4 +-- lang/python/3/distinfo | 4 +-- .../3/patches/patch-Lib_test_test_crypt_py | 12 +++++++++ .../patch-Lib_test_test_faulthandler_py | 12 +++++++++ .../3/patches/patch-Lib_test_test_fcntl_py | 12 +++++++++ .../patches/patch-Lib_test_test_subprocess_py | 12 +++++++++ .../3/patches/patch-Lib_test_test_tempfile_py | 12 +++++++++ .../patch-Lib_test_test_threadsignals_py | 21 +++++++++++++++ .../python/3/patches/patch-Python_fileutils_c | 2 +- lang/python/3/patches/patch-configure_ac | 27 ++++++++++++------- lang/python/3/pkg/PLIST-idle | 4 +++ lang/python/3/pkg/PLIST-main | 3 ++- lang/python/Makefile.inc | 11 ++++---- lang/python/python.port.mk | 23 +++++++++++----- 14 files changed, 131 insertions(+), 28 deletions(-) create mode 100644 lang/python/3/patches/patch-Lib_test_test_crypt_py create mode 100644 lang/python/3/patches/patch-Lib_test_test_faulthandler_py create mode 100644 lang/python/3/patches/patch-Lib_test_test_fcntl_py create mode 100644 lang/python/3/patches/patch-Lib_test_test_subprocess_py create mode 100644 lang/python/3/patches/patch-Lib_test_test_tempfile_py create mode 100644 lang/python/3/patches/patch-Lib_test_test_threadsignals_py diff --git a/lang/python/3/Makefile b/lang/python/3/Makefile index 4aa601591..17838db48 100644 --- a/lang/python/3/Makefile +++ b/lang/python/3/Makefile @@ -3,12 +3,12 @@ # requirement of the PSF license, if it constitutes a change to # Python itself. -FULL_VERSION = 3.11.9 +FULL_VERSION = 3.11.10 SHARED_LIBS = python3.11 0.0 VERSION_SPEC = >=3.11,<3.12 PORTROACH = limit:^3\.11 -REVISION = 2 +REVISION = 0 CONFIGURE_ENV += ac_cv_working_openssl_hashlib=yes \ TCLTK_CFLAGS="-I${MODTCL_INCDIR} -I${MODTK_INCDIR} -I${X11BASE}/include" \ diff --git a/lang/python/3/distinfo b/lang/python/3/distinfo index bb7836ac9..54ec135c0 100644 --- a/lang/python/3/distinfo +++ b/lang/python/3/distinfo @@ -1,2 +1,2 @@ -SHA256 (Python-3.11.9.tgz) = 594yQKi8Kx4bpcgb+UPwaGH/SUtp/amQzicipQTGFT0= -SIZE (Python-3.11.9.tgz) = 26521757 +SHA256 (Python-3.11.10.tgz) = kvL68kJoG/pAbVOlHhfULFNzr/4joTDNlpfhMu9XRwY= +SIZE (Python-3.11.10.tgz) = 26532827 diff --git a/lang/python/3/patches/patch-Lib_test_test_crypt_py b/lang/python/3/patches/patch-Lib_test_test_crypt_py new file mode 100644 index 000000000..6156ef500 --- /dev/null +++ b/lang/python/3/patches/patch-Lib_test_test_crypt_py @@ -0,0 +1,12 @@ +Index: Lib/test/test_crypt.py +--- Lib/test/test_crypt.py.orig ++++ Lib/test/test_crypt.py +@@ -54,7 +54,7 @@ class CryptTestCase(unittest.TestCase): + + def test_methods(self): + self.assertTrue(len(crypt.methods) >= 1) +- if sys.platform.startswith('openbsd'): ++ if sys.platform.startswith('secbsd'): + self.assertEqual(crypt.methods, [crypt.METHOD_BLOWFISH]) + else: + self.assertEqual(crypt.methods[-1], crypt.METHOD_CRYPT) diff --git a/lang/python/3/patches/patch-Lib_test_test_faulthandler_py b/lang/python/3/patches/patch-Lib_test_test_faulthandler_py new file mode 100644 index 000000000..2d03936c9 --- /dev/null +++ b/lang/python/3/patches/patch-Lib_test_test_faulthandler_py @@ -0,0 +1,12 @@ +Index: Lib/test/test_faulthandler.py +--- Lib/test/test_faulthandler.py.orig ++++ Lib/test/test_faulthandler.py +@@ -284,7 +284,7 @@ class FaultHandlerTests(unittest.TestCase): + def test_fatal_error_without_gil(self): + self.check_fatal_error_func(True) + +- @unittest.skipIf(sys.platform.startswith('openbsd'), ++ @unittest.skipIf(sys.platform.startswith('secbsd'), + "Issue #12868: sigaltstack() doesn't work on " + "OpenBSD if Python is compiled with pthread") + @unittest.skipIf(not hasattr(faulthandler, '_stack_overflow'), diff --git a/lang/python/3/patches/patch-Lib_test_test_fcntl_py b/lang/python/3/patches/patch-Lib_test_test_fcntl_py new file mode 100644 index 000000000..6b0e32b2c --- /dev/null +++ b/lang/python/3/patches/patch-Lib_test_test_fcntl_py @@ -0,0 +1,12 @@ +Index: Lib/test/test_fcntl.py +--- Lib/test/test_fcntl.py.orig ++++ Lib/test/test_fcntl.py +@@ -24,7 +24,7 @@ def get_lockdata(): + else: + start_len = "qq" + +- if (sys.platform.startswith(('netbsd', 'freebsd', 'openbsd')) ++ if (sys.platform.startswith(('netbsd', 'freebsd', 'openbsd', 'secbsd')) + or sys.platform == 'darwin'): + if struct.calcsize('l') == 8: + off_t = 'l' diff --git a/lang/python/3/patches/patch-Lib_test_test_subprocess_py b/lang/python/3/patches/patch-Lib_test_test_subprocess_py new file mode 100644 index 000000000..3df4e8fde --- /dev/null +++ b/lang/python/3/patches/patch-Lib_test_test_subprocess_py @@ -0,0 +1,12 @@ +Index: Lib/test/test_subprocess.py +--- Lib/test/test_subprocess.py.orig ++++ Lib/test/test_subprocess.py +@@ -2440,7 +2440,7 @@ class POSIXProcessTestCase(BaseTestCase): + getattr(p, method)(*args) + return p + +- @unittest.skipIf(sys.platform.startswith(('netbsd', 'openbsd')), ++ @unittest.skipIf(sys.platform.startswith(('netbsd', 'openbsd', 'secbsd')), + "Due to known OS bug (issue #16762)") + def _kill_dead_process(self, method, *args): + # Do not inherit file handles from the parent. diff --git a/lang/python/3/patches/patch-Lib_test_test_tempfile_py b/lang/python/3/patches/patch-Lib_test_test_tempfile_py new file mode 100644 index 000000000..e642118cc --- /dev/null +++ b/lang/python/3/patches/patch-Lib_test_test_tempfile_py @@ -0,0 +1,12 @@ +Index: Lib/test/test_tempfile.py +--- Lib/test/test_tempfile.py.orig ++++ Lib/test/test_tempfile.py +@@ -25,7 +25,7 @@ has_spawnl = hasattr(os, 'spawnl') + + # TEST_FILES may need to be tweaked for systems depending on the maximum + # number of files that can be opened at one time (see ulimit -n) +-if sys.platform.startswith('openbsd'): ++if sys.platform.startswith('secbsd'): + TEST_FILES = 48 + else: + TEST_FILES = 100 diff --git a/lang/python/3/patches/patch-Lib_test_test_threadsignals_py b/lang/python/3/patches/patch-Lib_test_test_threadsignals_py new file mode 100644 index 000000000..c03e38dd2 --- /dev/null +++ b/lang/python/3/patches/patch-Lib_test_test_threadsignals_py @@ -0,0 +1,21 @@ +Index: Lib/test/test_threadsignals.py +--- Lib/test/test_threadsignals.py.orig ++++ Lib/test/test_threadsignals.py +@@ -75,7 +75,7 @@ class ThreadSignals(unittest.TestCase): + 'Issue 34004: musl does not allow interruption of locks ' + 'by signals.') + # Issue #20564: sem_timedwait() cannot be interrupted on OpenBSD +- @unittest.skipIf(sys.platform.startswith('openbsd'), ++ @unittest.skipIf(sys.platform.startswith('secbsd'), + 'lock cannot be interrupted on OpenBSD') + def test_lock_acquire_interruption(self): + # Mimic receiving a SIGINT (KeyboardInterrupt) with SIGALRM while stuck +@@ -106,7 +106,7 @@ class ThreadSignals(unittest.TestCase): + 'Issue 34004: musl does not allow interruption of locks ' + 'by signals.') + # Issue #20564: sem_timedwait() cannot be interrupted on OpenBSD +- @unittest.skipIf(sys.platform.startswith('openbsd'), ++ @unittest.skipIf(sys.platform.startswith('secbsd'), + 'lock cannot be interrupted on OpenBSD') + def test_rlock_acquire_interruption(self): + # Mimic receiving a SIGINT (KeyboardInterrupt) with SIGALRM while stuck diff --git a/lang/python/3/patches/patch-Python_fileutils_c b/lang/python/3/patches/patch-Python_fileutils_c index 1a3f81819..0aa8a27ec 100644 --- a/lang/python/3/patches/patch-Python_fileutils_c +++ b/lang/python/3/patches/patch-Python_fileutils_c @@ -6,7 +6,7 @@ Index: Python/fileutils.c * 2b. If fdwalk(3) isn't available, just do a plain close(2) loop. */ -#ifdef __FreeBSD__ -+#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__SecBSD__) ++#if defined(__FreeBSD__) || defined(__OpenBSD__) # define USE_CLOSEFROM -#endif /* __FreeBSD__ */ +#endif /* __FreeBSD__ || __OpenBSD__ */ diff --git a/lang/python/3/patches/patch-configure_ac b/lang/python/3/patches/patch-configure_ac index a360191d1..817b0c7bd 100644 --- a/lang/python/3/patches/patch-configure_ac +++ b/lang/python/3/patches/patch-configure_ac @@ -1,3 +1,9 @@ +#1: Set ports library version +#2: Don't pick up an installed linux/e2fsprogs libuuid.so +#3: llvm-ar (used for LTO) is installed as ar +#4: OpenBSD isn't multi-arch +#5: Try only the right tcl/tk string + Index: configure.ac --- configure.ac.orig +++ configure.ac @@ -15,19 +21,20 @@ Index: configure.ac AC_DEFINE(_BSD_SOURCE, 1, [Define on OpenBSD to activate all library features]) ;; - OpenBSD/*) -+ OpenBSD/* | SecBSD/*) ++ OpenBSD/*|SecBSD/*) # OpenBSD undoes our definition of __BSD_VISIBLE if _XOPEN_SOURCE is # also defined. This can be overridden by defining _BSD_SOURCE # As this has a different meaning on Linux, only define it on OpenBSD -@@ -1104,6 +1104,7 @@ AC_MSG_CHECKING([for multiarch]) +@@ -1104,6 +1104,8 @@ AC_MSG_CHECKING([for multiarch]) AS_CASE([$ac_sys_system], [Darwin*], [MULTIARCH=""], [FreeBSD*], [MULTIARCH=""], ++ [OpenBSD*], [MULTIARCH=""], + [SecBSD*], [MULTIARCH=""], [MULTIARCH=$($CC --print-multiarch 2>/dev/null)] ) AC_SUBST([MULTIARCH]) -@@ -1493,7 +1494,7 @@ if test $enable_shared = "yes"; then +@@ -1493,7 +1495,7 @@ if test $enable_shared = "yes"; then PY3LIBRARY=libpython3.so fi ;; @@ -36,7 +43,7 @@ Index: configure.ac LDLIBRARY='libpython$(LDVERSION).so' BLDLIBRARY='-L. -lpython$(LDVERSION)' RUNSHARED=LD_LIBRARY_PATH=`pwd`${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}} -@@ -1843,13 +1844,13 @@ esac +@@ -1843,13 +1845,13 @@ esac [AC_MSG_RESULT(no)]) if test "$Py_LTO" = 'true' ; then case $CC in @@ -52,7 +59,7 @@ Index: configure.ac AC_SUBST(LLVM_AR_FOUND) if test -n "${LLVM_AR}" -a -x "${LLVM_AR}" then -@@ -1964,7 +1965,7 @@ then +@@ -1964,7 +1966,7 @@ then fi LLVM_PROF_ERR=no case $CC in @@ -61,16 +68,16 @@ Index: configure.ac # Any changes made here should be reflected in the GCC+Darwin case below PGO_PROF_GEN_FLAG="-fprofile-instr-generate" PGO_PROF_USE_FLAG="-fprofile-instr-use=code.profclangd" -@@ -3193,7 +3194,7 @@ then +@@ -3193,7 +3195,7 @@ then else LDSHARED="ld -Bshareable" fi;; - OpenBSD*) -+ OpenBSD* | SecBSD*) ++ OpenBSD*|SecBSD*) if [[ "`$CC -dM -E - =3,<${FULL_VERSION}p0 +======= +@conflict python-idle->=3,<3.11.10p0 +>>>>>>> 1.5 @pkgpath lang/python/3.2,-idle @pkgpath lang/python/3.3,-idle @pkgpath lang/python/3.4,-idle diff --git a/lang/python/3/pkg/PLIST-main b/lang/python/3/pkg/PLIST-main index 8b1a9ed10..60d87eb60 100644 --- a/lang/python/3/pkg/PLIST-main +++ b/lang/python/3/pkg/PLIST-main @@ -1,7 +1,7 @@ @option no-default-conflict @option is-branch @conflict python-${VERSION_SPEC} -@conflict python->=3,<3.11.9p0 +@conflict python->=3,<3.11.10p0 @pkgpath lang/python/3.2,-main @pkgpath lang/python/3.3,-main @pkgpath lang/python/3.4,-main @@ -12,6 +12,7 @@ @pkgpath lang/python/3.9,-main @pkgpath lang/python/3.10,-main @pkgpath lang/python/3.11,-main +@pkgpath meta/python3 bin/2to3 bin/2to3-3.11 @comment bin/pip3 diff --git a/lang/python/Makefile.inc b/lang/python/Makefile.inc index 6acfa14ea..e4efa5b5d 100644 --- a/lang/python/Makefile.inc +++ b/lang/python/Makefile.inc @@ -114,15 +114,16 @@ AUTOCONF_VERSION = 2.69 CONFIGURE_STYLE = autoconf CONFIGURE_ARGS += --enable-shared +CONFIGURE_ARGS += --enable-ipv6 \ + --with-system-expat \ + --with-system-ffi + +.if ${VERSION} == "2.7" CONFIGURE_ARGS += --with-fpectl \ --with-threads \ - --enable-ipv6 \ - --with-system-expat \ - --with-system-ffi \ --with-tcltk-includes='-I${MODTCL_INCDIR} -I${MODTK_INCDIR} -I${X11BASE}/include' \ --with-tcltk-libs='-L${X11BASE}/lib -l${MODTCL_LIB} -l${MODTK_LIB}' - -.if ${VERSION} != "2.7" +.else CONFIGURE_ARGS += --enable-loadable-sqlite-extensions . if ${PROPERTIES:Mlld} CONFIGURE_ARGS += --with-lto diff --git a/lang/python/python.port.mk b/lang/python/python.port.mk index 89c64e90c..c862200bf 100644 --- a/lang/python/python.port.mk +++ b/lang/python/python.port.mk @@ -173,20 +173,22 @@ DPB_PROPERTIES += nojunk .elif ${MODPY_PYBUILD:L} != no BUILD_DEPENDS += devel/py-build${MODPY_FLAVOR} \ devel/py-installer${MODPY_FLAVOR} -. if ${MODPY_PYBUILD} == flit_core +. if ${MODPY_PYBUILD} == flit +BUILD_DEPENDS += devel/py-flit${MODPY_FLAVOR} +. elif ${MODPY_PYBUILD} == flit_core BUILD_DEPENDS += devel/py-flit_core${MODPY_FLAVOR} . elif ${MODPY_PYBUILD} == flit_scm BUILD_DEPENDS += devel/py-flit_scm${MODPY_FLAVOR} -. elif ${MODPY_PYBUILD} == flit -BUILD_DEPENDS += devel/py-flit${MODPY_FLAVOR} -. elif ${MODPY_PYBUILD} == hatchling -BUILD_DEPENDS += devel/py-hatchling${MODPY_FLAVOR} . elif ${MODPY_PYBUILD} == hatch-vcs BUILD_DEPENDS += devel/py-hatch-vcs${MODPY_FLAVOR} +. elif ${MODPY_PYBUILD} == hatchling +BUILD_DEPENDS += devel/py-hatchling${MODPY_FLAVOR} . elif ${MODPY_PYBUILD} == jupyter_packaging BUILD_DEPENDS += devel/py-jupyter_packaging${MODPY_FLAVOR} . elif ${MODPY_PYBUILD} == maturin BUILD_DEPENDS += devel/maturin +. elif ${MODPY_PYBUILD} == pdm +BUILD_DEPENDS += devel/py-pdm-backend${MODPY_FLAVOR} . elif ${MODPY_PYBUILD} == poetry-core BUILD_DEPENDS += devel/py-poetry-core${MODPY_FLAVOR} . elif ${MODPY_PYBUILD} == setuptools || ${MODPY_PYBUILD} == setuptools_scm @@ -196,7 +198,7 @@ BUILD_DEPENDS += devel/py-setuptools${MODPY_FLAVOR} \ BUILD_DEPENDS += devel/py-setuptools_scm${MODPY_FLAVOR} . endif . elif !${MODPY_PYBUILD:L:Mother} -ERRORS += "Fatal: unknown MODPY_PYBUILD value (flit_core, flit_scm, flit, hatchling, hatch-vcs, jupyter_packaging, maturin, other, poetry-core, setuptools, setuptools_scm)" +ERRORS += "Fatal: unknown MODPY_PYBUILD value (flit, flit_core, flit_scm, hatch-vcs, hatchling, jupyter_packaging, pdm, maturin, other, poetry-core, setuptools, setuptools_scm)" . endif .else # Try to detect the case where a port will build regardless of setuptools @@ -262,7 +264,8 @@ MODPY_TEST_DIR ?= ${WRKSRC} MODPY_TEST_CMD = cd ${MODPY_TEST_DIR} && ${SETENV} ${ALL_TEST_ENV} ${MODPY_BIN} .if ${MODPY_PYTEST:L} == "yes" -MODPY_TEST_CMD += -m pytest +MODPY_PYTEST_USERARGS ?= +MODPY_TEST_CMD += -m pytest ${MODPY_PYTEST_USERARGS} MODPY_TEST_LIBDIR ?= ${WRKSRC}/build/lib:${WRKSRC}/build/lib.openbsd-${OSREV}-${ARCH}-cpython-${MODPY_MAJORMINOR}:${WRKSRC}/lib.openbsd-${OSREV}-${ARCH}-${MODPY_VERSION} .else MODPY_TEST_CMD += ./${MODPY_SETUP} ${MODPY_SETUP_ARGS} @@ -294,6 +297,12 @@ MODPY_ADJ_FILES ?= MODPYTHON_pre-configure += cd ${WRKSRC} && ${MODPY_BIN_ADJ} ${MODPY_ADJ_FILES} .endif +.if ${MODPY_VERSION} == ${MODPY_DEFAULT_VERSION_2} +MODPY_COMPILEALL = ${MODPY_BIN} -m compileall +.else +MODPY_COMPILEALL = ${MODPY_BIN} -m compileall -j ${MAKE_JOBS} -s ${WRKINST} -o 0 -o 1 +.endif + .if ${MODPY_PYBUILD:L} != no . if ! ${MODPY_PYBUILD:Msetuptools_scm} _MODPY_PRE_BUILD_STEPS += ; if [ -e ${WRKSRC}/pyproject.toml ]; then \