dev-lang/python-oem: Update to 3.10.10_p2

So we have matching versions of python in OEM and SDK.
This commit is contained in:
Krzesimir Nowak 2023-02-28 14:43:37 +01:00
parent fd5306a644
commit 9750e129d5
3 changed files with 97 additions and 115 deletions

View File

@ -1,3 +1,3 @@
DIST Python-3.10.9.tar.xz 19612112 BLAKE2B ef2d063a9fbaf234aa4a47149cb184a0379dc403515df10249104a5092750cdaf22ad47916d34e17dd68fff1c30338c0375f4e4e3cc9bde33e0896c1c3ba655b SHA512 d66ea8adeb6dc4951e612175f8838b3092967ff275b7a3470f2d86f470036aa2221e722c3144d90bcd230b88efd53dde204213f72f703e524e4b833e2ccc68e2 DIST Python-3.10.10.tar.xz 19627028 BLAKE2B 57fc6869fa05586158a170c1892d93a3036823bfafb9484b9d70bca6cdc3e76f75357622eace4bde9a4c0ca62a1bb79665e5751b41655f9f4d7e345547013ad8 SHA512 f0aee65970a68287b34c4eafcf35c6fa09c81ba234ac356db16fbbc6c36417e4ac67071e616d118f5e192d541d7f177dcab5585b9780e842f656c09e01c37ced
DIST Python-3.10.9.tar.xz.asc 833 BLAKE2B 8895c6cb5031b2463cc6ba3e0dc56bee40c2e99117c062f9c72f2b7adb0d5a49782b968abfc764117e8513bd12816915245677c25b1710e3dae3c9e26937c2b9 SHA512 525e166ede6836086de814c26fc880f41eaf1ed4bff6118f00342e42f7ab1c47148447ced1b565e146d3125fa06b5cd6b394a256bc61096766b26e07f18bbf10 DIST Python-3.10.10.tar.xz.asc 833 BLAKE2B fd60e6268f7dd6676ea58bd7e80c513506ac9810c1a62ff060134207b0fd8e7b096d5f11f3cc536a1578144ff54c00bcb076d3c3f5889a69a898660dd280312b SHA512 591746d74c6123bf36c763b6e8e1de1554f02eeff30c855623ef0f12d3864d5573eb5efe96d6e142f24627c77b90738ada3456df4ad59bddcb008658f2ca8af9
DIST python-gentoo-patches-3.10.9.tar.xz 12216 BLAKE2B ced4f951089c51ddaab6c62ade9d2c84f69e7e1baf2acf5247559534c7d0fb0e88dca1222f5bd2209b4e61f5aca17279b8054f269535dbc10de0786c2c5779f5 SHA512 2d01f0f3831beeba004517bb82f7d616f25f08e5c755409ecff79cd68e0a619b5bf6802fffd0e5f7f39f1d9d93e65b018b91cdeb337a5e47f1651f36bea0e96e DIST python-gentoo-patches-3.10.10_p2.tar.xz 13992 BLAKE2B e18e708888dd28c8f238d4897aff79483a679396a168d8b5ff4f5e8c7f09cec5f1b13aeb327d3dc3e2149c2117c25da050987f1f1c3322b56c87245ba2d0b54d SHA512 14bc218a2f3c64ef9f42682fd1364208bcaa74f787dee39bd9566e40764c260a65fd42961be47a6e6c6227091cb2fef83e1d689302448647560689e20e07efe0

View File

