python3: update to 3.11.0.

Also include bluez headers at build time to allow Bluetooth sockets in
the Python stdlib.

h/t: @sgn
This commit is contained in:
Andrew J. Hesford 2022-09-18 13:34:27 -04:00
parent f7a600fd5c
commit 6504d8e133
8 changed files with 47 additions and 31 deletions

View file

@ -7,7 +7,7 @@ py2_lib="usr/lib/python${py2_ver}"
py2_sitelib="${py2_lib}/site-packages" py2_sitelib="${py2_lib}/site-packages"
py2_inc="usr/include/python${py2_ver}" py2_inc="usr/include/python${py2_ver}"
py3_ver="3.10" py3_ver="3.11"
py3_abiver="" py3_abiver=""
py3_lib="usr/lib/python${py3_ver}" py3_lib="usr/lib/python${py3_ver}"
py3_sitelib="${py3_lib}/site-packages" py3_sitelib="${py3_lib}/site-packages"

View file

@ -236,7 +236,7 @@ hook() {
generic_wrapper3 libetpan-config generic_wrapper3 libetpan-config
generic_wrapper3 giblib-config generic_wrapper3 giblib-config
python_wrapper python-config 2.7 python_wrapper python-config 2.7
python_wrapper python3-config 3.10 python_wrapper python3-config 3.11
apr_apu_wrapper apr-1-config apr_apu_wrapper apr-1-config
apr_apu_wrapper apu-1-config apr_apu_wrapper apu-1-config
} }

View file

@ -1747,7 +1747,7 @@ libportaudiocpp.so.0 portaudio-cpp-19.20140130_1
libdar.so.6000 libdar-2.6.6_1 libdar.so.6000 libdar-2.6.6_1
libdar64.so.6000 libdar-2.6.6_1 libdar64.so.6000 libdar-2.6.6_1
libpython3.so python3-3.9.2_2 libpython3.so python3-3.9.2_2
libpython3.10.so.1.0 python3-3.10.0_1 libpython3.11.so.1.0 python3-3.11.0_1
libbrscandec2.so.1 brother-brscan3-0.2.11_2 libbrscandec2.so.1 brother-brscan3-0.2.11_2
libpyglib-2.0-python.so.0 python-gobject2-2.28.6_11 libpyglib-2.0-python.so.0 python-gobject2-2.28.6_11
libxmlrpc_server_abyss.so.3 xmlrpc-c-1.51.06_2 libxmlrpc_server_abyss.so.3 xmlrpc-c-1.51.06_2

View file

@ -1,6 +1,6 @@
--- setup.py.orig --- setup.py
+++ setup.py +++ setup.py
@@ -38,7 +38,7 @@ @@ -77,7 +77,7 @@
return sys.platform return sys.platform
@ -9,7 +9,7 @@
HOST_PLATFORM = get_platform() HOST_PLATFORM = get_platform()
MS_WINDOWS = (HOST_PLATFORM == 'win32') MS_WINDOWS = (HOST_PLATFORM == 'win32')
CYGWIN = (HOST_PLATFORM == 'cygwin') CYGWIN = (HOST_PLATFORM == 'cygwin')
@@ -700,6 +700,10 @@ @@ -898,6 +898,10 @@
if HOST_PLATFORM == 'hp-ux11': if HOST_PLATFORM == 'hp-ux11':
self.lib_dirs += ['/usr/lib/hpux64', '/usr/lib/hpux32'] self.lib_dirs += ['/usr/lib/hpux64', '/usr/lib/hpux32']
@ -20,9 +20,9 @@
if MACOS: if MACOS:
# This should work on any unixy platform ;-) # This should work on any unixy platform ;-)
# If the user has bothered specifying additional -I and -L flags # If the user has bothered specifying additional -I and -L flags
--- Makefile.pre.in.orig 2017-07-08 05:33:27.000000000 +0200 --- Makefile.pre.in
+++ Makefile.pre.in 2017-08-27 19:49:11.114893045 +0200 +++ Makefile.pre.in
@@ -1055,8 +1055,6 @@ @@ -1743,8 +1743,6 @@
upgrade) ensurepip="--upgrade" ;; \ upgrade) ensurepip="--upgrade" ;; \
install|*) ensurepip="" ;; \ install|*) ensurepip="" ;; \
esac; \ esac; \
@ -31,7 +31,7 @@
fi fi
altinstall: commoninstall altinstall: commoninstall
@@ -1065,8 +1063,6 @@ @@ -1753,8 +1751,6 @@
upgrade) ensurepip="--altinstall --upgrade" ;; \ upgrade) ensurepip="--altinstall --upgrade" ;; \
install|*) ensurepip="--altinstall" ;; \ install|*) ensurepip="--altinstall" ;; \
esac; \ esac; \
@ -39,11 +39,11 @@
- $$ensurepip --root=$(DESTDIR)/ ; \ - $$ensurepip --root=$(DESTDIR)/ ; \
fi fi
commoninstall: @FRAMEWORKALTINSTALLFIRST@ \ commoninstall: check-clean-src @FRAMEWORKALTINSTALLFIRST@ \
@@ -1434,11 +1430,12 @@ @@ -2226,11 +2222,12 @@
# Install the dynamically loadable modules # Install the dynamically loadable modules
# This goes into $(exec_prefix) # This goes into $(exec_prefix)
sharedinstall: sharedmods sharedinstall: all
+ CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \ + CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \
$(RUNSHARED) $(PYTHON_FOR_BUILD) $(srcdir)/setup.py install \ $(RUNSHARED) $(PYTHON_FOR_BUILD) $(srcdir)/setup.py install \
--prefix=$(prefix) \ --prefix=$(prefix) \

