pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/lang/python27 python27: Fix build with OpenSSL 3.



details:   https://anonhg.NetBSD.org/pkgsrc/rev/ebc680374c39
branches:  trunk
changeset: 459000:ebc680374c39
user:      jperkin <jperkin%pkgsrc.org@localhost>
date:      Tue Sep 28 12:31:25 2021 +0000

description:
python27: Fix build with OpenSSL 3.

diffstat:

 lang/python27/distinfo               |   4 +-
 lang/python27/patches/patch-setup.py |  42 ++++++++++++++++++++++++-----------
 2 files changed, 31 insertions(+), 15 deletions(-)

diffs (140 lines):

diff -r 62d908308974 -r ebc680374c39 lang/python27/distinfo
--- a/lang/python27/distinfo    Tue Sep 28 10:29:54 2021 +0000
+++ b/lang/python27/distinfo    Tue Sep 28 12:31:25 2021 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.82 2021/06/23 18:30:24 schmonz Exp $
+$NetBSD: distinfo,v 1.83 2021/09/28 12:31:25 jperkin Exp $
 
 SHA1 (Python-2.7.18.tar.xz) = 678d4cf483a1c92efd347ee8e1e79326dc82810b
 RMD160 (Python-2.7.18.tar.xz) = 40a514bb05c9e631454ea8466e28f5bb229428ad
@@ -48,4 +48,4 @@
 SHA1 (patch-Python_thread__pthread.h) = 517cfefc2f2e13631d22bad28c327513cdf17c10
 SHA1 (patch-configure) = a8bcacd360ca3a451c43a05a4be3bcea56f70617
 SHA1 (patch-pyconfig.h.in) = 66d1a685e17ef7977bf09cdc64bdf80087216bc7
-SHA1 (patch-setup.py) = 19aa0992ea75cd151be7e35f05d9af0a84d07e85
+SHA1 (patch-setup.py) = 4ab14fc01a1622b7a35bfb45b93a12d16dfc8b82
diff -r 62d908308974 -r ebc680374c39 lang/python27/patches/patch-setup.py
--- a/lang/python27/patches/patch-setup.py      Tue Sep 28 10:29:54 2021 +0000
+++ b/lang/python27/patches/patch-setup.py      Tue Sep 28 12:31:25 2021 +0000
@@ -1,4 +1,4 @@
-$NetBSD: patch-setup.py,v 1.2 2021/06/23 18:30:24 schmonz Exp $
+$NetBSD: patch-setup.py,v 1.3 2021/09/28 12:31:25 jperkin Exp $
 
 Disable certain modules, so they can be built as separate packages.
 Only check the BUILDLINK_DIR for libraries etc, do not pick up random
@@ -8,15 +8,15 @@
 Assume panel_library is correct; this is a fix for ncurses' gnupanel
   which will get transformed to panel in buildlink.
 
-Build the _ssl module with pkgsrc choiced OpenSSL.
+Build the _ssl module with pkgsrc choiced OpenSSL.  Support OpenSSL 3.x
 
 macOS arm64 support, via MacPorts.
 
 cygwin 2.7.3-no-libm.patch
 
---- setup.py.orig      2021-06-22 19:20:43.000000000 +0000
+--- setup.py.orig      2020-04-19 21:13:39.000000000 +0000
 +++ setup.py
-@@ -16,6 +16,7 @@ from distutils.command.build_ext import 
+@@ -16,6 +16,7 @@ from distutils.command.build_ext import
  from distutils.command.install import install
  from distutils.command.install_lib import install_lib
  from distutils.spawn import find_executable
@@ -97,7 +97,12 @@
  
          if (ssl_incs is not None and
              ssl_libs is not None):
