pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/lang python3{7,8,9}: build fix when include files have...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/5c3774f99293
branches:  trunk
changeset: 442157:5c3774f99293
user:      bsiegert <bsiegert%pkgsrc.org@localhost>
date:      Thu Nov 19 16:29:42 2020 +0000

description:
python3{7,8,9}: build fix when include files have invalid UTF-8

I happen to have include/gts.h installed, which includes an accented
ISO-8859-1 character in its copyright message. This trips up the configuration
of Python in pkgsrc.

Ignore files with invalid unicode characters.

Also regenerate one other patch. No revision bump since the result is the same.

diffstat:

 lang/python37/distinfo                                   |   6 +-
 lang/python37/patches/patch-Modules___ctypes_callbacks.c |   6 +-
 lang/python37/patches/patch-setup.py                     |  37 ++++++++-------
 lang/python38/distinfo                                   |   4 +-
 lang/python38/patches/patch-setup.py                     |  37 ++++++++-------
 lang/python39/distinfo                                   |   4 +-
 lang/python39/patches/patch-setup.py                     |  37 ++++++++-------
 7 files changed, 70 insertions(+), 61 deletions(-)

diffs (truncated from 494 to 300 lines):

diff -r 898eea1f4601 -r 5c3774f99293 lang/python37/distinfo
--- a/lang/python37/distinfo    Thu Nov 19 15:10:07 2020 +0000
+++ b/lang/python37/distinfo    Thu Nov 19 16:29:42 2020 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.23 2020/11/18 11:03:31 sjmulder Exp $
+$NetBSD: distinfo,v 1.24 2020/11/19 16:29:42 bsiegert Exp $
 
 SHA1 (Python-3.7.9.tar.xz) = e1de02779a89a94000c0ed340ec126de25825f2f
 RMD160 (Python-3.7.9.tar.xz) = 6ff3676f84b1a103b0e3161dcc7257936c914daf
@@ -22,7 +22,7 @@
 SHA1 (patch-Mac_BuildScript_build-installer.py) = a377ed164ee2ba72ce0f72ccf9507e775f7b7deb
 SHA1 (patch-Mac_Tools_pythonw.c) = 94f27032aac27263bc1c1bd66574121fbca1e380
 SHA1 (patch-Makefile.pre.in) = 1393dac225c5a7edcb7947eb707b4526ea884f95
-SHA1 (patch-Modules___ctypes_callbacks.c) = 739462325d430d2b57483738d94a3174e36e50e1
+SHA1 (patch-Modules___ctypes_callbacks.c) = 98bd449f9c4bf3acbcfdd24d017f490fc0c9326e
 SHA1 (patch-Modules___ctypes_callproc.c) = d0905ede69f2c61d917380d6da73c14e7e31d41f
 SHA1 (patch-Modules___ctypes_ctypes.h) = 2589d24c101771f8696b456d594e5f53305cf72c
 SHA1 (patch-Modules___ctypes_malloc__closure.c) = 780e7dfa293c57dc28e97358937ed7d148414c8e
@@ -39,4 +39,4 @@
 SHA1 (patch-configure) = 2c7d3fb29c2fc9a7a75adbddf7399f5e69baeaca
 SHA1 (patch-configure.ac) = 948e925ef2595058a902ad60762158f16d13db80
 SHA1 (patch-pyconfig.h.in) = 1a837a44c9b4f6e538909dba70482082e5a6b80f
-SHA1 (patch-setup.py) = d42d76b6edc5b5b7855b2888e0df7ab723ade6a5
+SHA1 (patch-setup.py) = 1013fb71ab176305dfd598cd1c2c798603000f18
diff -r 898eea1f4601 -r 5c3774f99293 lang/python37/patches/patch-Modules___ctypes_callbacks.c
--- a/lang/python37/patches/patch-Modules___ctypes_callbacks.c  Thu Nov 19 15:10:07 2020 +0000
+++ b/lang/python37/patches/patch-Modules___ctypes_callbacks.c  Thu Nov 19 16:29:42 2020 +0000
@@ -1,4 +1,4 @@
-$NetBSD: patch-Modules___ctypes_callbacks.c,v 1.2 2020/11/18 11:03:31 sjmulder Exp $
+$NetBSD: patch-Modules___ctypes_callbacks.c,v 1.3 2020/11/19 16:29:42 bsiegert Exp $
 
 Support for macOS 11 and Apple Silicon (ARM). Mostly backported from:
 https://github.com/python/cpython/pull/22855