@ -1,45 +0,0 @@
Modifications made:
- Keep using internal expat and libffi, thus dropping dev-libs/libffi
and dev-libs/expat from the dependencies.
- Drop dev-python/gentoo-common dependency, it provides the
EXTERNALLY-MANAGED file, but we will provide our own.
- Since this package is installed only for OEM partition as a binary
package, and the installation there happens after the packages
database is removed, we unset the RDEPEND variable. The RDEPEND
variable needs to be empty as it's also used during the binary
package installation. The contents of RDEPEND are already inside the
DEPEND variable, so we are safe.
- We modify the configure flags:
- Add `--prefix=/usr/share/oem/python` as `/usr/share/oem` is where
the OEM partition is mounted.
- Add `--with-platlibdir="$(get_libdir)"`, this is to make sure that
consistent library directory gets picked. In our case for both
amd64 and arm64, it's lib64.
- Change `--enable-shared` to `--disable-shared`. This will skip
building dynamic libraries, as we don't need them.
- Add `--includedir=/discard/include` and change `--mandir` and
`--infodir` to also use `/discard` to install files there. Makes
it easy to remove the unnecessary files.
- We disable loadable sqlite extensions.
- As we want to use the internal versions of expat and libffi, we
change `--with-system-{expat,ffi}` to
`--without-system-{expat,ffi}`.
- Comment out the `--with-wheel-pkg-dir` as it's some ensurepip
stuff we are disabling anyway.
- Essentially drop `src_install` and write our own variant, where we
run `make altinstall`, remove unnecessary files (the original
`src_install` could be read to find out which files to remove),
creates a versionless python symlink, adds an EXTERNALLY-MANAGED
file, and removes the `/discard` directory.

View File