-@@ -888,7 +889,7 @@ class PyBuildExt(build_ext):
+@@ -885,10 +886,12 @@ class PyBuildExt(build_ext):
+         openssl_ver = 0
+         openssl_ver_re = re.compile(
+             '^\s*#\s*define\s+OPENSSL_VERSION_NUMBER\s+(0x[0-9a-fA-F]+)' )
++        openssl_ver_major = re.compile(
++            '^\s*#\s*define\s+OPENSSL_VERSION_MAJOR\s+([0-9]+)' )
  
          # look for the openssl version header on the compiler search path.
          opensslv_h = find_file('openssl/opensslv.h', [],
@@ -106,7 +111,18 @@
          if opensslv_h:
              name = os.path.join(opensslv_h[0], 'openssl/opensslv.h')
              if host_platform == 'darwin' and is_macosx_sdk_path(name):
-@@ -988,175 +989,6 @@ class PyBuildExt(build_ext):
+@@ -899,6 +902,10 @@ class PyBuildExt(build_ext):
+                     m = openssl_ver_re.match(line)
+                     if m:
+                         openssl_ver = eval(m.group(1))
++                        break
++                    m = openssl_ver_major.match(line)
++                    if m and eval(m.group(1)) >= 3:
++                        openssl_ver = 0x03000000
+             except IOError, msg:
+                 print "IOError while reading opensshv.h:", msg
+                 pass
+@@ -988,175 +995,6 @@ class PyBuildExt(build_ext):
              else:
                  raise ValueError("unknown major BerkeleyDB version", major)
  
@@ -282,7 +298,7 @@
          # The sqlite interface
          sqlite_setup_debug = False   # verbose debug prints from this script?
  
-@@ -1262,46 +1094,32 @@ class PyBuildExt(build_ext):
+@@ -1262,46 +1100,32 @@ class PyBuildExt(build_ext):
          else:
              missing.append('_sqlite3')
  
@@ -352,7 +368,7 @@
              config_args = [arg.strip("'")
                             for arg in sysconfig.get_config_var("CONFIG_ARGS").split()]
              dbm_args = [arg for arg in config_args
-@@ -1313,7 +1131,7 @@ class PyBuildExt(build_ext):
+@@ -1313,7 +1137,7 @@ class PyBuildExt(build_ext):
              dbmext = None
              for cand in dbm_order:
                  if cand == "ndbm":
@@ -361,7 +377,7 @@
                          # Some systems have -lndbm, others have -lgdbm_compat,
                          # others don't have either
                          if self.compiler.find_library_file(lib_dirs,
-@@ -1357,18 +1175,14 @@ class PyBuildExt(build_ext):
+@@ -1357,18 +1181,14 @@ class PyBuildExt(build_ext):
                                  libraries = gdbm_libs)
                              break
                  elif cand == "bdb":
@@ -388,7 +404,7 @@
              if dbmext is not None:
                  exts.append(dbmext)
              else:
-@@ -1429,8 +1243,7 @@ class PyBuildExt(build_ext):
+@@ -1429,8 +1249,7 @@ class PyBuildExt(build_ext):
              missing.append('_curses')
  
          # If the curses module is enabled, check for the panel module
@@ -398,7 +414,7 @@
              exts.append( Extension('_curses_panel', ['_curses_panel.c'],
                                     include_dirs = curses_incs,
                                     libraries = [panel_library] + curses_libs) )
-@@ -2129,6 +1942,7 @@ class PyBuildExt(build_ext):
+@@ -2129,6 +1948,7 @@ class PyBuildExt(build_ext):
  
          if host_platform == 'darwin':
              sources.append('_ctypes/malloc_closure.c')
@@ -406,7 +422,7 @@
              sources.append('_ctypes/darwin/dlfcn_simple.c')
              extra_compile_args.append('-DMACOSX')
              include_dirs.append('_ctypes/darwin')
-@@ -2191,6 +2005,16 @@ class PyBuildExt(build_ext):
+@@ -2191,6 +2011,16 @@ class PyBuildExt(build_ext):
                      break
  
          if ffi_inc and ffi_lib:
@@ -423,7 +439,7 @@
              ext.include_dirs.extend(ffi_inc)
              ext.libraries.append(ffi_lib)
              self.use_system_libffi = True
-@@ -2342,9 +2166,9 @@ def main():
+@@ -2342,9 +2172,9 @@ def main():
            ext_modules=[Extension('_struct', ['_struct.c'])],
  
            # Scripts to install



Home | Main Index | Thread Index | Old Index