Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python updates with openssl300 #996

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
41 changes: 24 additions & 17 deletions 10.9-libcxx/stable/main/finkinfo/languages/python310.info
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# -*- coding: ascii; tab-width: 4; x-counterpart: python310.patch -*-
Info2: <<
Package: python%type_pkg[python]
Version: 3.10.4
Revision: 2
Version: 3.10.10
Revision: 1
Type: python 3.10
# Free to modify, update, and take over
Maintainer: Hanspeter Niederstrasser <[email protected]>
Expand All @@ -17,7 +17,7 @@ Depends: <<
libgettext8-shlibs,
liblzma5-shlibs,
libncursesw5-shlibs,
openssl110-shlibs (>= 1.1.1g-1),
openssl300-shlibs (>= 3.0.1-1),
readline8-shlibs,
sqlite3-shlibs (>= 3.30.1-1),
tcltk (>= 8.4.1-1),
Expand All @@ -27,16 +27,16 @@ BuildDepends: <<
blt-dev (>= 2.4z-15),
bzip2-dev,
expat1 (>= 2.2.8-1),
fink (>= 0.32),
fink (>= 0.32),
gdbm6,
gettext-bin,
gettext-tools,
libffi8,
libgettext8-dev,
liblzma5,
libncursesw5,
openssl110-dev (>= 1.1.1g-1),
pkgconfig,
openssl300-dev (>= 3.0.1-1),
ppkg-config,
readline8,
sqlite3-dev (>= 3.30.1-1),
tcltk-dev (>= 8.4.1-1),
Expand All @@ -57,10 +57,10 @@ Provides: <<
<<

Source: https://www.python.org/ftp/python/%v/Python-%v.tar.xz
Source-Checksum: SHA256(80bf925f571da436b35210886cf79f6eb5fa5d6c571316b73568343451f77a19)
Source-Checksum: SHA256(0419e9085bf51b7a672009b3f50dbf1859acdf18ba725d0ec19aa5c8503f0ea3)

PatchFile: %n.patch
PatchFile-MD5: accc53203fdb4c50b45aea0d9d6ecf5e
PatchFile-MD5: b1bd9a4a2fad7a9e25ec63ce62d0767d

PatchScript: <<
#!/bin/sh -ex
Expand All @@ -84,7 +84,8 @@ ConfigureParams: <<
--with-tcltk-libs="-L%p/lib -ltcl -ltk" \
--with-dtrace \
--without-ensurepip \
--enable-ipv6
--enable-ipv6 \
PKG_CONFIG=%p/bin/ppkg-config
<<

CompileScript: <<
Expand Down Expand Up @@ -126,8 +127,8 @@ InfoTest: <<
# test_ctypes is currently broken on 12.0 (py3.10.1)
# test_tcl and test_idle require an active $DISPLAY
# test_select is missing attribute 'poll'
# test_pkgutil fails on HFS+ https://bugs.python.org/issue41154
EXTRATESTOPTS='-w -unone -x test_socket test_multiprocessing_spawn test_code test_ctypes test_idle test_tcl test_select test_pkgutil'
# test_pkgutil fails on HFS+ https://bugs.python.org/issue41154 (marked resolved)
EXTRATESTOPTS='-w -unone -x test_idle test_select test_tcl'
LANG=en_US.UTF-8 make -k test EXTRATESTOPTS="$EXTRATESTOPTS" || TESTRETURN=$?

