pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/lang python{39,310}: fix build failure when py-setupto...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/be37d3a9e669
branches:  trunk
changeset: 371656:be37d3a9e669
user:      tnn <tnn%pkgsrc.org@localhost>
date:      Tue Jan 11 15:13:20 2022 +0000

description:
python{39,310}: fix build failure when py-setuptools are installed already

diffstat:

 lang/python310/distinfo               |   4 +-
 lang/python310/patches/patch-setup.py |  34 +++++++++++++++++++++-----------
 lang/python39/distinfo                |   4 +-
 lang/python39/patches/patch-setup.py  |  36 ++++++++++++++++++++++------------
 4 files changed, 49 insertions(+), 29 deletions(-)

diffs (269 lines):

diff -r 7ac5346f4953 -r be37d3a9e669 lang/python310/distinfo
--- a/lang/python310/distinfo   Tue Jan 11 13:54:01 2022 +0000
+++ b/lang/python310/distinfo   Tue Jan 11 15:13:20 2022 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.7 2021/12/11 10:40:58 wiz Exp $
+$NetBSD: distinfo,v 1.8 2022/01/11 15:13:20 tnn Exp $
 
 BLAKE2s (Python-3.10.1.tar.xz) = a7004c16f0c40d927424d512cd5130cd2955315f50d804c289fc10d48f5a1d5c
 SHA512 (Python-3.10.1.tar.xz) = 1c559e33f1252e51bafb941c380de16f142c0735858363c84cb8dbed6767843de3af126889c2826ffb94bd4777d7cdfc31040301c8c74de56af52b80b1aa9e76
@@ -14,4 +14,4 @@
 SHA1 (patch-Python_thread__pthread.h) = bf1aeab011b3afedc02e68fcf5cef091b3e0aefa
 SHA1 (patch-configure) = db79c9e00f2f804ff8497dbad0874658cc363db6
 SHA1 (patch-pyconfig.h.in) = 1ab77914315acbf0352d242ed66200bea54548f6
-SHA1 (patch-setup.py) = b91c42fca28f13a1ef765e35b21d8fe28d86b941
+SHA1 (patch-setup.py) = 0fe71d24fb58da914dd04a169ff2e3b75168726a
diff -r 7ac5346f4953 -r be37d3a9e669 lang/python310/patches/patch-setup.py
--- a/lang/python310/patches/patch-setup.py     Tue Jan 11 13:54:01 2022 +0000
+++ b/lang/python310/patches/patch-setup.py     Tue Jan 11 15:13:20 2022 +0000
@@ -1,13 +1,23 @@
-$NetBSD: patch-setup.py,v 1.2 2021/12/07 09:31:09 adam Exp $
+$NetBSD: patch-setup.py,v 1.3 2022/01/11 15:13:20 tnn Exp $
 
 Disable certain modules, so they can be built as separate packages.
 Do not look for ncursesw.
 Assume panel_library is correct; this is a fix for ncurses' gnupanel
 which will get transformed to panel in buildlink.
+Don't search for modules in PREFIX. Fixes build failure when py-setuptools
+  are installed.  
 
 --- setup.py.orig      2021-12-06 18:23:39.000000000 +0000
 +++ setup.py
-@@ -45,6 +45,7 @@ with warnings.catch_warnings():
+@@ -13,6 +13,7 @@ import warnings
+ from glob import glob, escape
+ import _osx_support
+ 
++sys.path = [p for p in sys.path if not re.compile('^' + sys.base_prefix).match(p)]
+ 
+ try:
+     import subprocess
+@@ -45,6 +46,7 @@ with warnings.catch_warnings():
          DeprecationWarning
      )
  
@@ -15,7 +25,7 @@
      from distutils.command.build_ext import build_ext
      from distutils.command.build_scripts import build_scripts
      from distutils.command.install import install
-@@ -58,7 +59,7 @@ with warnings.catch_warnings():
+@@ -58,7 +60,7 @@ with warnings.catch_warnings():
  TEST_EXTENSIONS = (sysconfig.get_config_var('TEST_MODULES') == 'yes')
  
  # This global variable is used to hold the list of modules to be disabled.
@@ -24,7 +34,7 @@
  
  # --list-module-names option used by Tools/scripts/generate_module_names.py
  LIST_MODULE_NAMES = False
-@@ -249,6 +250,16 @@ def grep_headers_for(function, headers):
+@@ -249,6 +251,16 @@ def grep_headers_for(function, headers):
      return False
  
  
