git: 4a604327b563 - main - lang/tauthon: Fix build woth OpenSSL 3
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 13 Jun 2023 10:06:29 UTC
The branch main has been updated by bofh: URL: https://cgit.FreeBSD.org/ports/commit/?id=4a604327b563c2ccf03f95569107e7c4380a1a09 commit 4a604327b563c2ccf03f95569107e7c4380a1a09 Author: Olivier Certner <olce.freebsd@certner.fr> AuthorDate: 2023-06-13 09:10:20 +0000 Commit: Muhammad Moinur Rahman <bofh@FreeBSD.org> CommitDate: 2023-06-13 10:06:15 +0000 lang/tauthon: Fix build woth OpenSSL 3 PR: 271961 --- lang/tauthon/files/patch-setup.py | 72 ++++++++++++++++++++++++++++++--------- 1 file changed, 56 insertions(+), 16 deletions(-) diff --git a/lang/tauthon/files/patch-setup.py b/lang/tauthon/files/patch-setup.py index 7d2b60e29d67..7dfa52909d59 100644 --- a/lang/tauthon/files/patch-setup.py +++ b/lang/tauthon/files/patch-setup.py @@ -1,13 +1,6 @@ -# Description: Partial script installation backport from Python3 -# Submitted by: mva - -# Description: Some modules are installed via other ports - -# Description: ossaudiodev detection fix backport - ---- setup.py.orig 2017-04-22 03:42:03 UTC -+++ setup.py -@@ -15,6 +15,7 @@ from distutils.core import Extension, se +--- setup.py.orig 2021-06-02 16:51:18.000000000 +0200 ++++ setup.py 2023-06-09 19:32:17.812240000 +0200 +@@ -15,6 +15,7 @@ from distutils.command.build_ext import build_ext from distutils.command.install import install from distutils.command.install_lib import install_lib @@ -15,7 +8,7 @@ from distutils.spawn import find_executable cross_compiling = "_PYTHON_HOST_PLATFORM" in os.environ -@@ -33,7 +34,7 @@ host_platform = get_platform() +@@ -33,7 +34,7 @@ COMPILED_WITH_PYDEBUG = ('--with-pydebug' in sysconfig.get_config_var("CONFIG_ARGS")) # This global variable is used to hold the list of modules to be disabled. @@ -24,7 +17,54 @@ def add_dir_to_list(dirlist, dir): """Add the directory 'dir' to the list 'dirlist' (at the front) if -@@ -1234,7 +1235,7 @@ class PyBuildExt(build_ext): +@@ -886,7 +887,10 @@ + missing.append('_ssl') + + # find out which version of OpenSSL we have ++ openssl_major = -1 + openssl_ver = 0 ++ openssl_major_re = re.compile( ++ '^\s*#\s*define\s+OPENSSL_VERSION_MAJOR\s+([0-9]+)' ) + openssl_ver_re = re.compile( + '^\s*#\s*define\s+OPENSSL_VERSION_NUMBER\s+(0x[0-9a-fA-F]+)' ) + +@@ -900,17 +904,22 @@ + try: + incfile = open(name, 'r') + for line in incfile: ++ m = openssl_major_re.match(line) ++ if m: ++ openssl_major = int(m.group(1)) + m = openssl_ver_re.match(line) + if m: +- openssl_ver = eval(m.group(1)) ++ openssl_ver = int(m.group(1), 0) + except IOError, msg: + print "IOError while reading opensshv.h:", msg + pass + ++ min_openssl_major = 1 + min_openssl_ver = 0x00907000 + have_any_openssl = ssl_incs is not None and ssl_libs is not None + have_usable_openssl = (have_any_openssl and +- openssl_ver >= min_openssl_ver) ++ (openssl_ver >= min_openssl_ver or ++ openssl_major >= min_openssl_major)) + + if have_any_openssl: + if have_usable_openssl: +@@ -935,7 +944,9 @@ + depends = ['md5.h']) ) + + min_sha2_openssl_ver = 0x00908000 +- if COMPILED_WITH_PYDEBUG or openssl_ver < min_sha2_openssl_ver: ++ if COMPILED_WITH_PYDEBUG or \ ++ (openssl_ver < min_sha2_openssl_ver and ++ openssl_major < min_openssl_major): + # OpenSSL doesn't do these until 0.9.8 so we'll bring our own hash + exts.append( Extension('_sha256', ['sha256module.c']) ) + exts.append( Extension('_sha512', ['sha512module.c']) ) +@@ -1284,7 +1295,7 @@ sysroot = macosx_sdk_root() f = os.path.join(sysroot, f[1:]) @@ -33,7 +73,7 @@ data = open(f).read() m = re.search(r"#s*define\s+HASHVERSION\s+2\s*", data) if m is not None: -@@ -1624,9 +1625,10 @@ class PyBuildExt(build_ext): +@@ -1669,9 +1680,10 @@ else: missing.append('linuxaudiodev') @@ -47,7 +87,7 @@ exts.append( Extension('ossaudiodev', ['ossaudiodev.c']) ) else: missing.append('ossaudiodev') -@@ -2200,6 +2202,22 @@ class PyBuildInstallLib(install_lib): +@@ -2294,6 +2306,22 @@ def is_chmod_supported(self): return hasattr(os, 'chmod') @@ -70,7 +110,7 @@ SUMMARY = """ Python is an interpreted, interactive, object-oriented programming language. It is often compared to Tcl, Perl, Scheme or Java. -@@ -2245,7 +2263,9 @@ def main(): +@@ -2343,7 +2371,9 @@ platforms = ["Many"], # Build info @@ -81,7 +121,7 @@ 'install_lib':PyBuildInstallLib}, # The struct module is defined here, because build_ext won't be # called unless there's at least one extension module defined. -@@ -2253,8 +2273,7 @@ def main(): +@@ -2351,8 +2381,7 @@ # Scripts to install scripts = ['Tools/scripts/pydoc', 'Tools/scripts/idle',