@ -28,7 +28,7 @@ S="${WORKDIR}/${MY_P}"
LICENSE="PSF-2" LICENSE="PSF-2"
SLOT="${PYVER}" SLOT="${PYVER}"
KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86" KEYWORDS="~alpha amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
IUSE=" IUSE="
bluetooth build +ensurepip examples gdbm hardened libedit lto bluetooth build +ensurepip examples gdbm hardened libedit lto
+ncurses pgo +readline +sqlite +ssl test tk valgrind +xml +ncurses pgo +readline +sqlite +ssl test tk valgrind +xml
@ -40,13 +40,11 @@ RESTRICT="!test? ( test )"
# run the bootstrap code on your dev box and include the results in the # run the bootstrap code on your dev box and include the results in the
# patchset. See bug 447752. # patchset. See bug 447752.
# Flatcar: Drop a dependency on dev-libs/expat, we will use the internal one.
# Flatcar: Drop a dependency on dev-libs/libffi, we will use the internal one.
# Flatcar: Drop a dependency on dev-python/gentoo-common, we will install our own EXTERNALLY-MANAGED file
RDEPEND=" RDEPEND="
app-arch/bzip2:= app-arch/bzip2:=
app-arch/xz-utils:= app-arch/xz-utils:=
dev-lang/python-exec[python_targets_python3_10(-)] dev-lang/python-exec[python_targets_python3_10(-)]
dev-libs/libffi:=
dev-python/gentoo-common dev-python/gentoo-common
sys-apps/util-linux:= sys-apps/util-linux:=
>=sys-libs/zlib-1.1.3:= >=sys-libs/zlib-1.1.3:=
@ -67,6 +65,7 @@ RDEPEND="
dev-tcltk/blt:= dev-tcltk/blt:=
dev-tcltk/tix dev-tcltk/tix
) )
xml? ( >=dev-libs/expat-2.1:= )
!!<sys-apps/sandbox-2.21 !!<sys-apps/sandbox-2.21
" "
# bluetooth requires headers from bluez # bluetooth requires headers from bluez
@ -87,11 +86,6 @@ RDEPEND+="
!build? ( app-misc/mime-types ) !build? ( app-misc/mime-types )
" "
# Flatcar: Unset RDEPEND, DEPEND already contains it. OEM packages are
# installed after production images are pruned of the previously
# installed package database.
unset RDEPEND
VERIFY_SIG_OPENPGP_KEY_PATH=${BROOT}/usr/share/openpgp-keys/python.org.asc VERIFY_SIG_OPENPGP_KEY_PATH=${BROOT}/usr/share/openpgp-keys/python.org.asc
# large file tests involve a 2.5G file being copied (duplicated) # large file tests involve a 2.5G file being copied (duplicated)
@ -115,11 +109,9 @@ src_unpack() {
} }
src_prepare() { src_prepare() {
# Flatcar: We keep the internal expat copy. # Ensure that internal copies of expat and libffi are not used.
# Flatcar: We keep the internal libffi copy. rm -r Modules/expat || die
# # Ensure that internal copies of expat and libffi are not used. rm -r Modules/_ctypes/libffi* || die
# rm -r Modules/expat || die
# rm -r Modules/_ctypes/libffi* || die
local PATCHES=( local PATCHES=(
"${WORKDIR}/${PATCHSET}" "${WORKDIR}/${PATCHSET}"
@ -215,37 +207,19 @@ src_configure() {
# a chance for users rebuilding python before glibc # a chance for users rebuilding python before glibc
ac_cv_header_stropts_h=no ac_cv_header_stropts_h=no
# Flatcar: Use oem-specific prefix. --enable-shared
--prefix=/usr/share/oem/python
# Flatcar: Make sure we put libs into a correct subdirectory.
--with-platlibdir="$(get_libdir)"
# Flatcar: No need for shared libs.
# --enable-shared
--disable-shared
--without-static-libpython --without-static-libpython
--enable-ipv6 --enable-ipv6
# Flatcar: Set includedir to discardable directory --infodir='${prefix}/share/info'
--includedir='/discard/include' --mandir='${prefix}/share/man'
# Flatcar: Set infodir and mandir to discardable directory
# --infodir='/${prefix}/share/info'
# --mandir='/${prefix}/share/man'
--infodir='/discard/info'
--mandir='/discard/man'
--with-computed-gotos --with-computed-gotos
--with-dbmliborder="${dbmliborder}" --with-dbmliborder="${dbmliborder}"
--with-libc= --with-libc=
# Flatcar: No need for loadable extensions. --enable-loadable-sqlite-extensions
# --enable-loadable-sqlite-extensions
--disable-loadable-sqlite-extensions
--without-ensurepip --without-ensurepip
# Flatcar: We use internal expat --with-system-expat
# --with-system-expat --with-system-ffi
--without-system-expat --with-wheel-pkg-dir="${EPREFIX}"/usr/lib/python/ensurepip
# Flatcar: We use internal ffi
# --with-system-ffi
--without-system-ffi
# Flatcar: It's for ensurepip, which we disable
# --with-wheel-pkg-dir="${EPREFIX}"/usr/lib/python/ensurepip
$(use_with lto) $(use_with lto)
$(use_enable pgo optimizations) $(use_enable pgo optimizations)
@ -421,39 +395,92 @@ src_test() {
[[ ${ret} -eq 0 ]] || die "emake test failed" [[ ${ret} -eq 0 ]] || die "emake test failed"
} }
# Flatcar: Rewrite src_install to just run make altinstall, remove
# some installed files (refer to the original src_install to see which
# files to drop), adding symlinks and the EXTERNALLY-MANAGED file, and
# removing the /discard directory.
src_install() { src_install() {
local prefix=/usr/share/oem/python local libdir=${ED}/usr/lib/python${PYVER}
local eprefix="${ED}${prefix}"
local libdir="${prefix}/$(get_libdir)"
local elibdir="${eprefix}/$(get_libdir)"
local pythonplatlibdir="${libdir}/python${PYVER}"
local epythonplatlibdir="${elibdir}/python${PYVER}"
local bindir="${prefix}/bin"
local ebindir="${eprefix}/bin"
emake DESTDIR="${D}" altinstall emake DESTDIR="${D}" altinstall
rm -r "${epythonplatlibdir}"/ensurepip || die # Fix collisions between different slots of Python.
rm -r "${epythonplatlibdir}/"{sqlite3,test/test_sqlite*} || die rm "${ED}/usr/$(get_libdir)/libpython3.so" || die
rm -r "${ebindir}/idle${PYVER}" || die
rm -r "${epythonplatlibdir}/"{idlelib,tkinter,test/test_tk*} || die
# create a simple versionless 'python' symlink # Cheap hack to get version with ABIFLAGS
dosym "python${PYVER}" "${bindir}/python" local abiver=$(cd "${ED}/usr/include"; echo python*)
dosym "python${PYVER}" "${bindir}/python3" if [[ ${abiver} != python${PYVER} ]]; then
# Replace python3.X with a symlink to python3.Xm
rm "${ED}/usr/bin/python${PYVER}" || die
dosym "${abiver}" "/usr/bin/python${PYVER}"
# Create python3.X-config symlink
dosym "${abiver}-config" "/usr/bin/python${PYVER}-config"
# Create python-3.5m.pc symlink
dosym "python-${PYVER}.pc" "/usr/$(get_libdir)/pkgconfig/${abiver/${PYVER}/-${PYVER}}.pc"
fi
insinto "${pythonplatlibdir}" # python seems to get rebuilt in src_install (bug 569908)
# https://peps.python.org/pep-0668/ # Work around it for now.
newins - EXTERNALLY-MANAGED <<-EOF if has_version dev-libs/libffi[pax-kernel]; then
[externally-managed] pax-mark E "${ED}/usr/bin/${abiver}"
Error= else
Please contact Flatcar maintainers if some python package pax-mark m "${ED}/usr/bin/${abiver}"
is necessary for this OEM image. fi
rm -r "${libdir}"/ensurepip/_bundled || die
if ! use ensurepip; then
rm -r "${libdir}"/ensurepip || die
fi
if ! use sqlite; then
rm -r "${libdir}/"{sqlite3,test/test_sqlite*} || die
fi
if ! use tk; then
rm -r "${ED}/usr/bin/idle${PYVER}" || die
rm -r "${libdir}/"{idlelib,tkinter,test/test_tk*} || die
fi
ln -s ../python/EXTERNALLY-MANAGED "${libdir}/EXTERNALLY-MANAGED" || die
dodoc Misc/{ACKS,HISTORY,NEWS}
if use examples; then
docinto examples
find Tools -name __pycache__ -exec rm -fr {} + || die
dodoc -r Tools
fi
insinto /usr/share/gdb/auto-load/usr/$(get_libdir) #443510
local libname=$(
printf 'e:\n\t@echo $(INSTSONAME)\ninclude Makefile\n' |
emake --no-print-directory -s -f - 2>/dev/null
)
newins Tools/gdb/libpython.py "${libname}"-gdb.py
newconfd "${FILESDIR}/pydoc.conf" pydoc-${PYVER}
newinitd "${FILESDIR}/pydoc.init" pydoc-${PYVER}
sed \
-e "s:@PYDOC_PORT_VARIABLE@:PYDOC${PYVER/./_}_PORT:" \
-e "s:@PYDOC@:pydoc${PYVER}:" \
-i "${ED}/etc/conf.d/pydoc-${PYVER}" \
"${ED}/etc/init.d/pydoc-${PYVER}" || die "sed failed"
# python-exec wrapping support
local pymajor=${PYVER%.*}
local EPYTHON=python${PYVER}
local scriptdir=${D}$(python_get_scriptdir)
mkdir -p "${scriptdir}" || die
# python and pythonX
ln -s "../../../bin/${abiver}" "${scriptdir}/python${pymajor}" || die
ln -s "python${pymajor}" "${scriptdir}/python" || die
# python-config and pythonX-config
# note: we need to create a wrapper rather than symlinking it due
# to some random dirname(argv[0]) magic performed by python-config
cat > "${scriptdir}/python${pymajor}-config" <<-EOF || die
#!/bin/sh
exec "${abiver}-config" "\${@}"
EOF EOF
chmod +x "${scriptdir}/python${pymajor}-config" || die
rm -r "${ED}/discard" || die ln -s "python${pymajor}-config" "${scriptdir}/python-config" || die
# 2to3, pydoc
ln -s "../../../bin/2to3-${PYVER}" "${scriptdir}/2to3" || die
ln -s "../../../bin/pydoc${PYVER}" "${scriptdir}/pydoc" || die
# idle
if use tk; then
ln -s "../../../bin/idle${PYVER}" "${scriptdir}/idle" || die
fi
} }