diff --git a/sdk_container/src/third_party/coreos-overlay/dev-lang/python-oem/README.md b/sdk_container/src/third_party/coreos-overlay/dev-lang/python-oem/README.md
deleted file mode 100644
index 12b071faeb..0000000000
--- a/sdk_container/src/third_party/coreos-overlay/dev-lang/python-oem/README.md
+++ /dev/null
@@ -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.
diff --git a/sdk_container/src/third_party/coreos-overlay/dev-lang/python-oem/metadata.xml b/sdk_container/src/third_party/coreos-overlay/dev-lang/python-oem/metadata.xml
index 097975e3ad..66d5aec84c 100644
--- a/sdk_container/src/third_party/coreos-overlay/dev-lang/python-oem/metadata.xml
+++ b/sdk_container/src/third_party/coreos-overlay/dev-lang/python-oem/metadata.xml
@@ -1,4 +1,43 @@
-
+
+
+ python@gentoo.org
+ Python
+
+
+
+ cpe:/a:python:python
+ python/cpython
+
diff --git a/sdk_container/src/third_party/coreos-overlay/dev-lang/python-oem/python-oem-3.10.10_p2.ebuild b/sdk_container/src/third_party/coreos-overlay/dev-lang/python-oem/python-oem-3.10.10_p2.ebuild
index a724285250..3f45df96fd 100644
--- a/sdk_container/src/third_party/coreos-overlay/dev-lang/python-oem/python-oem-3.10.10_p2.ebuild
+++ b/sdk_container/src/third_party/coreos-overlay/dev-lang/python-oem/python-oem-3.10.10_p2.ebuild
@@ -28,7 +28,7 @@ S="${WORKDIR}/${MY_P}"
LICENSE="PSF-2"
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="
bluetooth build +ensurepip examples gdbm hardened libedit lto
+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
# 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="
app-arch/bzip2:=
app-arch/xz-utils:=
dev-lang/python-exec[python_targets_python3_10(-)]
+ dev-libs/libffi:=
dev-python/gentoo-common
sys-apps/util-linux:=
>=sys-libs/zlib-1.1.3:=
@@ -67,6 +65,7 @@ RDEPEND="
dev-tcltk/blt:=
dev-tcltk/tix
)
+ xml? ( >=dev-libs/expat-2.1:= )
!!/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
-
- rm -r "${ED}/discard" || die
+ chmod +x "${scriptdir}/python${pymajor}-config" || 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
}