python3: update to 3.13.2, clean up alternatives

This commit is contained in:
Andrew J. Hesford 2025-01-31 11:29:24 -05:00
parent 0c48a654eb
commit 865e9ea108

View file

@ -5,14 +5,14 @@
# - coccinelle
#
pkgname=python3
version=3.13.1
version=3.13.2
revision=1
build_style="gnu-configure"
configure_args="--enable-shared --enable-ipv6
--enable-loadable-sqlite-extensions --with-computed-gotos
--with-dbmliborder=gdbm:ndbm --with-system-expat
--without-ensurepip ac_cv_working_tzset=yes"
pycompile_dirs="usr/lib/python${version%.*}"
pycompile_dirs="${py3_lib}"
hostmakedepends="pkgconf autoconf-archive automake"
makedepends="libffi-devel readline-devel gdbm-devel openssl-devel
expat-devel sqlite-devel bzip2-devel zlib-devel liblzma-devel"
@ -27,13 +27,11 @@ distfiles="
https://www.python.org/ftp/python/${version%rc*}/Python-${version}.tar.xz
${KERNEL_SITE}/bluetooth/${_bluez}.tar.xz
"
checksum="9cf9427bee9e2242e3877dd0f6b641c1853ca461f39d6503ce260a59c80bf0d9
checksum="d984bcc57cd67caab26f7def42e523b1c015bbc5dc07836cf4f0b63fa159eb56
55e2c645909ad82d833c42ce85ec20434e0ef0070941b1eab73facdd240bbd63"
skip_extraction="${_bluez}.tar.xz"
alternatives="
python:idle:/usr/bin/idle${version%.*}
python:2to3:/usr/bin/2to3-${version%.*}
python:pydoc:/usr/bin/pydoc${version%.*}
python:python:/usr/bin/python${version%.*}
python:python.1:/usr/share/man/man1/python${version%.*}.1"
@ -126,36 +124,43 @@ do_install() {
rm ${DESTDIR}/${py3_lib}/LICENSE.txt
rm -f ${DESTDIR}/usr/bin/2to3
local _dst_py3_lib="${DESTDIR}/${py3_lib}"
# Remove files that belong to python3-tkinter and idle-python3
rm -f ${DESTDIR}/usr/bin/idle3*
rm -rf ${DESTDIR}/usr/lib/python${version%.*}/idlelib
rm -rf ${DESTDIR}/usr/lib/python${version%.*}/tkinter
rm -rf ${DESTDIR}/usr/lib/python${version%.*}/turtledemo
rm -f ${DESTDIR}/usr/lib/python${version%.*}/turtle.py
rm ${DESTDIR}/usr/bin/idle3*
rm ${_dst_py3_lib}/turtle.py
rm -r ${_dst_py3_lib}/idlelib
rm -r ${_dst_py3_lib}/tkinter
rm -r ${_dst_py3_lib}/turtledemo
# Remove test module and tests that fail to be byte-compiled.
rm -rf ${DESTDIR}/usr/lib/python${version%.*}/test
rm -rf ${DESTDIR}/usr/lib/python${version%.*}/lib2to3/tests
rm -rf ${_dst_py3_lib}/test
rm -rf ${_dst_py3_lib}/lib2to3/tests
# Remove references to the install(1) wrapper.
sed -e "s,${XBPS_WRAPPERDIR},/usr/bin,g" -i \
${DESTDIR}/usr/lib/python${version%.*}/_sysconfigdata_*_*.py \
${DESTDIR}/usr/lib/python${version%.*}/config-${version%.*}*/Makefile
${_dst_py3_lib}/_sysconfigdata_*_*.py \
${_dst_py3_lib}/config-${version%.*}*/Makefile
if [ "$CROSS_BUILD" ]; then
# Remove references to cross toolchain.
sed -i "s/$XBPS_CROSS_TRIPLET-//g" \
${DESTDIR}/usr/lib/python${version%.*}/_sysconfigdata_*_*.py \
${DESTDIR}/usr/lib/python${version%.*}/config-${version%.*}*/Makefile
${_dst_py3_lib}/_sysconfigdata_*_*.py \
${_dst_py3_lib}/config-${version%.*}*/Makefile
sed -i -e "s,$XBPS_CROSS_BASE,,g" \
${DESTDIR}/usr/bin/python${version%.*}-config
fi
sed -i -e "s,-fdebug-prefix-map=[^[:space:]]*=[.],," \
sed -i -e "s,-I./External,," \
-e "s,-ffile-prefix-map=[^[:space:]]*=[.],," \
-e "s,-I./External,," \
-e "s,-fdebug-prefix-map=[^[:space:]]*=[.],," \
${DESTDIR}/usr/bin/python${version%.*}-config \
${DESTDIR}/usr/lib/python${version%.*}/_sysconfigdata_*_*.py \
${DESTDIR}/usr/lib/python${version%.*}/config-${version%.*}*/Makefile
${_dst_py3_lib}/_sysconfigdata_*_*.py \
${_dst_py3_lib}/config-${version%.*}*/Makefile
# https://peps.python.org/pep-0668/
vinstall ${FILESDIR}/EXTERNALLY-MANAGED 644 usr/lib/python${version%.*}
vinstall ${FILESDIR}/EXTERNALLY-MANAGED 644 "${py3_lib}"
}
python3-devel_package() {
@ -165,10 +170,9 @@ python3-devel_package() {
vmove usr/bin/python*-config
vmove usr/lib/pkgconfig
vmove usr/include
mv ${DESTDIR}/usr/lib/python${version%.*}/config-${version%.*}*/libpython${version%.*}*.a \
${PKGDESTDIR}/usr/lib
mkdir -p ${DESTDIR}/usr/include/python${version%.*}
mv ${PKGDESTDIR}/usr/include/python${version%.*}/pyconfig.h \
${DESTDIR}/usr/include/python${version%.*}
mv "${DESTDIR}/${py3_lib}"/config-*/libpython*.a "${PKGDESTDIR}/usr/lib"
mkdir -p "${DESTDIR}/${py3_inc}"
mv "${PKGDESTDIR}/${py3_inc}/pyconfig.h" "${DESTDIR}/${py3_inc}"
}
}