diff --git a/components/python/python-312/TODO b/components/python/python-312/TODO index 7c23bdf7fe0..f104e93b2a4 100644 --- a/components/python/python-312/TODO +++ b/components/python/python-312/TODO @@ -73,13 +73,10 @@ Look through omnios 3.11 python patches: - mod-posix-sched-priority.patch - debugger support: see the ustack.patch from omnios: https://github.com/omniosorg/omnios-build/commit/5aa7971dd8a7360d6d4f5357a4f9ff510c1b93cf#diff-49692a87e8445fd7943cb3b8fb0a696e062f39c74df2f567442e896dba02bdaf - - patches not needed: 09-ossaudiodev.patch: Not needed; upstream wraps all the exports in #ifdef so the missing ioctls are ok. diff --git a/components/python/python-312/patches-todo/01-setup.patch b/components/python/python-312/patches-todo/01-setup.patch deleted file mode 100644 index 83a8123a238..00000000000 --- a/components/python/python-312/patches-todo/01-setup.patch +++ /dev/null @@ -1,65 +0,0 @@ -diff -wpruN '--exclude=*.orig' a~/setup.py a/setup.py ---- a~/setup.py 1970-01-01 00:00:00 -+++ a/setup.py 1970-01-01 00:00:00 -@@ -64,6 +64,7 @@ MS_WINDOWS = (HOST_PLATFORM == 'win32') - CYGWIN = (HOST_PLATFORM == 'cygwin') - MACOS = (HOST_PLATFORM == 'darwin') - AIX = (HOST_PLATFORM.startswith('aix')) -+ILLUMOS = (HOST_PLATFORM == 'sunos5') - VXWORKS = ('vxworks' in HOST_PLATFORM) - - -@@ -731,7 +732,7 @@ class PyBuildExt(build_ext): - # Ensure that /usr/local is always used, but the local build - # directories (i.e. '.' and 'Include') must be first. See issue - # 10520. -- if not CROSS_COMPILING: -+ if not ILLUMOS and not CROSS_COMPILING: - add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') - add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') - # only change this for cross builds for 3.3, issues on Mageia -@@ -1045,6 +1046,14 @@ class PyBuildExt(build_ext): - ['/usr/lib/termcap'], - 'termcap'): - readline_libs.append('termcap') -+ -+ if ILLUMOS: -+ # insert '-zrecord' before the readline libraries that we -+ # want to link with to avoid rl_insert() elimination -+ readline_extra_link_args = ('-Wl,-zrecord','-lreadline', -+ '-lncurses') -+ readline_libs = () -+ - self.add(Extension('readline', ['readline.c'], - library_dirs=['/usr/lib/termcap'], - extra_link_args=readline_extra_link_args, -@@ -1079,6 +1088,12 @@ class PyBuildExt(build_ext): - - curses_enabled = True - if curses_library.startswith('ncurses'): -+ -+ if ILLUMOS: -+ curses_defines.append(('HAVE_NCURSESW', '1')) -+ curses_defines.append(('_XOPEN_SOURCE_EXTENDED', '1')) -+ curses_includes.append('/usr/include/ncurses') -+ - curses_libs = [curses_library] - self.add(Extension('_curses', ['_cursesmodule.c'], - include_dirs=curses_includes, -@@ -1106,10 +1121,15 @@ class PyBuildExt(build_ext): - skip_curses_panel = True if AIX else False - if (curses_enabled and not skip_curses_panel and - self.compiler.find_library_file(self.lib_dirs, panel_library)): -+ panel_lib_dirs = [] -+ if ILLUMOS: -+ panel_lib_dirs.append('/usr/gnu/lib/amd64') - self.add(Extension('_curses_panel', ['_curses_panel.c'], - include_dirs=curses_includes, - define_macros=curses_defines, -- libraries=[panel_library, *curses_libs])) -+ libraries=[panel_library, *curses_libs], -+ library_dirs = panel_lib_dirs, -+ runtime_library_dirs = panel_lib_dirs)) - elif not skip_curses_panel: - self.missing.append('_curses_panel') - diff --git a/components/python/python-312/patches/00-include-ncurses.patch b/components/python/python-312/patches/00-include-ncurses.patch deleted file mode 100644 index 2f32ffae252..00000000000 --- a/components/python/python-312/patches/00-include-ncurses.patch +++ /dev/null @@ -1,21 +0,0 @@ ---- Python-3.12.1/configure.ac.~6~ Mon Feb 5 10:07:19 2024 -+++ Python-3.12.1/configure.ac Mon Feb 5 10:21:31 2024 -@@ -6509,7 +6509,7 @@ - # first curses header check - ac_save_cppflags="$CPPFLAGS" - if test "$cross_compiling" = no; then -- CPPFLAGS="$CPPFLAGS -I/usr/include/ncursesw" -+ CPPFLAGS="$CPPFLAGS -I/usr/include/ncursesw -I/usr/include/ncurses" - fi - - # On Solaris, term.h requires curses.h ---- Python-3.12.1/configure.ac.~7~ Mon Feb 5 17:08:56 2024 -+++ Python-3.12.1/configure.ac Mon Feb 5 17:19:15 2024 -@@ -6470,6 +6470,7 @@ - have_panel=panelw - ], [ - WITH_SAVE_ENV([ -+ AS_VAR_APPEND([LDFLAGS], [" -L/usr/gnu/lib/amd64"]) - AC_CHECK_LIB([panelw], [update_panels], [ - have_panel=panelw - PANEL_CFLAGS=${PANEL_CFLAGS-""} diff --git a/components/python/python-312/patches/00-socket-test-2.patch b/components/python/python-312/patches/00-socket-test-2.patch deleted file mode 100644 index 4d103065905..00000000000 --- a/components/python/python-312/patches/00-socket-test-2.patch +++ /dev/null @@ -1,30 +0,0 @@ ---- Python-3.12.1/Modules/Setup.stdlib.in.~1~ Thu Dec 7 12:45:44 2023 -+++ Python-3.12.1/Modules/Setup.stdlib.in Thu Jan 25 20:47:17 2024 -@@ -113,13 +113,13 @@ - @MODULE_MMAP_TRUE@mmap mmapmodule.c - # FreeBSD: nis/yp APIs are in libc - # Linux: glibc has deprecated SUN RPC, APIs are in libnsl and libtirpc (bpo-32521) --@MODULE_NIS_TRUE@nis nismodule.c -+@MODULE_NIS_TRUE@nis nismodule.c -lsocket -lnsl - # needs sys/soundcard.h or linux/soundcard.h (Linux, FreeBSD) - @MODULE_OSSAUDIODEV_TRUE@ossaudiodev ossaudiodev.c - @MODULE__POSIXSUBPROCESS_TRUE@_posixsubprocess _posixsubprocess.c - @MODULE_RESOURCE_TRUE@resource resource.c - @MODULE_SELECT_TRUE@select selectmodule.c --@MODULE__SOCKET_TRUE@_socket socketmodule.c -+@MODULE__SOCKET_TRUE@_socket socketmodule.c -lresolv -lsocket -lnsl - # AIX has shadow passwords, but does not provide getspent API - @MODULE_SPWD_TRUE@spwd spwdmodule.c - @MODULE_SYSLOG_TRUE@syslog syslogmodule.c -@@ -138,9 +138,9 @@ - @MODULE__CTYPES_TRUE@_ctypes _ctypes/_ctypes.c _ctypes/callbacks.c _ctypes/callproc.c _ctypes/stgdict.c _ctypes/cfield.c @MODULE__CTYPES_MALLOC_CLOSURE@ - - # needs -lncurses[w], sometimes -ltermcap/tinfo --@MODULE__CURSES_TRUE@_curses _cursesmodule.c -+@MODULE__CURSES_TRUE@_curses _cursesmodule.c -Wl,-zrecord -lreadline -lncurses - # needs -lncurses[w] and -lpanel[w] --@MODULE__CURSES_PANEL_TRUE@_curses_panel _curses_panel.c -+@MODULE__CURSES_PANEL_TRUE@_curses_panel _curses_panel.c -Wl,-zrecord -L/usr/gnu/lib/amd64 -Wl,-R/usr/gnu/lib/amd64 -lpanelw -lreadline -lncursesw - - @MODULE__SQLITE3_TRUE@_sqlite3 _sqlite/blob.c _sqlite/connection.c _sqlite/cursor.c _sqlite/microprotocols.c _sqlite/module.c _sqlite/prepare_protocol.c _sqlite/row.c _sqlite/statement.c _sqlite/util.c - diff --git a/components/python/python-312/patches/00-socket-test.patch b/components/python/python-312/patches/00-socket-test.patch deleted file mode 100644 index b77f49feccd..00000000000 --- a/components/python/python-312/patches/00-socket-test.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- Python-3.12.1/configure.ac.~1~ Thu Dec 7 12:45:44 2023 -+++ Python-3.12.1/configure.ac Thu Jan 25 19:43:55 2024 -@@ -7395,7 +7395,7 @@ - PY_STDLIB_MOD([_socket], - [], m4_flatten([test "$ac_cv_header_sys_socket_h" = "yes" - -a "$ac_cv_header_sys_types_h" = "yes" -- -a "$ac_cv_header_netinet_in_h" = "yes"])) -+ -a "$ac_cv_header_netinet_in_h" = "yes"], [], [-lsocket])) - - dnl platform specific extensions - PY_STDLIB_MOD([grp], [], [test "$ac_cv_func_getgrgid" = yes -o "$ac_cv_func_getgrgid_r" = yes]) diff --git a/components/python/python-312/patches/01-stdlib_ldflags.patch b/components/python/python-312/patches/01-stdlib_ldflags.patch new file mode 100644 index 00000000000..81c46593865 --- /dev/null +++ b/components/python/python-312/patches/01-stdlib_ldflags.patch @@ -0,0 +1,54 @@ +Add /usr/gnu/lib/amd64 to the library search path when looking for +-lpanelw and when linking _curses_panel; it also needs to appear in +the module's library runpath + +The nis module always needs -lnsl; the sockets module needs -lresolv for h_errno. + +Readline needs -Wl,-zrecord to "avoid rl_insert() elimination" + +--- Python-3.12.1/configure.ac.~1~ Thu Dec 7 12:45:44 2023 ++++ Python-3.12.1/configure.ac Tue Feb 6 11:14:01 2024 +@@ -3988,7 +3988,7 @@ + ["none required"], [libnsl=""], + [libnsl="$ac_cv_search_yp_match"] + ) +- LIBNSL_LIBS=${LIBNSL_LIBS-$libnsl} ++ LIBNSL_LIBS=-lnsl + ]) + + AS_VAR_IF([have_nis], [yes], [ +@@ -6102,7 +6102,7 @@ + AC_CHECK_LIB([readline], [readline], [ + LIBREADLINE=readline + READLINE_CFLAGS=${LIBREADLINE_CFLAGS-""} +- READLINE_LIBS=${LIBREADLINE_LIBS-"-lreadline"} ++ READLINE_LIBS=${LIBREADLINE_LIBS-"-Wl,-zrecord -lreadline -lncurses"} + ], [with_readline=no]) + ], [with_readline=no]) + ]) +@@ -6470,6 +6470,7 @@ + have_panel=panelw + ], [ + WITH_SAVE_ENV([ ++ AS_VAR_APPEND([LDFLAGS], [" -L/usr/gnu/lib/amd64"]) + AC_CHECK_LIB([panelw], [update_panels], [ + have_panel=panelw + PANEL_CFLAGS=${PANEL_CFLAGS-""} +@@ -7395,7 +7396,7 @@ + PY_STDLIB_MOD([_socket], + [], m4_flatten([test "$ac_cv_header_sys_socket_h" = "yes" + -a "$ac_cv_header_sys_types_h" = "yes" +- -a "$ac_cv_header_netinet_in_h" = "yes"])) ++ -a "$ac_cv_header_netinet_in_h" = "yes"]), [], [-lresolv -lnsl]) + + dnl platform specific extensions + PY_STDLIB_MOD([grp], [], [test "$ac_cv_func_getgrgid" = yes -o "$ac_cv_func_getgrgid_r" = yes]) +@@ -7453,7 +7454,7 @@ + ) + PY_STDLIB_MOD([_curses_panel], + [], [test "$have_panel" != "no"], +- [$PANEL_CFLAGS $CURSES_CFLAGS], [$PANEL_LIBS $CURSES_LIBS] ++ [$PANEL_CFLAGS $CURSES_CFLAGS], [-L/usr/gnu/lib/amd64 -Wl,-R/usr/gnu/lib/amd64 $PANEL_LIBS $CURSES_LIBS] + ) + PY_STDLIB_MOD([_decimal], [], [], [$LIBMPDEC_CFLAGS], [$LIBMPDEC_LDFLAGS]) + PY_STDLIB_MOD([_dbm],