@@ -41,7 +51,7 @@
  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
-@@ -821,15 +832,15 @@ class PyBuildExt(build_ext):
+@@ -821,15 +833,15 @@ class PyBuildExt(build_ext):
                          add_dir_to_list(dir_list, directory)
  
      def configure_compiler(self):
@@ -66,7 +76,7 @@
          self.add_multiarch_paths()
          self.add_ldflags_cppflags()
  
-@@ -877,6 +888,9 @@ class PyBuildExt(build_ext):
+@@ -877,6 +889,9 @@ class PyBuildExt(build_ext):
              self.lib_dirs += ['/usr/lib/hpux64', '/usr/lib/hpux32']
  
          if MACOS:
@@ -76,7 +86,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.
-@@ -1104,8 +1118,6 @@ class PyBuildExt(build_ext):
+@@ -1104,8 +1119,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
@@ -85,7 +95,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'):
-@@ -1209,8 +1221,7 @@ class PyBuildExt(build_ext):
+@@ -1209,8 +1222,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
@@ -95,7 +105,7 @@
              self.add(Extension('_curses_panel', ['_curses_panel.c'],
                             include_dirs=curses_includes,
                             define_macros=curses_defines,
-@@ -1455,6 +1466,31 @@ class PyBuildExt(build_ext):
+@@ -1455,6 +1467,31 @@ class PyBuildExt(build_ext):
          dbm_order = ['gdbm']
          # The standard Unix dbm module:
          if not CYGWIN:
@@ -127,7 +137,7 @@
              config_args = [arg.strip("'")
                             for arg in sysconfig.get_config_var("CONFIG_ARGS").split()]
              dbm_args = [arg for arg in config_args
-@@ -1466,7 +1502,7 @@ class PyBuildExt(build_ext):
+@@ -1466,7 +1503,7 @@ class PyBuildExt(build_ext):
              dbmext = None
              for cand in dbm_order:
                  if cand == "ndbm":
@@ -136,7 +146,7 @@
                          # Some systems have -lndbm, others have -lgdbm_compat,
                          # others don't have either
                          if self.compiler.find_library_file(self.lib_dirs,
-@@ -2326,10 +2362,7 @@ class PyBuildExt(build_ext):
+@@ -2326,10 +2363,7 @@ class PyBuildExt(build_ext):
              sources = ['_decimal/_decimal.c']
              depends = ['_decimal/docstrings.h']
          else:
@@ -148,7 +158,7 @@
              libraries = ['m']
              sources = [
                '_decimal/_decimal.c',
-@@ -2745,7 +2778,7 @@ def main():
+@@ -2745,7 +2779,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 7ac5346f4953 -r be37d3a9e669 lang/python39/distinfo
--- a/lang/python39/distinfo    Tue Jan 11 13:54:01 2022 +0000
+++ b/lang/python39/distinfo    Tue Jan 11 15:13:20 2022 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.19 2021/12/06 16:36:15 wiz Exp $
+$NetBSD: distinfo,v 1.20 2022/01/11 15:13:20 tnn Exp $
 
 BLAKE2s (Python-3.9.9.tar.xz) = bb0cf5c1cb3212d82b69ab4e965f03b77736610c84bd032f31a5debdd25e6a30
 SHA512 (Python-3.9.9.tar.xz) = 0ab29fb9a7ecb808bd08d84d28908d5a934e0f021853da0f7a9c94670eb30c8dbbc233d461afdb3995b0de59275ef7e1de43e82d7f848802cbd6e6e50b7b25a6
@@ -19,4 +19,4 @@
 SHA1 (patch-Python_thread__pthread.h) = fb81eaa604b4ed7c1b64c3f4731d58a8aee257be
 SHA1 (patch-configure) = d44439b22e8444141e2632b9fd9b1f343b38b712
 SHA1 (patch-pyconfig.h.in) = 2f06af7358690b46eaff404226b898962b049a0e
-SHA1 (patch-setup.py) = 939e4e4f2641ca983b1f3c0328bd549ebf2b338a
+SHA1 (patch-setup.py) = 7bb1307806954f65c9e21d376f28554501f658ac
diff -r 7ac5346f4953 -r be37d3a9e669 lang/python39/patches/patch-setup.py
--- a/lang/python39/patches/patch-setup.py      Tue Jan 11 13:54:01 2022 +0000
+++ b/lang/python39/patches/patch-setup.py      Tue Jan 11 15:13:20 2022 +0000
@@ -1,13 +1,23 @@
-$NetBSD: patch-setup.py,v 1.5 2021/11/06 12:24:35 adam Exp $
+$NetBSD: patch-setup.py,v 1.6 2022/01/11 15:13:20 tnn Exp $
 
 Disable certain modules, so they can be built as separate packages.
 Do not look for ncursesw.
 Assume panel_library is correct; this is a fix for ncurses' gnupanel
 which will get transformed to panel in buildlink.
+Don't search for modules in PREFIX. Fixes build failure when py-setuptools
+  are installed.
 
---- setup.py.orig      2021-11-05 19:21:41.000000000 +0000
+--- setup.py.orig      2021-11-15 17:43:00.000000000 +0000
 +++ setup.py
-@@ -30,7 +30,7 @@ except ImportError:
+@@ -11,6 +11,7 @@ import sysconfig
+ from glob import glob, escape
+ import _osx_support
+ 
++sys.path = [p for p in sys.path if not re.compile('^' + sys.base_prefix).match(p)]
+ 
+ try:
+     import subprocess
+@@ -30,7 +31,7 @@ except ImportError:
      SUBPROCESS_BOOTSTRAP = True
  
  
@@ -16,7 +26,7 @@
  from distutils.command.build_ext import build_ext
  from distutils.command.build_scripts import build_scripts
  from distutils.command.install import install
-@@ -44,7 +44,7 @@ from distutils.spawn import find_executa
+@@ -44,7 +45,7 @@ from distutils.spawn import find_executa
  TEST_EXTENSIONS = True
  
  # This global variable is used to hold the list of modules to be disabled.
@@ -25,7 +35,7 @@
  
  
  def get_platform():
-@@ -224,6 +224,16 @@ def grep_headers_for(function, headers):
+@@ -224,6 +225,16 @@ def grep_headers_for(function, headers):
                  return True
      return False
  
@@ -42,7 +52,7 @@
  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
-@@ -728,15 +738,15 @@ class PyBuildExt(build_ext):
+@@ -728,15 +739,15 @@ class PyBuildExt(build_ext):
                          add_dir_to_list(dir_list, directory)
  
      def configure_compiler(self):
@@ -67,7 +77,7 @@
          self.add_multiarch_paths()
          self.add_ldflags_cppflags()
  
-@@ -784,6 +794,9 @@ class PyBuildExt(build_ext):
+@@ -784,6 +795,9 @@ class PyBuildExt(build_ext):
              self.lib_dirs += ['/usr/lib/hpux64', '/usr/lib/hpux32']
  
          if MACOS:
@@ -77,7 +87,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.
-@@ -1001,8 +1014,6 @@ class PyBuildExt(build_ext):
+@@ -1001,8 +1015,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 +96,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'):
-@@ -1104,8 +1115,7 @@ class PyBuildExt(build_ext):
+@@ -1104,8 +1116,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 +106,7 @@
              self.add(Extension('_curses_panel', ['_curses_panel.c'],
                             include_dirs=curses_includes,
                             define_macros=curses_defines,
-@@ -1356,6 +1366,31 @@ class PyBuildExt(build_ext):
+@@ -1356,6 +1367,31 @@ class PyBuildExt(build_ext):
          dbm_order = ['gdbm']
          # The standard Unix dbm module:
          if not CYGWIN:
@@ -128,7 +138,7 @@
              config_args = [arg.strip("'")
                             for arg in sysconfig.get_config_var("CONFIG_ARGS").split()]
              dbm_args = [arg for arg in config_args
-@@ -1367,7 +1402,7 @@ class PyBuildExt(build_ext):
+@@ -1367,7 +1403,7 @@ class PyBuildExt(build_ext):
              dbmext = None
              for cand in dbm_order:
                  if cand == "ndbm":
@@ -137,7 +147,7 @@
                          # Some systems have -lndbm, others have -lgdbm_compat,
                          # others don't have either
                          if self.compiler.find_library_file(self.lib_dirs,
-@@ -2207,10 +2242,7 @@ class PyBuildExt(build_ext):
+@@ -2207,10 +2243,7 @@ class PyBuildExt(build_ext):
              sources = ['_decimal/_decimal.c']
              depends = ['_decimal/docstrings.h']
          else:
@@ -149,7 +159,7 @@
              libraries = ['m']
              sources = [
                '_decimal/_decimal.c',
-@@ -2595,7 +2627,7 @@ def main():
+@@ -2595,7 +2628,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



Home | Main Index | Thread Index | Old Index