jenkins-core-weekly: update to 2.491
[oi-userland.git] / components / python / python39 / patches / 01-setup.patch
blob83a8123a2387e6ab4b63729f79d3539aa88b0885
1 diff -wpruN '--exclude=*.orig' a~/setup.py a/setup.py
2 --- a~/setup.py 1970-01-01 00:00:00
3 +++ a/setup.py 1970-01-01 00:00:00
4 @@ -64,6 +64,7 @@ MS_WINDOWS = (HOST_PLATFORM == 'win32')
5 CYGWIN = (HOST_PLATFORM == 'cygwin')
6 MACOS = (HOST_PLATFORM == 'darwin')
7 AIX = (HOST_PLATFORM.startswith('aix'))
8 +ILLUMOS = (HOST_PLATFORM == 'sunos5')
9 VXWORKS = ('vxworks' in HOST_PLATFORM)
12 @@ -731,7 +732,7 @@ class PyBuildExt(build_ext):
13 # Ensure that /usr/local is always used, but the local build
14 # directories (i.e. '.' and 'Include') must be first. See issue
15 # 10520.
16 - if not CROSS_COMPILING:
17 + if not ILLUMOS and not CROSS_COMPILING:
18 add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
19 add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
20 # only change this for cross builds for 3.3, issues on Mageia
21 @@ -1045,6 +1046,14 @@ class PyBuildExt(build_ext):
22 ['/usr/lib/termcap'],
23 'termcap'):
24 readline_libs.append('termcap')
26 + if ILLUMOS:
27 + # insert '-zrecord' before the readline libraries that we
28 + # want to link with to avoid rl_insert() elimination
29 + readline_extra_link_args = ('-Wl,-zrecord','-lreadline',
30 + '-lncurses')
31 + readline_libs = ()
33 self.add(Extension('readline', ['readline.c'],
34 library_dirs=['/usr/lib/termcap'],
35 extra_link_args=readline_extra_link_args,
36 @@ -1079,6 +1088,12 @@ class PyBuildExt(build_ext):
38 curses_enabled = True
39 if curses_library.startswith('ncurses'):
41 + if ILLUMOS:
42 + curses_defines.append(('HAVE_NCURSESW', '1'))
43 + curses_defines.append(('_XOPEN_SOURCE_EXTENDED', '1'))
44 + curses_includes.append('/usr/include/ncurses')
46 curses_libs = [curses_library]
47 self.add(Extension('_curses', ['_cursesmodule.c'],
48 include_dirs=curses_includes,
49 @@ -1106,10 +1121,15 @@ class PyBuildExt(build_ext):
50 skip_curses_panel = True if AIX else False
51 if (curses_enabled and not skip_curses_panel and
52 self.compiler.find_library_file(self.lib_dirs, panel_library)):
53 + panel_lib_dirs = []
54 + if ILLUMOS:
55 + panel_lib_dirs.append('/usr/gnu/lib/amd64')
56 self.add(Extension('_curses_panel', ['_curses_panel.c'],
57 include_dirs=curses_includes,
58 define_macros=curses_defines,
59 - libraries=[panel_library, *curses_libs]))
60 + libraries=[panel_library, *curses_libs],
61 + library_dirs = panel_lib_dirs,
62 + runtime_library_dirs = panel_lib_dirs))
63 elif not skip_curses_panel:
64 self.missing.append('_curses_panel')