python: update to 2.7.18.

switch to vsed revealed useless `hardened-*` removals

This will very likely be the very last Python2 version.

https://lwn.net/Articles/818000/
This commit is contained in:
Piraty 2020-04-20 23:41:21 +02:00
parent 24459e5ac6
commit ef6ac962bb

View file

@ -3,8 +3,8 @@
# THIS PKG MUST BE SYNCHRONIZED WITH "srcpkgs/python-tkinter". # THIS PKG MUST BE SYNCHRONIZED WITH "srcpkgs/python-tkinter".
# #
pkgname=python pkgname=python
version=2.7.17 version=2.7.18
revision=3 revision=1
wrksrc="Python-${version}" wrksrc="Python-${version}"
pycompile_dirs="usr/lib/python2.7" pycompile_dirs="usr/lib/python2.7"
hostmakedepends="pkg-config" hostmakedepends="pkg-config"
@ -16,7 +16,7 @@ maintainer="Orphaned <orphan@voidlinux.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" distfiles="https://www.python.org/ftp/python/${version}/Python-${version}.tar.xz"
checksum=4d43f033cdbd0aa7b7023c81b0e986fd11e653b5248dac9144d508f11812ba41 checksum=b62c0e7937551d0cc02b8fd5cb0f544f9405bafc9a54d3808ed4594812edef43
alternatives=" alternatives="
python:idle:/usr/bin/idle2.7 python:idle:/usr/bin/idle2.7
@ -31,7 +31,7 @@ pre_configure() {
rm -r Modules/_ctypes/libffi* rm -r Modules/_ctypes/libffi*
rm -r Modules/zlib rm -r Modules/zlib
# Enable loading sqlite extensions. # Enable loading sqlite extensions.
sed -i '/SQLITE_OMIT_LOAD_EXTENSION/d' setup.py vsed -i '/SQLITE_OMIT_LOAD_EXTENSION/d' setup.py
} }
do_configure() { do_configure() {
@ -83,17 +83,13 @@ post_install() {
# Remove test module and tests that fail to be byte-compiled. # Remove test module and tests that fail to be byte-compiled.
rm -r ${DESTDIR}/usr/lib/python2.7/test rm -r ${DESTDIR}/usr/lib/python2.7/test
rm -r ${DESTDIR}/usr/lib/python2.7/lib2to3/tests rm -r ${DESTDIR}/usr/lib/python2.7/lib2to3/tests
# Remove references to hardening -specs.
sed -e 's|\(-specs=.*hardened-ld\)||g' -e 's|\(-specs=.*hardened-cc1\)||g' -i \
${DESTDIR}/usr/lib/python${version%.*}/_sysconfigdata.py \
${DESTDIR}/usr/lib/python${version%.*}/config/Makefile
# Remove references to the install(1) wrapper. # Remove references to the install(1) wrapper.
sed -e "s,${XBPS_WRAPPERDIR},/usr/bin,g" -i \ vsed -e "s,${XBPS_WRAPPERDIR},/usr/bin,g" -i \
${DESTDIR}/usr/lib/python${version%.*}/_sysconfigdata.py \ ${DESTDIR}/usr/lib/python${version%.*}/_sysconfigdata.py \
${DESTDIR}/usr/lib/python${version%.*}/config/Makefile ${DESTDIR}/usr/lib/python${version%.*}/config/Makefile
if [ "$CROSS_BUILD" ]; then if [ "$CROSS_BUILD" ]; then
# Remove references to cross toolchain. # Remove references to cross toolchain.
sed -i "s/$XBPS_CROSS_TRIPLET-//g" \ vsed -i "s/$XBPS_CROSS_TRIPLET-//g" \
${DESTDIR}/usr/lib/python${version%.*}/_sysconfigdata.py \ ${DESTDIR}/usr/lib/python${version%.*}/_sysconfigdata.py \
${DESTDIR}/usr/lib/python${version%.*}/config/Makefile ${DESTDIR}/usr/lib/python${version%.*}/config/Makefile
fi fi