@@ -62,14 +62,14 @@
 +#ifdef MACOSX
 +        #pragma clang diagnostic push
 +        #pragma clang diagnostic ignored "-Wdeprecated-declarations"
-+#endif
+ #endif
 +        result = ffi_prep_closure(p->pcl_write, &p->cif, closure_fcn, p);
 +
 +#ifdef MACOSX
 +        #pragma clang diagnostic pop
 +#endif
 +
- #endif
++#endif
 +    }
      if (result != FFI_OK) {
          PyErr_Format(PyExc_RuntimeError,
diff -r 898eea1f4601 -r 5c3774f99293 lang/python37/patches/patch-setup.py
--- a/lang/python37/patches/patch-setup.py      Thu Nov 19 15:10:07 2020 +0000
+++ b/lang/python37/patches/patch-setup.py      Thu Nov 19 16:29:42 2020 +0000
@@ -1,4 +1,4 @@
-$NetBSD: patch-setup.py,v 1.2 2020/11/17 19:33:26 sjmulder Exp $
+$NetBSD: patch-setup.py,v 1.3 2020/11/19 16:29:42 bsiegert Exp $
 
 Disable certain modules, so they can be built as separate packages.
 
@@ -31,21 +31,24 @@
  
  def add_dir_to_list(dirlist, dir):
      """Add the directory 'dir' to the list 'dirlist' (after any relative
-@@ -150,6 +151,13 @@ def is_macosx_sdk_path(path):
+@@ -150,6 +151,16 @@ def is_macosx_sdk_path(path):
                  or path.startswith('/System/')
                  or path.startswith('/Library/') )
  
 +def grep_headers_for(function, headers):
 +    for header in headers:
-+        with open(header, 'r') as f:
-+            if function in f.read():
-+                return True
++        try:
++            with open(header, 'r') as f:
++                if function in f.read():
++                    return True
++        except UnicodeDecodeError:
++            pass
 +    return False
 +
  def find_file(filename, std_dirs, paths):
      """Searches for the directory where a given file is located,
      and returns a possibly-empty list of additional directories, or None
-@@ -581,15 +589,15 @@ class PyBuildExt(build_ext):
+@@ -581,15 +592,15 @@ class PyBuildExt(build_ext):
              os.unlink(tmpfile)
  
      def detect_modules(self):
@@ -70,7 +73,7 @@
          self.add_multiarch_paths()
  
          # Add paths specified in the environment variables LDFLAGS and
-@@ -673,6 +681,9 @@ class PyBuildExt(build_ext):
+@@ -673,6 +684,9 @@ class PyBuildExt(build_ext):
              lib_dirs += ['/usr/lib/hpux64', '/usr/lib/hpux32']
  
          if host_platform == 'darwin':
@@ -80,7 +83,7 @@
              # This should work on any unixy platform ;-)
              # If the user has bothered specifying additional -I and -L flags
              # in OPT and LDFLAGS we might as well use them here.
-@@ -854,8 +865,6 @@ class PyBuildExt(build_ext):
+@@ -854,8 +868,6 @@ class PyBuildExt(build_ext):
          # use the same library for the readline and curses modules.
          if 'curses' in readline_termcap_library:
              curses_library = readline_termcap_library
@@ -89,7 +92,7 @@
          elif self.compiler.find_library_file(lib_dirs, 'ncurses'):
              curses_library = 'ncurses'
          elif self.compiler.find_library_file(lib_dirs, 'curses'):
-@@ -1285,6 +1294,30 @@ class PyBuildExt(build_ext):
+@@ -1285,6 +1297,30 @@ class PyBuildExt(build_ext):
          dbm_order = ['gdbm']
          # The standard Unix dbm module:
          if host_platform not in ['cygwin']:
@@ -120,7 +123,7 @@
              config_args = [arg.strip("'")
                             for arg in sysconfig.get_config_var("CONFIG_ARGS").split()]
              dbm_args = [arg for arg in config_args
-@@ -1296,7 +1329,7 @@ class PyBuildExt(build_ext):
+@@ -1296,7 +1332,7 @@ class PyBuildExt(build_ext):
              dbmext = None
              for cand in dbm_order:
                  if cand == "ndbm":
@@ -129,7 +132,7 @@
                          # Some systems have -lndbm, others have -lgdbm_compat,
                          # others don't have either
                          if self.compiler.find_library_file(lib_dirs,
-@@ -1428,8 +1461,7 @@ class PyBuildExt(build_ext):
+@@ -1428,8 +1464,7 @@ class PyBuildExt(build_ext):
              missing.append('_curses')
  
          # If the curses module is enabled, check for the panel module
@@ -139,7 +142,7 @@
              exts.append( Extension('_curses_panel', ['_curses_panel.c'],
                                     include_dirs=curses_includes,
                                     define_macros=curses_defines,
-@@ -1670,6 +1702,8 @@ class PyBuildExt(build_ext):
+@@ -1670,6 +1705,8 @@ class PyBuildExt(build_ext):
  
          # Build the _uuid module if possible
          uuid_incs = find_file("uuid.h", inc_dirs, ["/usr/include/uuid"])
@@ -148,7 +151,7 @@
          if uuid_incs is not None:
              if self.compiler.find_library_file(lib_dirs, 'uuid'):
                  uuid_libs = ['uuid']
-@@ -1936,43 +1970,15 @@ class PyBuildExt(build_ext):
+@@ -1936,43 +1973,15 @@ class PyBuildExt(build_ext):
          # *** Uncomment these for TOGL extension only:
          #       -lGL -lGLU -lXext -lXmu \
  
@@ -197,7 +200,7 @@
          include_dirs = []
          extra_compile_args = []
          extra_link_args = []
-@@ -1985,11 +1991,9 @@ class PyBuildExt(build_ext):
+@@ -1985,11 +1994,9 @@ class PyBuildExt(build_ext):
  
          if host_platform == 'darwin':
              sources.append('_ctypes/malloc_closure.c')
@@ -210,7 +213,7 @@
  
          elif host_platform == 'sunos5':
              # XXX This shouldn't be necessary; it appears that some
-@@ -2018,30 +2022,48 @@ class PyBuildExt(build_ext):
+@@ -2018,30 +2025,48 @@ class PyBuildExt(build_ext):
                       libraries=['m'])
          self.extensions.extend([ext, ext_test])
  
@@ -273,7 +276,7 @@
              ext.libraries.append(ffi_lib)
              self.use_system_libffi = True
  
-@@ -2059,10 +2081,7 @@ class PyBuildExt(build_ext):
+@@ -2059,10 +2084,7 @@ class PyBuildExt(build_ext):
              depends = ['_decimal/docstrings.h']
          else:
              srcdir = sysconfig.get_config_var('srcdir')
@@ -285,7 +288,7 @@
              libraries = ['m']
              sources = [
                '_decimal/_decimal.c',
-@@ -2398,7 +2417,7 @@ def main():
+@@ -2398,7 +2420,7 @@ def main():
            # If you change the scripts installed here, you also need to
            # check the PyBuildScripts command above, and change the links
            # created by the bininstall target in Makefile.pre.in
diff -r 898eea1f4601 -r 5c3774f99293 lang/python38/distinfo
--- a/lang/python38/distinfo    Thu Nov 19 15:10:07 2020 +0000
+++ b/lang/python38/distinfo    Thu Nov 19 16:29:42 2020 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.14 2020/11/18 10:51:01 sjmulder Exp $
+$NetBSD: distinfo,v 1.15 2020/11/19 16:29:42 bsiegert Exp $
 
 SHA1 (Python-3.8.6.tar.xz) = 6ee446eaacf901a3305565bd6569e2de135168e3
 RMD160 (Python-3.8.6.tar.xz) = 89c134d2d1bc02975cf959cc4a7ee63dba5c5388
@@ -38,4 +38,4 @@
 SHA1 (patch-configure) = c63ae7364c69fed98d366fd2b6a727a71b10defc
 SHA1 (patch-configure.ac) = 2b341061350671d820d696a659176a35a93d800d
 SHA1 (patch-pyconfig.h.in) = 6e24f401286768641c7d69dd75cfe18f1d8df1e7
-SHA1 (patch-setup.py) = 2211bfe01c6c53f5c9852f9569a31975f7b7cb5e
+SHA1 (patch-setup.py) = f5cd4ec25c8a5725a39970a097ddfb7068370db8
diff -r 898eea1f4601 -r 5c3774f99293 lang/python38/patches/patch-setup.py
--- a/lang/python38/patches/patch-setup.py      Thu Nov 19 15:10:07 2020 +0000
+++ b/lang/python38/patches/patch-setup.py      Thu Nov 19 16:29:42 2020 +0000
@@ -1,4 +1,4 @@
-$NetBSD: patch-setup.py,v 1.4 2020/11/17 19:33:15 sjmulder Exp $
+$NetBSD: patch-setup.py,v 1.5 2020/11/19 16:29:42 bsiegert Exp $
 
  - Disable certain modules, so they can be built as separate packages.
  - Do not look for ncursesw.
@@ -28,21 +28,24 @@
  
  
  def get_platform():
-@@ -188,6 +188,13 @@ def is_macosx_sdk_path(path):
+@@ -188,6 +188,16 @@ def is_macosx_sdk_path(path):
                  or path.startswith('/Library/') )
  
  
 +def grep_headers_for(function, headers):
 +    for header in headers:
-+        with open(header, 'r') as f:
-+            if function in f.read():
-+                return True
++        try:
++            with open(header, 'r') as f:
++                if function in f.read():
++                    return True
++        except UnicodeDecodeError:
++            pass
 +    return False
 +
  def find_file(filename, std_dirs, paths):
      """Searches for the directory where a given file is located,
      and returns a possibly-empty list of additional directories, or None
-@@ -645,15 +652,15 @@ class PyBuildExt(build_ext):
+@@ -645,15 +655,15 @@ class PyBuildExt(build_ext):
                          add_dir_to_list(dir_list, directory)
  
      def configure_compiler(self):
@@ -67,7 +70,7 @@
          self.add_multiarch_paths()
          self.add_ldflags_cppflags()
  
-@@ -701,6 +708,9 @@ class PyBuildExt(build_ext):
+@@ -701,6 +711,9 @@ class PyBuildExt(build_ext):
              self.lib_dirs += ['/usr/lib/hpux64', '/usr/lib/hpux32']
  
          if MACOS:
@@ -77,7 +80,7 @@
              # This should work on any unixy platform ;-)
              # If the user has bothered specifying additional -I and -L flags
              # in OPT and LDFLAGS we might as well use them here.
-@@ -912,8 +922,6 @@ class PyBuildExt(build_ext):
+@@ -912,8 +925,6 @@ class PyBuildExt(build_ext):
          # use the same library for the readline and curses modules.
          if 'curses' in readline_termcap_library:
              curses_library = readline_termcap_library
@@ -86,7 +89,7 @@
          # Issue 36210: OSS provided ncurses does not link on AIX
          # Use IBM supplied 'curses' for successful build of _curses
          elif AIX and self.compiler.find_library_file(self.lib_dirs, 'curses'):
-@@ -1015,8 +1023,7 @@ class PyBuildExt(build_ext):
+@@ -1015,8 +1026,7 @@ class PyBuildExt(build_ext):
          # If the curses module is enabled, check for the panel module
          # _curses_panel needs some form of ncurses
          skip_curses_panel = True if AIX else False
@@ -96,7 +99,7 @@
              self.add(Extension('_curses_panel', ['_curses_panel.c'],
                                 include_dirs=curses_includes,
                                 define_macros=curses_defines,
-@@ -1263,6 +1270,31 @@ class PyBuildExt(build_ext):
+@@ -1263,6 +1273,31 @@ class PyBuildExt(build_ext):
          dbm_order = ['gdbm']
          # The standard Unix dbm module:
          if not CYGWIN:
@@ -128,7 +131,7 @@
              config_args = [arg.strip("'")
                             for arg in sysconfig.get_config_var("CONFIG_ARGS").split()]
              dbm_args = [arg for arg in config_args
-@@ -1274,7 +1306,7 @@ class PyBuildExt(build_ext):
+@@ -1274,7 +1309,7 @@ class PyBuildExt(build_ext):
              dbmext = None
              for cand in dbm_order:
                  if cand == "ndbm":
@@ -137,7 +140,7 @@
                          # Some systems have -lndbm, others have -lgdbm_compat,
                          # others don't have either
                          if self.compiler.find_library_file(self.lib_dirs,
-@@ -1674,6 +1706,8 @@ class PyBuildExt(build_ext):
+@@ -1674,6 +1709,8 @@ class PyBuildExt(build_ext):
      def detect_uuid(self):
          # Build the _uuid module if possible
          uuid_incs = find_file("uuid.h", self.inc_dirs, ["/usr/include/uuid"])
@@ -146,7 +149,7 @@
          if uuid_incs is not None:
              if self.compiler.find_library_file(self.lib_dirs, 'uuid'):
                  uuid_libs = ['uuid']



Home | Main Index | Thread Index | Old Index