diff options
Diffstat (limited to 'lang/python313/files')
| -rw-r--r-- | lang/python313/files/libressl/patch-Modules___hashopenssl.c | 26 | ||||
| -rw-r--r-- | lang/python313/files/patch-Makefile.pre.in | 62 | ||||
| -rw-r--r-- | lang/python313/files/patch-Misc__python-config.sh.in | 11 | ||||
| -rw-r--r-- | lang/python313/files/patch-Modules___blake2_blake2s__impl.c | 14 | ||||
| -rw-r--r-- | lang/python313/files/patch-Tools_jit___llvm.py | 31 | ||||
| -rw-r--r-- | lang/python313/files/patch-Tools_jit___targets.py | 12 | ||||
| -rw-r--r-- | lang/python313/files/patch-configure | 11 | ||||
| -rw-r--r-- | lang/python313/files/pkg-message.in | 12 |
8 files changed, 179 insertions, 0 deletions
diff --git a/lang/python313/files/libressl/patch-Modules___hashopenssl.c b/lang/python313/files/libressl/patch-Modules___hashopenssl.c new file mode 100644 index 000000000000..405141320e47 --- /dev/null +++ b/lang/python313/files/libressl/patch-Modules___hashopenssl.c @@ -0,0 +1,26 @@ +--- Modules/_hashopenssl.c.orig 2025-02-04 14:51:09 UTC ++++ Modules/_hashopenssl.c +@@ -44,7 +44,9 @@ + + #define MUNCH_SIZE INT_MAX + ++#ifndef LIBRESSL_VERSION_NUMBER + #define PY_OPENSSL_HAS_SCRYPT 1 ++#endif + #if defined(NID_sha3_224) && defined(NID_sha3_256) && defined(NID_sha3_384) && defined(NID_sha3_512) + #define PY_OPENSSL_HAS_SHA3 1 + #endif +@@ -918,9 +920,12 @@ py_evp_fromname(PyObject *module, const char *digestna + goto exit; + } + ++#ifdef PY_OPENSSL_HAS_SHAKE + if ((EVP_MD_flags(digest) & EVP_MD_FLAG_XOF) == EVP_MD_FLAG_XOF) { + type = get_hashlib_state(module)->EVPXOFtype; +- } else { ++ } else ++#endif ++ { + type = get_hashlib_state(module)->EVPtype; + } + diff --git a/lang/python313/files/patch-Makefile.pre.in b/lang/python313/files/patch-Makefile.pre.in new file mode 100644 index 000000000000..74d5e79020ef --- /dev/null +++ b/lang/python313/files/patch-Makefile.pre.in @@ -0,0 +1,62 @@ +--- Makefile.pre.in.orig 2024-06-07 03:15:55 UTC ++++ Makefile.pre.in +@@ -83,7 +83,6 @@ BASECPPFLAGS= @BASECPPFLAGS@ + OPT= @OPT@ + BASECFLAGS= @BASECFLAGS@ + BASECPPFLAGS= @BASECPPFLAGS@ +-CONFIGURE_CFLAGS= @CFLAGS@ + # CFLAGS_NODIST is used for building the interpreter and stdlib C extensions. + # Use it when a compiler flag should _not_ be part of the distutils CFLAGS + # once Python is installed (Issue #21121). +@@ -95,18 +94,16 @@ CONFIGURE_LDFLAGS_NOLTO=@LDFLAGS_NOLTO@ + # LDFLAGS_NOLTO is an extra flag to disable lto. It is used to speed up building + # of _bootstrap_python and _freeze_module tools, which don't need LTO. + CONFIGURE_LDFLAGS_NOLTO=@LDFLAGS_NOLTO@ +-CONFIGURE_CPPFLAGS= @CPPFLAGS@ +-CONFIGURE_LDFLAGS= @LDFLAGS@ + # Avoid assigning CFLAGS, LDFLAGS, etc. so users can use them on the + # command line to append to these values without stomping the pre-set + # values. +-PY_CFLAGS= $(BASECFLAGS) $(OPT) $(CONFIGURE_CFLAGS) $(CFLAGS) $(EXTRA_CFLAGS) ++PY_CFLAGS= $(BASECFLAGS) $(OPT) $(CFLAGS) $(EXTRA_CFLAGS) + PY_CFLAGS_NODIST=$(CONFIGURE_CFLAGS_NODIST) $(CFLAGS_NODIST) -I$(srcdir)/Include/internal -I$(srcdir)/Include/internal/mimalloc + # Both CPPFLAGS and LDFLAGS need to contain the shell's value for setup.py to + # be able to build extension modules using the directories specified in the + # environment variables +-PY_CPPFLAGS= $(BASECPPFLAGS) -I. -I$(srcdir)/Include $(CONFIGURE_CPPFLAGS) $(CPPFLAGS) +-PY_LDFLAGS= $(CONFIGURE_LDFLAGS) $(LDFLAGS) ++PY_CPPFLAGS= $(BASECPPFLAGS) -I. -I$(srcdir)/Include $(CPPFLAGS) ++PY_LDFLAGS= $(LDFLAGS) + PY_LDFLAGS_NODIST=$(CONFIGURE_LDFLAGS_NODIST) $(LDFLAGS_NODIST) + PY_LDFLAGS_NOLTO=$(PY_LDFLAGS) $(CONFIGURE_LDFLAGS_NOLTO) $(LDFLAGS_NODIST) + NO_AS_NEEDED= @NO_AS_NEEDED@ +@@ -2258,14 +2255,6 @@ bininstall: commoninstall altbininstall + else true; \ + fi + (cd $(DESTDIR)$(BINDIR); $(LN) -s python$(VERSION)$(EXE) python3$(EXE)) +- -if test "$(VERSION)" != "$(LDVERSION)"; then \ +- rm -f $(DESTDIR)$(BINDIR)/python$(VERSION)-config; \ +- (cd $(DESTDIR)$(BINDIR); $(LN) -s python$(LDVERSION)-config python$(VERSION)-config); \ +- rm -f $(DESTDIR)$(LIBPC)/python-$(VERSION).pc; \ +- (cd $(DESTDIR)$(LIBPC); $(LN) -s python-$(LDVERSION).pc python-$(VERSION).pc); \ +- rm -f $(DESTDIR)$(LIBPC)/python-$(VERSION)-embed.pc; \ +- (cd $(DESTDIR)$(LIBPC); $(LN) -s python-$(LDVERSION)-embed.pc python-$(VERSION)-embed.pc); \ +- fi + -rm -f $(DESTDIR)$(BINDIR)/python3-config + (cd $(DESTDIR)$(BINDIR); $(LN) -s python$(VERSION)-config python3-config) + -rm -f $(DESTDIR)$(LIBPC)/python3.pc +@@ -2708,6 +2697,14 @@ libainstall: all scripts + $(INSTALL_SCRIPT) $(srcdir)/install-sh $(DESTDIR)$(LIBPL)/install-sh + $(INSTALL_SCRIPT) python-config.py $(DESTDIR)$(LIBPL)/python-config.py + $(INSTALL_SCRIPT) python-config $(DESTDIR)$(BINDIR)/python$(LDVERSION)-config ++ -if test "$(VERSION)" != "$(LDVERSION)"; then \ ++ rm -f $(DESTDIR)$(BINDIR)/python$(VERSION)-config; \ ++ (cd $(DESTDIR)$(BINDIR); $(LN) -s python$(LDVERSION)-config python$(VERSION)-config); \ ++ rm -f $(DESTDIR)$(LIBPC)/python-$(LDVERSION).pc; \ ++ (cd $(DESTDIR)$(LIBPC); $(LN) -s python-$(VERSION).pc python-$(LDVERSION).pc); \ ++ rm -f $(DESTDIR)$(LIBPC)/python-$(LDVERSION)-embed.pc; \ ++ (cd $(DESTDIR)$(LIBPC); $(LN) -s python-$(VERSION)-embed.pc python-$(LDVERSION)-embed.pc); \ ++ fi + $(INSTALL_SCRIPT) $(SCRIPT_IDLE) $(DESTDIR)$(BINDIR)/idle$(VERSION) + $(INSTALL_SCRIPT) $(SCRIPT_PYDOC) $(DESTDIR)$(BINDIR)/pydoc$(VERSION) + @if [ -s Modules/python.exp -a \ diff --git a/lang/python313/files/patch-Misc__python-config.sh.in b/lang/python313/files/patch-Misc__python-config.sh.in new file mode 100644 index 000000000000..ebb0c6a51f6d --- /dev/null +++ b/lang/python313/files/patch-Misc__python-config.sh.in @@ -0,0 +1,11 @@ +--- Misc/python-config.sh.in.orig 2018-07-13 21:07:16 UTC ++++ Misc/python-config.sh.in +@@ -15,7 +15,7 @@ fi + # Returns the actual prefix where this script was installed to. + installed_prefix () + { +- RESULT=$(dirname $(cd $(dirname "$1") && pwd -P)) ++ RESULT=$(dirname $(cd $(dirname $(realpath "$1")) && pwd -P)) + if which readlink >/dev/null 2>&1 ; then + if readlink -f "$RESULT" >/dev/null 2>&1; then + RESULT=$(readlink -f "$RESULT") diff --git a/lang/python313/files/patch-Modules___blake2_blake2s__impl.c b/lang/python313/files/patch-Modules___blake2_blake2s__impl.c new file mode 100644 index 000000000000..101877f1ae87 --- /dev/null +++ b/lang/python313/files/patch-Modules___blake2_blake2s__impl.c @@ -0,0 +1,14 @@ +--- Modules/_blake2/blake2s_impl.c.orig 2025-10-14 13:52:31 UTC ++++ Modules/_blake2/blake2s_impl.c +@@ -103,10 +103,10 @@ py_blake2s_new_impl(PyTypeObject *type, PyObject *data + { + BLAKE2sObject *self = NULL; + PyObject *data; ++ Py_buffer buf; + if (_Py_hashlib_data_argument(&data, data_obj, string) < 0) { + return NULL; + } +- Py_buffer buf; + + self = new_BLAKE2sObject(type); + if (self == NULL) { diff --git a/lang/python313/files/patch-Tools_jit___llvm.py b/lang/python313/files/patch-Tools_jit___llvm.py new file mode 100644 index 000000000000..c002680ed55b --- /dev/null +++ b/lang/python313/files/patch-Tools_jit___llvm.py @@ -0,0 +1,31 @@ +--- Tools/jit/_llvm.py.orig 2025-06-11 15:36:57 UTC ++++ Tools/jit/_llvm.py +@@ -68,20 +68,7 @@ async def _find_tool(tool: str, *, echo: bool = False) + async def _find_tool(tool: str, *, echo: bool = False) -> str | None: + # Unversioned executables: + path = tool +- if await _check_tool_version(path, echo=echo): +- return path +- # Versioned executables: +- path = f"{tool}-{_LLVM_VERSION}" +- if await _check_tool_version(path, echo=echo): +- return path +- # Homebrew-installed executables: +- prefix = await _get_brew_llvm_prefix(echo=echo) +- if prefix is not None: +- path = os.path.join(prefix, "bin", tool) +- if await _check_tool_version(path, echo=echo): +- return path +- # Nothing found: +- return None ++ return path + + + async def maybe_run( +@@ -96,5 +83,5 @@ async def run(tool: str, args: typing.Iterable[str], e + """Run an LLVM tool if it can be found. Otherwise, raise RuntimeError.""" + output = await maybe_run(tool, args, echo=echo) + if output is None: +- raise RuntimeError(f"Can't find {tool}-{_LLVM_VERSION}!") ++ raise RuntimeError(f"Can't find {tool}!") + return output diff --git a/lang/python313/files/patch-Tools_jit___targets.py b/lang/python313/files/patch-Tools_jit___targets.py new file mode 100644 index 000000000000..1e514db1f026 --- /dev/null +++ b/lang/python313/files/patch-Tools_jit___targets.py @@ -0,0 +1,12 @@ +--- Tools/jit/_targets.py.orig 2025-04-08 13:54:08 UTC ++++ Tools/jit/_targets.py +@@ -538,6 +538,9 @@ def get_target(host: str) -> _COFF | _ELF | _MachO: + elif re.fullmatch(r"x86_64-.*-linux-gnu", host): + args = ["-fpic"] + target = _ELF(host, args=args, ghccc=True) ++ elif re.fullmatch(r"amd64-.*-freebsd.*", host): ++ args = ["-fpic"] ++ target = _ELF(host, args=args, ghccc=True) + else: + raise ValueError(host) + return target diff --git a/lang/python313/files/patch-configure b/lang/python313/files/patch-configure new file mode 100644 index 000000000000..d9ab11042299 --- /dev/null +++ b/lang/python313/files/patch-configure @@ -0,0 +1,11 @@ +--- configure.orig 2022-11-02 01:26:00 UTC ++++ configure +@@ -7704,7 +7704,7 @@ if test "$Py_LTO" = 'true' ; then + + if test "$Py_LTO" = 'true' ; then + case $CC in +- *clang*) ++ *clang*|cc) + LDFLAGS_NOLTO="-fno-lto" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -flto=thin" >&5 + $as_echo_n "checking whether C compiler accepts -flto=thin... " >&6; } diff --git a/lang/python313/files/pkg-message.in b/lang/python313/files/pkg-message.in new file mode 100644 index 000000000000..286359c9f272 --- /dev/null +++ b/lang/python313/files/pkg-message.in @@ -0,0 +1,12 @@ +[ +{ type: install + message: <<EOM +Note that some standard Python modules are provided as separate ports +as they require additional dependencies. They are available as: + +py%%PYTHON_SUFFIX%%-gdbm databases/py-gdbm@py%%PYTHON_SUFFIX%% +py%%PYTHON_SUFFIX%%-sqlite3 databases/py-sqlite3@py%%PYTHON_SUFFIX%% +py%%PYTHON_SUFFIX%%-tkinter x11-toolkits/py-tkinter@py%%PYTHON_SUFFIX%% +EOM +} +] |
