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 new file mode 100644 index 0000000000..b8b8890aef --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/dev-lang/python-oem/README.md @@ -0,0 +1,65 @@ +Modifications made: + +- Drop python updater and eselect python stuff (so the pkg_ functions). + +- Drop src_test and the test use flag. + +- Rename one patch in PATCHES variable, so I don't need to rename the + file (the name in ebuild was using `${PN}`, which in + `dev-lang/python` expands to `python`, whereas in + `dev-lang/python-oem` it would expand to `python-oem`). + +- Drop the following use flags and simplify the ebuild assuming that + they were disabled: examples, gdbm, libressl, ncurses, sqlite, ssl, + tk, wininst. + +- Drop the following use flags and simplify the ebuild assuming that + they were enabled: build, ipv6, threads. + +- Drop xml use flag, but keep the internal copies of expat, do not + disable _elementtree and pyexpat modules and tell the configure + script to use the internal stuff. + +- Keep using internal libffi, instead of depending on system-provided + libffi. + +- Move RDEPEND to DEPEND, so RDEPEND remains empty. OEM packages are + installed after prod images are pruned of the previously installed + package database. + +- Make the following changes in configure flags: + + - Add --prefix=/usr/share/oem/python to the myeconfargs variable. + + - Change --enable-shared to --disable-shared. + + - Set --mandir, --infodir and --includedir to some subdirectory of + /discard, so during installation this could be easily removed. + +- Export some configure variables for the cross-compilation: + ac_cv_file__dev_ptc and ac_cv_file__dev_ptmx. If not done, build + will fail with a message saying that these should be set to either + yes or no. + +- Simplify src_install: + + - Replace the hardcoded ${ED}/usr/bin with bindir variable set to + ${ED}/usr/share/oem/python/bin. + + - Create versionless links (python and python3) to python executable. + + - Drop sed stuff mucking with LDFLAGS. + + - Drop collision fixes. + + - Drop ABIFLAGS hack. + + - Do not install ACKS, HISTORY and NEWS files. + + - Drop gdb autoload stuff. + + - Drop pydoc.{conf,init} stuff. + + - Drop python-exec stuff. + + - Remove installed stuff in /discard. diff --git a/sdk_container/src/third_party/coreos-overlay/dev-lang/python-oem/python-oem-3.6.5.ebuild b/sdk_container/src/third_party/coreos-overlay/dev-lang/python-oem/python-oem-3.6.5.ebuild index 07d92a8c3a..cfeef9768e 100644 --- a/sdk_container/src/third_party/coreos-overlay/dev-lang/python-oem/python-oem-3.6.5.ebuild +++ b/sdk_container/src/third_party/coreos-overlay/dev-lang/python-oem/python-oem-3.6.5.ebuild @@ -17,54 +17,32 @@ SRC_URI="https://www.python.org/ftp/python/${PV}/${MY_P}.tar.xz LICENSE="PSF-2" SLOT="3.6/3.6m" KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~x86-fbsd" -IUSE="build examples gdbm hardened ipv6 libressl +ncurses +readline sqlite +ssl test +threads tk wininst +xml" -RESTRICT="!test? ( test )" +IUSE="hardened" # Do not add a dependency on dev-lang/python to this ebuild. # If you need to apply a patch which requires python for bootstrapping, please # run the bootstrap code on your dev box and include the results in the # patchset. See bug 447752. -RDEPEND="app-arch/bzip2:0= +RDEPEND="" +DEPEND="app-arch/bzip2:0= app-arch/xz-utils:0= >=sys-libs/zlib-1.1.3:0= - virtual/libffi:= virtual/libintl - gdbm? ( sys-libs/gdbm:0=[berkdb] ) - ncurses? ( >=sys-libs/ncurses-5.2:0= ) - readline? ( >=sys-libs/readline-4.1:0= ) - sqlite? ( >=dev-db/sqlite-3.3.8:3= ) - ssl? ( - !libressl? ( dev-libs/openssl:0= ) - libressl? ( dev-libs/libressl:0= ) - ) - tk? ( - >=dev-lang/tcl-8.0:0= - >=dev-lang/tk-8.0:0= - dev-tcltk/blt:0= - dev-tcltk/tix - ) - xml? ( >=dev-libs/expat-2.1:0= ) - !!/dev/null) - newins "${S}"/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" - - # for python-exec - local vars=( EPYTHON PYTHON_SITEDIR PYTHON_SCRIPTDIR ) - - # if not using a cross-compiler, use the fresh binary - if ! tc-is-cross-compiler; then - local -x PYTHON=./python - local -x LD_LIBRARY_PATH=${LD_LIBRARY_PATH+${LD_LIBRARY_PATH}:}${PWD} - else - vars=( PYTHON "${vars[@]}" ) - fi - - python_export "python${PYVER}" "${vars[@]}" - echo "EPYTHON='${EPYTHON}'" > epython.py || die - python_domodule epython.py - - # python-exec wrapping support - local pymajor=${PYVER%.*} - mkdir -p "${D}${PYTHON_SCRIPTDIR}" || die - # python and pythonX - ln -s "../../../bin/${abiver}" \ - "${D}${PYTHON_SCRIPTDIR}/python${pymajor}" || die - ln -s "python${pymajor}" \ - "${D}${PYTHON_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 > "${D}${PYTHON_SCRIPTDIR}/python${pymajor}-config" <<-EOF || die - #!/bin/sh - exec "${abiver}-config" "\${@}" - EOF - chmod +x "${D}${PYTHON_SCRIPTDIR}/python${pymajor}-config" || die - ln -s "python${pymajor}-config" \ - "${D}${PYTHON_SCRIPTDIR}/python-config" || die - # 2to3, pydoc, pyvenv - ln -s "../../../bin/2to3-${PYVER}" \ - "${D}${PYTHON_SCRIPTDIR}/2to3" || die - ln -s "../../../bin/pydoc${PYVER}" \ - "${D}${PYTHON_SCRIPTDIR}/pydoc" || die - ln -s "../../../bin/pyvenv-${PYVER}" \ - "${D}${PYTHON_SCRIPTDIR}/pyvenv" || die - # idle - if use tk; then - ln -s "../../../bin/idle${PYVER}" \ - "${D}${PYTHON_SCRIPTDIR}/idle" || die - fi -} - -pkg_preinst() { - if has_version "<${CATEGORY}/${PN}-${PYVER}" && ! has_version ">=${CATEGORY}/${PN}-${PYVER}_alpha"; then - python_updater_warning="1" - fi -} - -eselect_python_update() { - if [[ -z "$(eselect python show)" || ! -f "${EROOT}usr/bin/$(eselect python show)" ]]; then - eselect python update - fi - - if [[ -z "$(eselect python show --python${PV%%.*})" || ! -f "${EROOT}usr/bin/$(eselect python show --python${PV%%.*})" ]]; then - eselect python update --python${PV%%.*} - fi -} - -pkg_postinst() { - eselect_python_update - - if [[ "${python_updater_warning}" == "1" ]]; then - ewarn "You have just upgraded from an older version of Python." - ewarn - ewarn "Please adjust PYTHON_TARGETS (if so desired), and run emerge with the --newuse or --changed-use option to rebuild packages installing python modules." - fi -} - -pkg_postrm() { - eselect_python_update + rm -r "${ED}/discard" || die }