# Put install_name back.
Expand All @@ -154,13 +155,15 @@ InstallScript: <<
perl -pi -e 's/-lintl //' `ls -d %b/build/lib*`/_sysconfigdata__darwin_darwin.py
# Remove stray .pyc that get made during tests (including preliminary ones in CompileScript) to keep validator happy.
find ./Lib ./Parser ./Tools ./build -name '*.pyc' -delete
# Change interpreter name in scripts to versioned executable.
perl -pi -e 's|(/usr/bin/env python)(3?)$|${1}%type_raw[python]|' ./Tools/scripts/*
# install fails with -j greater than 1
export MAKEFLAGS=-j1
make install DESTDIR=%d

# we don't want -lintl to appear in LIBS otherwise python-config will propagate it
perl -pi -e 's/-lintl //' %i/lib/python%type_raw[python]/config-%type_raw[python]-darwin/Makefile
perl -pi -e 's,%b,%p/lib/python%type_raw[python]/config-%type_raw[python]-darwin,' %i/lib/python%type_raw[python]/config-%type_raw[python]-darwin/Makefile
perl -pi -e 's,%b,%p/lib/python%type_raw[python]/config-%type_raw[python]-darwin,' %i/lib/python%type_raw[python]/config-%type_raw[python]-darwin/Makefile
# Fix all main things to be python-versioned filenames with unversioned symlinks to them.
pushd %i/bin
for f in idle3 pydoc3; do
Expand All @@ -177,6 +180,8 @@ InstallScript: <<
# install some docs and other useful tidbits
rm -rf Misc/RPM
/bin/cp -R Misc Tools %i/lib/python%type_raw[python]
pushd %i/lib/python%type_raw[python]
DYLD_LIBRARY_PATH=%i/lib %i/bin/python%type_raw[python] -m compileall -f -o 0 -o 1 -o 2 -x test2to3 Tools || exit 1

# Doc tarball missing upstream.
# mkdir -p %i/share/doc/%n/html
Expand All @@ -190,7 +195,7 @@ SplitOff: <<
lib/python%type_raw[python]/config-%type_raw[python]-darwin/libpython%type_raw[python].dylib
<<
Shlibs: %p/lib/libpython%type_raw[python].dylib 3.10.0 %n (>= 3.10.1-1)
DocFiles: README.rst LICENSE
DocFiles: README.rst LICENSE
<<
SplitOff2: <<
Package: python3
Expand All @@ -215,10 +220,10 @@ SplitOff2: <<
python 3.x interpreter you need.
<<
<<
DocFiles: README.rst LICENSE
DocFiles: README.rst LICENSE
Description: Interpreted, object-oriented language
DescDetail: <<
Python is often compared to Tcl, Perl, Scheme or Java.
Python is often compared to Tcl, Perl, Scheme or Java.
This package installs unix python - not the OSX Framework version.
Builds a two-level namespace dynamic libpython (needed for koffice).

Expand All @@ -228,7 +233,7 @@ DescDetail: <<
the "python3" command there is not guaranteed to be python%type_raw[python]!).
<<
DescUsage: <<
python%type_raw[python] changes the compiler options used to compile
Python 3.10+ changes the compiler options used to compile
third-party python modules. Please do not add %type_raw[python] variants
to them without actually testing that they build cleanly.
<<
Expand All @@ -250,7 +255,7 @@ DescPackaging: <<
for libpython instead of %p/lib. Revert to using default library
location but make symlink in config dir.

Upstream no longer links extensions to libpython and use of
Upstream no longer links extensions to libpython and use of
-undefined dynamic_lookup is recommended instead so remove those
patches.
<<
Expand All @@ -267,6 +272,8 @@ DescPort: <<

Call build executable by correct filename in test suite
(python on case-sensitive, python.exe on -insensitive file systems).

Apply _delim.py patch from https://github.com/python/cpython/pull/102066.
<<
License: OSI-Approved
Homepage: https://www.python.org/
Expand Down
71 changes: 49 additions & 22 deletions 10.9-libcxx/stable/main/finkinfo/languages/python310.patch
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ diff -ruN Python-3.10.1-orig/Lib/ctypes/macholib/dyld.py Python-3.10.1/Lib/ctype
diff -ruN Python-3.10.1-orig/Lib/test/test_posix.py Python-3.10.1/Lib/test/test_posix.py
--- Python-3.10.1-orig/Lib/test/test_posix.py 2021-12-06 13:23:39.000000000 -0500
+++ Python-3.10.1/Lib/test/test_posix.py 2021-12-24 05:31:43.000000000 -0500
@@ -1728,7 +1728,8 @@
@@ -1705,7 +1705,8 @@
output = os.read(rfd, 100)
child_sid = int(output)
parent_sid = os.getsid(os.getpid())
Expand Down Expand Up @@ -58,7 +58,7 @@ diff -ruN Python-3.10.1-orig/Modules/_dbmmodule.c Python-3.10.1/Modules/_dbmmodu
diff -ruN Python-3.10.1-orig/configure Python-3.10.1/configure
--- Python-3.10.1-orig/configure 2021-12-06 13:23:39.000000000 -0500
+++ Python-3.10.1/configure 2021-12-24 05:31:43.000000000 -0500
@@ -16454,7 +16454,7 @@
@@ -16433,7 +16433,7 @@
# first curses header check
ac_save_cppflags="$CPPFLAGS"
if test "$cross_compiling" = no; then
Expand All @@ -67,7 +67,7 @@ diff -ruN Python-3.10.1-orig/configure Python-3.10.1/configure
fi

for ac_header in curses.h ncurses.h
@@ -16964,7 +16964,7 @@
@@ -16943,7 +16943,7 @@

if test $ac_sys_system = Darwin
then
Expand All @@ -76,37 +76,38 @@ diff -ruN Python-3.10.1-orig/configure Python-3.10.1/configure
fi

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for %zd printf() format support" >&5
diff -ruN Python-3.10.1-orig/setup.py Python-3.10.1/setup.py
--- Python-3.10.1-orig/setup.py 2021-12-06 13:23:39.000000000 -0500
+++ Python-3.10.1/setup.py 2021-12-24 05:31:43.000000000 -0500
@@ -518,6 +518,7 @@
diff -ruN Python-3.10.8-orig/setup.py Python-3.10.8/setup.py
--- Python-3.10.8-orig/setup.py 2022-10-11 13:21:44.000000000 +0200
+++ Python-3.10.8/setup.py 2022-10-12 23:25:52.000000000 +0200
@@ -518,12 +518,16 @@
longest, g))

if self.missing:
+ num_missing=len(self.missing)
+ num_missing = len(self.missing)
print()
print("Python build finished successfully!")
print("The necessary bits to build these optional modules were not "
@@ -525,7 +526,10 @@
- print("The necessary bits to build these optional modules were not "
- "found:")
+ print(f"The necessary bits to build these {num_missing} optional "
+ "modules were not found:")
print_three_column(self.missing)
print("To find the necessary bits, look in setup.py in"
" detect_modules() for the module's name.")
+ print ("(Fink package build should have 2 missing)")
print()
- " detect_modules() for the module's name.")
+ " detect_modules() for the module's name")
+ print("(Fink package build should have 2 missing).")
+ if num_missing != 2:
+ sys.exit(1)
print()

if mods_built:
print()
@@ -558,6 +562,7 @@
@@ -557,6 +561,7 @@
print("Failed to build these modules:")
print_three_column(failed)
print()
+ sys.exit(1)

if self.failed_on_import:
failed = self.failed_on_import[:]
@@ -824,9 +829,9 @@
@@ -825,9 +830,9 @@
# Ensure that /usr/local is always used, but the local build
# directories (i.e. '.' and 'Include') must be first. See issue
# 10520.
Expand All @@ -119,7 +120,7 @@ diff -ruN Python-3.10.1-orig/setup.py Python-3.10.1/setup.py
# only change this for cross builds for 3.3, issues on Mageia
if CROSS_COMPILING:
self.add_cross_compiling_paths()
@@ -1163,7 +1168,7 @@
@@ -1167,7 +1172,7 @@
if curses_library == 'ncursesw':
curses_defines.append(('HAVE_NCURSESW', '1'))
if not CROSS_COMPILING:
Expand All @@ -128,7 +129,7 @@ diff -ruN Python-3.10.1-orig/setup.py Python-3.10.1/setup.py
# Bug 1464056: If _curses.so links with ncursesw,
# _curses_panel.so must link with panelw.
panel_library = 'panelw'
@@ -1491,7 +1496,7 @@
@@ -1495,7 +1500,7 @@
if self.compiler.find_library_file(self.lib_dirs,
'gdbm_compat'):
gdbm_libs.append('gdbm_compat')
Expand All @@ -137,7 +138,7 @@ diff -ruN Python-3.10.1-orig/setup.py Python-3.10.1/setup.py
if dbm_setup_debug: print("building dbm using gdbm")
dbmext = Extension(
'_dbm', ['_dbmmodule.c'],
@@ -1541,13 +1546,8 @@
@@ -1545,13 +1550,8 @@

# We hunt for #define SQLITE_VERSION "n.n.n"
sqlite_incdir = sqlite_libdir = None
Expand All @@ -153,7 +154,7 @@ diff -ruN Python-3.10.1-orig/setup.py Python-3.10.1/setup.py
if CROSS_COMPILING:
sqlite_inc_paths = []
MIN_SQLITE_VERSION_NUMBER = (3, 7, 15) # Issue 40810
@@ -1560,7 +1560,7 @@
@@ -1564,7 +1564,7 @@
if MACOS:
sysroot = macosx_sdk_root()

Expand All @@ -162,7 +163,7 @@ diff -ruN Python-3.10.1-orig/setup.py Python-3.10.1/setup.py
d = d_
if MACOS and is_macosx_sdk_path(d):
d = os.path.join(sysroot, d[1:])
@@ -1593,11 +1593,9 @@
@@ -1597,11 +1597,9 @@
sqlite_dirs_to_check = [
os.path.join(sqlite_incdir, '..', 'lib64'),
os.path.join(sqlite_incdir, '..', 'lib'),
Expand All @@ -175,3 +176,29 @@ diff -ruN Python-3.10.1-orig/setup.py Python-3.10.1/setup.py
if sqlite_libfile:
sqlite_libdir = [os.path.abspath(os.path.dirname(sqlite_libfile))]

diff -ruN Python-3.10.10-orig/Tools/c-analyzer/c_parser/parser/_delim.py Python-3.10.10/Tools/c-analyzer/c_parser/parser/_delim.py
--- Python-3.10.10-orig/Tools/c-analyzer/c_parser/parser/_delim.py 2023-02-07 13:05:30.000000000 +0300
+++ Python-3.10.10/Tools/c-analyzer/c_parser/parser/_delim.py 2023-02-20 10:59.30.000000000 +0300
@@ -17,11 +17,11 @@ def parse(text, anon_name):
yield result


-DELIMITER = textwrap.dedent(rf'''
+DELIMITER = textwrap.dedent(r'''
(
(?:
[^'"()\[\]{};]*
- {_ind(STRING_LITERAL, 3)}
+ %s
}*
[^'"()\[\]{};]+
)? # <before>
@@ -34,7 +34,7 @@ def parse(text, anon_name):
[)\]};]
) # <close>
)?
- ''')
+ ''' % _ind(STRING_LITERAL, 3))
DELIMITER_RE = re.compile(DELIMITER, re.VERBOSE)

_HANDLERS = {
Loading