Annotation of pkgsrc/lang/python35/patches/patch-setup.py, revision 1.2

1.2     ! adam        1: $NetBSD: patch-setup.py,v 1.1 2015/12/05 17:12:13 adam Exp $
1.1       adam        2: 
1.2     ! adam        3: --- setup.py.orig      2016-06-25 21:38:39.000000000 +0000
1.1       adam        4: +++ setup.py
1.2     ! adam        5: @@ -44,7 +44,8 @@ host_platform = get_platform()
1.1       adam        6:  COMPILED_WITH_PYDEBUG = ('--with-pydebug' in sysconfig.get_config_var("CONFIG_ARGS"))
                      7:  
                      8:  # This global variable is used to hold the list of modules to be disabled.
                      9: -disabled_module_list = []
                     10: +disabled_module_list = ["_bsddb", "_curses", "_curses_panel", "_elementtree",
                     11: +"_sqlite3", "_tkinter", "_gdbm", "pyexpat", "readline", "spwd", "xxlimited"]
                     12:  
                     13:  def add_dir_to_list(dirlist, dir):
                     14:      """Add the directory 'dir' to the list 'dirlist' (after any relative
1.2     ! adam       15: @@ -488,15 +489,15 @@ class PyBuildExt(build_ext):
        !            16:              return ['m']
1.1       adam       17:  
                     18:      def detect_modules(self):
                     19: -        # Ensure that /usr/local is always used, but the local build
                     20: -        # directories (i.e. '.' and 'Include') must be first.  See issue
                     21: -        # 10520.
                     22: -        if not cross_compiling:
                     23: -            add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
                     24: -            add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
                     25: -        # only change this for cross builds for 3.3, issues on Mageia
                     26: -        if cross_compiling:
                     27: -            self.add_gcc_paths()
                     28: +        # Add the buildlink directories for pkgsrc
                     29: +        if os.environ.get('BUILDLINK_DIR'):
                     30: +            dir = os.environ['BUILDLINK_DIR']
                     31: +            libdir = dir + '/lib'
                     32: +            incdir = dir + '/include'
                     33: +            if libdir not in self.compiler.library_dirs:
                     34: +                self.compiler.library_dirs.insert(0, libdir)
                     35: +            if incdir not in self.compiler.include_dirs:
                     36: +                self.compiler.include_dirs.insert(0, incdir)
                     37:          self.add_multiarch_paths()
                     38:  
                     39:          # Add paths specified in the environment variables LDFLAGS and
1.2     ! adam       40: @@ -809,8 +810,7 @@ class PyBuildExt(build_ext):
1.1       adam       41:                                 depends = ['socketmodule.h']) )
                     42:          # Detect SSL support for the socket module (via _ssl)
                     43:          search_for_ssl_incs_in = [
                     44: -                              '/usr/local/ssl/include',
                     45: -                              '/usr/contrib/ssl/include/'
                     46: +                              '@SSLBASE@/include'
                     47:                               ]
                     48:          ssl_incs = find_file('openssl/ssl.h', inc_dirs,
                     49:                               search_for_ssl_incs_in
1.2     ! adam       50: @@ -821,9 +821,7 @@ class PyBuildExt(build_ext):
1.1       adam       51:              if krb5_h:
                     52:                  ssl_incs += krb5_h
                     53:          ssl_libs = find_library_file(self.compiler, 'ssl',lib_dirs,
                     54: -                                     ['/usr/local/ssl/lib',
                     55: -                                      '/usr/contrib/ssl/lib/'
                     56: -                                     ] )
                     57: +                                     [] )
                     58:  
                     59:          if (ssl_incs is not None and
                     60:              ssl_libs is not None):
1.2     ! adam       61: @@ -842,7 +840,7 @@ class PyBuildExt(build_ext):
1.1       adam       62:  
                     63:          # look for the openssl version header on the compiler search path.
                     64:          opensslv_h = find_file('openssl/opensslv.h', [],
                     65: -                inc_dirs + search_for_ssl_incs_in)
                     66: +                search_for_ssl_incs_in + inc_dirs)
                     67:          if opensslv_h:
                     68:              name = os.path.join(opensslv_h[0], 'openssl/opensslv.h')
                     69:              if host_platform == 'darwin' and is_macosx_sdk_path(name):
1.2     ! adam       70: @@ -1216,6 +1214,30 @@ class PyBuildExt(build_ext):
1.1       adam       71:          dbm_order = ['gdbm']
                     72:          # The standard Unix dbm module:
                     73:          if host_platform not in ['cygwin']:
                     74: +
                     75: +            ## Top half based on find_file
                     76: +            def find_ndbm_h(dirs):
                     77: +                ret = None
                     78: +                if sys.platform == 'darwin':
                     79: +                    sysroot = macosx_sdk_root()
                     80: +                for dir in dirs:
                     81: +                    f = os.path.join(dir, 'ndbm.h')
                     82: +                    if sys.platform == 'darwin' and is_macosx_sdk_path(dir):
                     83: +                        f = os.path.join(sysroot, dir[1:], 'ndbm.h')
                     84: +                    if not os.path.exists(f): continue
                     85: +
                     86: +                    ret = 'True'
                     87: +                    input = text_file.TextFile(f)
                     88: +                    while 1:
                     89: +                        line = input.readline()
                     90: +                        if not line: break
                     91: +                        if re.search('This file is part of GDBM', line):
                     92: +                            ret = None
                     93: +                            break
                     94: +                    input.close()
                     95: +                    break
                     96: +                return ret
                     97: +
                     98:              config_args = [arg.strip("'")
                     99:                             for arg in sysconfig.get_config_var("CONFIG_ARGS").split()]
                    100:              dbm_args = [arg for arg in config_args
1.2     ! adam      101: @@ -1227,7 +1249,7 @@ class PyBuildExt(build_ext):
1.1       adam      102:              dbmext = None
                    103:              for cand in dbm_order:
                    104:                  if cand == "ndbm":
                    105: -                    if find_file("ndbm.h", inc_dirs, []) is not None:
                    106: +                    if find_ndbm_h(inc_dirs) is not None:
                    107:                          # Some systems have -lndbm, others have -lgdbm_compat,
                    108:                          # others don't have either
                    109:                          if self.compiler.find_library_file(lib_dirs,
1.2     ! adam      110: @@ -2027,10 +2049,7 @@ class PyBuildExt(build_ext):
1.1       adam      111:              depends = ['_decimal/docstrings.h']
                    112:          else:
                    113:              srcdir = sysconfig.get_config_var('srcdir')
                    114: -            include_dirs = [os.path.abspath(os.path.join(srcdir,
                    115: -                                                         'Modules',
                    116: -                                                         '_decimal',
                    117: -                                                         'libmpdec'))]
                    118: +            include_dirs = ['Modules/_decimal/libmpdec']
                    119:              libraries = []
                    120:              sources = [
                    121:                '_decimal/_decimal.c',
1.2     ! adam      122: @@ -2276,7 +2295,7 @@ def main():
1.1       adam      123:            # If you change the scripts installed here, you also need to
                    124:            # check the PyBuildScripts command above, and change the links
                    125:            # created by the bininstall target in Makefile.pre.in
                    126: -          scripts = ["Tools/scripts/pydoc3", "Tools/scripts/idle3",
                    127: +          scripts = ["Tools/scripts/pydoc3",
                    128:                       "Tools/scripts/2to3", "Tools/scripts/pyvenv"]
                    129:          )
                    130:  

CVSweb <webmaster@jp.NetBSD.org>