View file

@ -1,6 +1,6 @@
--- a/Lib/ctypes/util.py --- a/Lib/ctypes/util.py
+++ b/Lib/ctypes/util.py +++ b/Lib/ctypes/util.py
@@ -204,6 +204,41 @@ @@ -265,6 +265,41 @@
def find_library(name, is64 = False): def find_library(name, is64 = False):
return _get_soname(_findLib_crle(name, is64) or _findLib_gcc(name)) return _get_soname(_findLib_crle(name, is64) or _findLib_gcc(name))

View file

@ -8,11 +8,9 @@ Subject: [PATCH] add powerpcle triple
configure.ac | 4 ++++ configure.ac | 4 ++++
2 files changed, 8 insertions(+) 2 files changed, 8 insertions(+)
diff --git configure configure
index 2d379fe..97d1f9b 100755
--- a/configure --- a/configure
+++ b/configure +++ b/configure
@@ -5302,7 +5302,11 @@ cat >> conftest.c <<EOF @@ -6113,7 +6113,11 @@
powerpc64-linux-gnu powerpc64-linux-gnu
# endif # endif
# elif defined(__powerpc__) # elif defined(__powerpc__)
@ -24,11 +22,9 @@ index 2d379fe..97d1f9b 100755
# elif defined(__s390x__) # elif defined(__s390x__)
s390x-linux-gnu s390x-linux-gnu
# elif defined(__s390__) # elif defined(__s390__)
diff --git configure.ac configure.ac
index c968d14..499ef7a 100644
--- a/configure.ac --- a/configure.ac
+++ b/configure.ac +++ b/configure.ac
@@ -826,7 +826,11 @@ cat >> conftest.c <<EOF @@ -1011,7 +1011,11 @@
powerpc64-linux-gnu powerpc64-linux-gnu
# endif # endif
# elif defined(__powerpc__) # elif defined(__powerpc__)
@ -40,6 +36,3 @@ index c968d14..499ef7a 100644
# elif defined(__s390x__) # elif defined(__s390x__)
s390x-linux-gnu s390x-linux-gnu
# elif defined(__s390__) # elif defined(__s390__)
--
2.29.2

View file

@ -1,8 +1,8 @@
--- a/configure --- a/configure
+++ b/configure +++ b/configure
@@ -5205,6 +5205,14 @@ @@ -5221,6 +5221,14 @@
$as_echo "$ac_cv_path_EGREP" >&6; }
MULTIARCH=$($CC --print-multiarch 2>/dev/null) EGREP="$ac_cv_path_EGREP"
+if test x$MULTIARCH = xpowerpc-linux-musl +if test x$MULTIARCH = xpowerpc-linux-musl
+then +then
@ -13,5 +13,5 @@
+ MULTIARCH="powerpcle-linux-gnu" + MULTIARCH="powerpcle-linux-gnu"
+fi +fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for the platform triplet based on compiler characteristics" >&5
$as_echo_n "checking for the platform triplet based on compiler characteristics... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CC compiler name" >&5

View file

@ -3,7 +3,7 @@
# THIS PACKAGE MUST BE SYNCHRONIZED WITH "srcpkgs/python3-tkinter". # THIS PACKAGE MUST BE SYNCHRONIZED WITH "srcpkgs/python3-tkinter".
# #
pkgname=python3 pkgname=python3
version=3.10.8 version=3.11.0
revision=1 revision=1
wrksrc="Python-${version}" wrksrc="Python-${version}"
build_style="gnu-configure" build_style="gnu-configure"
@ -21,8 +21,14 @@ short_desc="Python programming language (${version%.*} series)"
maintainer="Andrew J. Hesford <ajh@sideband.org>" maintainer="Andrew J. Hesford <ajh@sideband.org>"
license="Python-2.0" license="Python-2.0"
homepage="https://www.python.org" homepage="https://www.python.org"
distfiles="https://www.python.org/ftp/python/${version}/Python-${version}.tar.xz" _bluez="bluez-5.64"
checksum=6a30ecde59c47048013eb5a658c9b5dec277203d2793667f578df7671f7f03f3 distfiles="
https://www.python.org/ftp/python/${version}/Python-${version}.tar.xz
${KERNEL_SITE}/bluetooth/${_bluez}.tar.xz
"
checksum="a57dc82d77358617ba65b9841cee1e3b441f386c3789ddc0676eca077f2951c3
ae437e65b6b3070c198bc5b0109fe9cdeb9eaa387380e2072f9de65fe8a1de34"
skip_extraction="${_bluez}.tar.xz"
alternatives=" alternatives="
python:idle:/usr/bin/idle${version%.*} python:idle:/usr/bin/idle${version%.*}
@ -33,12 +39,20 @@ alternatives="
if [ "$CROSS_BUILD" ]; then if [ "$CROSS_BUILD" ]; then
hostmakedepends+=" python3" hostmakedepends+=" python3"
configure_args+=" --with-build-python=python3.11"
fi fi
post_extract() { post_extract() {
# Ensure that internal copies of expat and libffi are not used # Ensure that internal copies of expat and libffi are not used
rm -rf Modules/expat rm -rf Modules/expat
rm -rf Modules/_ctypes/{darwin,libffi}* rm -rf Modules/_ctypes/{darwin,libffi}*
# Extract Bluetooth headers
local _srcdistdir="${XBPS_SRCDISTDIR}/${sourcepkg}-${version}"
mkdir External
bsdtar -C External --strip-components=1 -x \
-f "${_srcdistdir}/${_bluez}.tar.xz" "${_bluez}/lib/*.h"
mv External/lib External/bluetooth
} }
post_patch() { post_patch() {
@ -52,6 +66,10 @@ do_configure() {
# `-R<path>` to the compiler for every compiled extension that sets an # `-R<path>` to the compiler for every compiled extension that sets an
# rpath rather than the '-Wl,-R<path>' argument that GCC requires # rpath rather than the '-Wl,-R<path>' argument that GCC requires
unset GCC CC CXX CPP LD AR AS RANLIB unset GCC CC CXX CPP LD AR AS RANLIB
# Make sure configure can find Bluetooth headers
CFLAGS+=" -I./External"
CPPFLAGS+=" -I./External"
./configure ${configure_args} ./configure ${configure_args}
} }
@ -103,6 +121,11 @@ do_install() {
sed -i -e "s,$XBPS_CROSS_BASE,,g" \ sed -i -e "s,$XBPS_CROSS_BASE,,g" \
${DESTDIR}/usr/bin/python${version%.*}-config ${DESTDIR}/usr/bin/python${version%.*}-config
fi fi
sed -i -e "s,-fdebug-prefix-map=[^[:space:]]*=[.],," \
-e "s,-I./External,," \
${DESTDIR}/usr/bin/python${version%.*}-config \
${DESTDIR}/usr/lib/python${version%.*}/_sysconfigdata_*_*.py \
${DESTDIR}/usr/lib/python${version%.*}/config-${version%.*}*/Makefile
} }
python3-devel_package() { python3-devel_package() {