blob: 66f0c1b239b21aa8a5cdc93bccae917d2d9fbb15 [file] [log] [blame]
Mike Frysingerdc5029f2021-02-19 15:53:47 -05001# Copyright 1999-2021 Gentoo Authors
Chad Versace9c71f3c2018-10-24 16:49:31 -07002# Distributed under the terms of the GNU General Public License v2
3
Mike Frysinger0e245162021-02-19 15:39:45 -05004EAPI="7"
Chad Versace9c71f3c2018-10-24 16:49:31 -07005WANT_LIBTOOL="none"
6
Mike Frysingerdc5029f2021-02-19 15:53:47 -05007inherit autotools flag-o-matic multiprocessing pax-utils \
8 python-utils-r1 toolchain-funcs
Chad Versace9c71f3c2018-10-24 16:49:31 -07009
10MY_P="Python-${PV}"
Mike Frysinger0e245162021-02-19 15:39:45 -050011PYVER=$(ver_cut 1-2)
Mike Frysingerdc5029f2021-02-19 15:53:47 -050012PATCHSET="python-gentoo-patches-${PV}-r1"
Chad Versace9c71f3c2018-10-24 16:49:31 -070013
14DESCRIPTION="An interpreted, interactive, object-oriented programming language"
15HOMEPAGE="https://www.python.org/"
16SRC_URI="https://www.python.org/ftp/python/${PV}/${MY_P}.tar.xz
Mike Frysinger0e245162021-02-19 15:39:45 -050017 https://dev.gentoo.org/~mgorny/dist/python/${PATCHSET}.tar.xz"
18S="${WORKDIR}/${MY_P}"
Chad Versace9c71f3c2018-10-24 16:49:31 -070019
20LICENSE="PSF-2"
Mike Frysinger0e245162021-02-19 15:39:45 -050021SLOT="${PYVER}/${PYVER}m"
Daniel Campello7ded4e32019-02-06 11:03:46 -070022KEYWORDS="*"
Mike Frysinger432f2892021-02-19 15:22:02 -050023IUSE="bluetooth build examples gdbm hardened ipv6 libressl +ncurses +readline sqlite +ssl test +threads tk wininst +xml"
Chad Versace9c71f3c2018-10-24 16:49:31 -070024RESTRICT="!test? ( test )"
25
26# Do not add a dependency on dev-lang/python to this ebuild.
27# If you need to apply a patch which requires python for bootstrapping, please
28# run the bootstrap code on your dev box and include the results in the
29# patchset. See bug 447752.
30
Mike Frysinger0e245162021-02-19 15:39:45 -050031RDEPEND="app-arch/bzip2:=
32 app-arch/xz-utils:=
Mike Frysinger432f2892021-02-19 15:22:02 -050033 dev-libs/libffi:=
Mike Frysinger0e245162021-02-19 15:39:45 -050034 >=sys-libs/zlib-1.1.3:=
35 virtual/libcrypt:=
Chad Versace9c71f3c2018-10-24 16:49:31 -070036 virtual/libintl
Mike Frysinger0e245162021-02-19 15:39:45 -050037 gdbm? ( sys-libs/gdbm:=[berkdb] )
38 ncurses? ( >=sys-libs/ncurses-5.2:= )
39 readline? ( >=sys-libs/readline-4.1:= )
Chad Versace9c71f3c2018-10-24 16:49:31 -070040 sqlite? ( >=dev-db/sqlite-3.3.8:3= )
41 ssl? (
Mike Frysinger0e245162021-02-19 15:39:45 -050042 !libressl? ( dev-libs/openssl:= )
43 libressl? ( dev-libs/libressl:= )
Chad Versace9c71f3c2018-10-24 16:49:31 -070044 )
45 tk? (
Mike Frysinger0e245162021-02-19 15:39:45 -050046 >=dev-lang/tcl-8.0:=
47 >=dev-lang/tk-8.0:=
48 dev-tcltk/blt:=
Chad Versace9c71f3c2018-10-24 16:49:31 -070049 dev-tcltk/tix
50 )
Mike Frysinger0e245162021-02-19 15:39:45 -050051 xml? ( >=dev-libs/expat-2.1:= )"
Mike Frysinger432f2892021-02-19 15:22:02 -050052# bluetooth requires headers from bluez
Chad Versace9c71f3c2018-10-24 16:49:31 -070053DEPEND="${RDEPEND}
Mike Frysinger432f2892021-02-19 15:22:02 -050054 bluetooth? ( net-wireless/bluez )
Chad Versace9c71f3c2018-10-24 16:49:31 -070055 test? ( app-arch/xz-utils[extra-filters(+)] )
56 virtual/pkgconfig
57 !sys-devel/gcc[libffi(-)]"
58RDEPEND+=" !build? ( app-misc/mime-types )"
59PDEPEND=">=app-eselect/eselect-python-20140125-r1"
60
George Burgess IVddce0e22021-03-23 15:43:20 -070061# Google-specific PGO bits
62#
63# NOTE: If you're looking here because python-*-profile.tar.xz is missing:
64# - thanks for upgrading Python!
65# - files/python3_gen_pgo.sh should be able to generate a PGO profile for you.
66# - only new minor versions of Python should require a new PGO profile.
67#
68# Generally, PGO profile generation should be done as one of the last steps of
69# a Python upgrade, so feel free to turn pgo_use off as a default until things
70# are pretty finalized.
71SRC_URI+=" pgo_use? ( gs://chromeos-localmirror/distfiles/python-$(ver_cut 1-2)-profile.tar.xz )"
72IUSE+=" pgo_generate +pgo_use"
73REQUIRED_USE+=" pgo_generate? ( !pgo_use )"
74
Chad Versace9c71f3c2018-10-24 16:49:31 -070075src_prepare() {
76 # Ensure that internal copies of expat, libffi and zlib are not used.
Mike Frysinger0e245162021-02-19 15:39:45 -050077 rm -fr Modules/expat || die
78 rm -fr Modules/_ctypes/libffi* || die
79 rm -fr Modules/zlib || die
Chad Versace9c71f3c2018-10-24 16:49:31 -070080
Mike Frysinger95c720e2021-02-19 15:09:00 -050081 local PATCHES=(
Mike Frysinger0e245162021-02-19 15:39:45 -050082 "${WORKDIR}/${PATCHSET}"
Mike Frysinger95c720e2021-02-19 15:09:00 -050083 )
Chad Versace9c71f3c2018-10-24 16:49:31 -070084
Mike Frysinger95c720e2021-02-19 15:09:00 -050085 default
Chad Versace9c71f3c2018-10-24 16:49:31 -070086
87 # START: Chromium OS
Mike Frysingerce0b8c02019-07-11 00:40:18 -040088 if tc-is-cross-compiler ; then
Mike Frysinger0e245162021-02-19 15:39:45 -050089 eapply "${FILESDIR}/python-3.6.5-cross-h2py.patch"
90 eapply "${FILESDIR}/python-3.6.5-cross-hack-compiler.patch"
Mike Frysingerce0b8c02019-07-11 00:40:18 -040091 fi
Mike Frysinger0e245162021-02-19 15:39:45 -050092 eapply "${FILESDIR}/python-3.6.5-cross-python-config.patch"
93 eapply "${FILESDIR}/python-3.6.5-cross-setup-sysroot.patch"
94 eapply "${FILESDIR}/python-3.6.5-cross-distutils.patch"
95 eapply "${FILESDIR}/python-3.6.5-cross-sysconfig.patch"
96 eapply "${FILESDIR}/python-3.6.5-ldshared.patch"
97 eapply "${FILESDIR}/python-3.6.5-system-libffi.patch"
98 eapply "${FILESDIR}/python-3.6.5-sigint-handler.patch"
Chad Versace9c71f3c2018-10-24 16:49:31 -070099
George Burgess IVddce0e22021-03-23 15:43:20 -0700100 if use pgo_use; then
101 eapply "${FILESDIR}/python-3.6.12-pgo-use.patch"
102 cp "${WORKDIR}/code.profclangd" "${S}" || die
103 elif use pgo_generate; then
104 eapply "${FILESDIR}/python-3.6.12-pgo-generate.patch"
105 fi
106
Chad Versace9c71f3c2018-10-24 16:49:31 -0700107 # Undo the @libdir@ change for portage's pym folder as it is always
108 # installed into /usr/lib/ and not the abi libdir.
109 sed -i \
110 -e '/portage.*pym/s:@@GENTOO_LIBDIR@@:lib:g' \
111 Lib/site.py || die
112
113 sed -i -e "s:sys.exec_prefix]:sys.exec_prefix, '/usr/local']:g" \
114 Lib/site.py || die "sed failed to add /usr/local to prefixes"
115 # END: Chromium OS
116
117 sed -i -e "s:@@GENTOO_LIBDIR@@:$(get_libdir):g" \
118 Lib/distutils/command/install.py \
119 Lib/distutils/sysconfig.py \
120 Lib/site.py \
121 Lib/sysconfig.py \
122 Lib/test/test_site.py \
123 Makefile.pre.in \
124 Modules/Setup.dist \
125 Modules/getpath.c \
126 configure.ac \
127 setup.py || die "sed failed to replace @@GENTOO_LIBDIR@@"
128
Mike Frysingerdc5029f2021-02-19 15:53:47 -0500129 # force correct number of jobs
130 # https://bugs.gentoo.org/737660
131 local jobs=$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)")
132 sed -i -e "/self\.parallel/s:True:${jobs}:" setup.py || die
133
Chad Versace9c71f3c2018-10-24 16:49:31 -0700134 eautoreconf
135}
136
137src_configure() {
138 local disable
Mike Frysinger432f2892021-02-19 15:22:02 -0500139 # disable automagic bluetooth headers detection
140 use bluetooth || export ac_cv_header_bluetooth_bluetooth_h=no
Mike Frysinger0e245162021-02-19 15:39:45 -0500141 use gdbm || disable+=" gdbm"
142 use ncurses || disable+=" _curses _curses_panel"
143 use readline || disable+=" readline"
144 use sqlite || disable+=" _sqlite3"
145 use ssl || export PYTHON_DISABLE_SSL="1"
146 use tk || disable+=" _tkinter"
147 use xml || disable+=" _elementtree pyexpat" # _elementtree uses pyexpat.
Chad Versace9c71f3c2018-10-24 16:49:31 -0700148 export PYTHON_DISABLE_MODULES="${disable}"
149
150 if ! use xml; then
151 ewarn "You have configured Python without XML support."
152 ewarn "This is NOT a recommended configuration as you"
153 ewarn "may face problems parsing any XML documents."
154 fi
155
156 if [[ -n "${PYTHON_DISABLE_MODULES}" ]]; then
157 einfo "Disabled modules: ${PYTHON_DISABLE_MODULES}"
158 fi
159
160 if [[ "$(gcc-major-version)" -ge 4 ]]; then
161 append-flags -fwrapv
162 fi
163
164 filter-flags -malign-double
165
166 # https://bugs.gentoo.org/show_bug.cgi?id=50309
167 if is-flagq -O3; then
168 is-flagq -fstack-protector-all && replace-flags -O3 -O2
169 use hardened && replace-flags -O3 -O2
170 fi
171
172 # Export CXX so it ends up in /usr/lib/python3.X/config/Makefile.
173 tc-export CXX
174
175 # Set LDFLAGS so we link modules with -lpython3.2 correctly.
176 # Needed on FreeBSD unless Python 3.2 is already installed.
177 # Please query BSD team before removing this!
178 append-ldflags "-L."
179
Mike Frysingerce0b8c02019-07-11 00:40:18 -0400180 tc-export CC
181
Chad Versace9c71f3c2018-10-24 16:49:31 -0700182 local dbmliborder
183 if use gdbm; then
184 dbmliborder+="${dbmliborder:+:}gdbm"
185 fi
186
187 local myeconfargs=(
Mike Frysinger0e245162021-02-19 15:39:45 -0500188 # glibc-2.30 removes it; since we can't cleanly force-rebuild
189 # Python on glibc upgrade, remove it proactively to give
190 # a chance for users rebuilding python before glibc
191 ac_cv_header_stropts_h=no
192
Chad Versace9c71f3c2018-10-24 16:49:31 -0700193 --with-fpectl
194 --enable-shared
195 $(use_enable ipv6)
196 $(use_with threads)
197 --infodir='${prefix}/share/info'
198 --mandir='${prefix}/share/man'
199 --with-computed-gotos
200 --with-dbmliborder="${dbmliborder}"
201 --with-libc=
202 --enable-loadable-sqlite-extensions
203 --without-ensurepip
204 --with-system-expat
205 --with-system-ffi
206 )
207
George Burgess IVddce0e22021-03-23 15:43:20 -0700208 if use pgo_generate || use pgo_use; then
209 myeconfargs+=(
210 "LLVM_PROFDATA=$(which llvm-profdata)"
211 --enable-optimizations
212 )
213 fi
214
Chad Versace9c71f3c2018-10-24 16:49:31 -0700215 OPT="" econf "${myeconfargs[@]}"
216
217 if use threads && grep -q "#define POSIX_SEMAPHORES_NOT_ENABLED 1" pyconfig.h; then
218 eerror "configure has detected that the sem_open function is broken."
219 eerror "Please ensure that /dev/shm is mounted as a tmpfs with mode 1777."
220 die "Broken sem_open function (bug 496328)"
221 fi
222}
223
224src_compile() {
225 # Ensure sed works as expected
226 # https://bugs.gentoo.org/594768
227 local -x LC_ALL=C
228
229 emake CPPFLAGS= CFLAGS= LDFLAGS=
230
231 # Work around bug 329499. See also bug 413751 and 457194.
232 if has_version dev-libs/libffi[pax_kernel]; then
233 pax-mark E python
234 else
235 pax-mark m python
236 fi
237}
238
239src_test() {
240 # Tests will not work when cross compiling.
241 if tc-is-cross-compiler; then
242 elog "Disabling tests due to crosscompiling."
243 return
244 fi
245
246 # Skip failing tests.
Mike Frysingerdc5029f2021-02-19 15:53:47 -0500247 local skipped_tests="gdb faulthandler"
Chad Versace9c71f3c2018-10-24 16:49:31 -0700248
249 for test in ${skipped_tests}; do
250 mv "${S}"/Lib/test/test_${test}.py "${T}"
251 done
252
Mike Frysinger432f2892021-02-19 15:22:02 -0500253 # bug 660358
254 local -x COLUMNS=80
Chad Versace9c71f3c2018-10-24 16:49:31 -0700255 local -x PYTHONDONTWRITEBYTECODE=
256
Mike Frysingerdc5029f2021-02-19 15:53:47 -0500257 local jobs=$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)")
258
259 emake test EXTRATESTOPTS="-u-network -j${jobs}" \
260 CPPFLAGS= CFLAGS= LDFLAGS= < /dev/tty
Chad Versace9c71f3c2018-10-24 16:49:31 -0700261 local result=$?
262
263 for test in ${skipped_tests}; do
264 mv "${T}/test_${test}.py" "${S}"/Lib/test
265 done
266
267 elog "The following tests have been skipped:"
268 for test in ${skipped_tests}; do
269 elog "test_${test}.py"
270 done
271
272 elog "If you would like to run them, you may:"
273 elog "cd '${EPREFIX}/usr/$(get_libdir)/python${PYVER}/test'"
274 elog "and run the tests separately."
275
276 if [[ ${result} -ne 0 ]]; then
277 die "emake test failed"
278 fi
279}
280
281src_install() {
282 local libdir=${ED}/usr/$(get_libdir)/python${PYVER}
283
284 emake DESTDIR="${D}" altinstall
285
Mike Frysinger0e245162021-02-19 15:39:45 -0500286 # Remove static library
287 rm "${ED}"/usr/$(get_libdir)/libpython*.a || die
288
Chad Versace9c71f3c2018-10-24 16:49:31 -0700289 sed \
290 -e "s/\(CONFIGURE_LDFLAGS=\).*/\1/" \
291 -e "s/\(PY_LDFLAGS=\).*/\1/" \
292 -i "${libdir}/config-${PYVER}"*/Makefile || die "sed failed"
293
294 # Fix collisions between different slots of Python.
Mike Frysinger0e245162021-02-19 15:39:45 -0500295 rm "${ED}/usr/$(get_libdir)/libpython3.so" || die
Chad Versace9c71f3c2018-10-24 16:49:31 -0700296
297 # Cheap hack to get version with ABIFLAGS
Mike Frysinger0e245162021-02-19 15:39:45 -0500298 local abiver=$(cd "${ED}/usr/include"; echo python*)
Chad Versace9c71f3c2018-10-24 16:49:31 -0700299 if [[ ${abiver} != python${PYVER} ]]; then
300 # Replace python3.X with a symlink to python3.Xm
Mike Frysinger0e245162021-02-19 15:39:45 -0500301 rm "${ED}/usr/bin/python${PYVER}" || die
Chad Versace9c71f3c2018-10-24 16:49:31 -0700302 dosym "${abiver}" "/usr/bin/python${PYVER}"
303 # Create python3.X-config symlink
304 dosym "${abiver}-config" "/usr/bin/python${PYVER}-config"
305 # Create python-3.5m.pc symlink
306 dosym "python-${PYVER}.pc" "/usr/$(get_libdir)/pkgconfig/${abiver/${PYVER}/-${PYVER}}.pc"
307 fi
308
309 # python seems to get rebuilt in src_install (bug 569908)
310 # Work around it for now.
311 if has_version dev-libs/libffi[pax_kernel]; then
Mike Frysinger0e245162021-02-19 15:39:45 -0500312 pax-mark E "${ED}/usr/bin/${abiver}"
Chad Versace9c71f3c2018-10-24 16:49:31 -0700313 else
Mike Frysinger0e245162021-02-19 15:39:45 -0500314 pax-mark m "${ED}/usr/bin/${abiver}"
Chad Versace9c71f3c2018-10-24 16:49:31 -0700315 fi
316
317 use sqlite || rm -r "${libdir}/"{sqlite3,test/test_sqlite*} || die
Mike Frysinger0e245162021-02-19 15:39:45 -0500318 use tk || rm -r "${ED}/usr/bin/idle${PYVER}" "${libdir}/"{idlelib,tkinter,test/test_tk*} || die
Chad Versace9c71f3c2018-10-24 16:49:31 -0700319
320 use threads || rm -r "${libdir}/multiprocessing" || die
321 use wininst || rm "${libdir}/distutils/command/"wininst-*.exe || die
322
Mike Frysinger0e245162021-02-19 15:39:45 -0500323 dodoc Misc/{ACKS,HISTORY,NEWS}
Chad Versace9c71f3c2018-10-24 16:49:31 -0700324
325 if use examples; then
Mike Frysinger0e245162021-02-19 15:39:45 -0500326 docinto examples
327 find Tools -name __pycache__ -exec rm -fr {} + || die
328 dodoc -r Tools
Chad Versace9c71f3c2018-10-24 16:49:31 -0700329 fi
330 insinto /usr/share/gdb/auto-load/usr/$(get_libdir) #443510
331 local libname=$(printf 'e:\n\t@echo $(INSTSONAME)\ninclude Makefile\n' | \
332 emake --no-print-directory -s -f - 2>/dev/null)
333 newins "${S}"/Tools/gdb/libpython.py "${libname}"-gdb.py
334
335 newconfd "${FILESDIR}/pydoc.conf" pydoc-${PYVER}
336 newinitd "${FILESDIR}/pydoc.init" pydoc-${PYVER}
337 sed \
338 -e "s:@PYDOC_PORT_VARIABLE@:PYDOC${PYVER/./_}_PORT:" \
339 -e "s:@PYDOC@:pydoc${PYVER}:" \
Mike Frysinger0e245162021-02-19 15:39:45 -0500340 -i "${ED}/etc/conf.d/pydoc-${PYVER}" \
341 "${ED}/etc/init.d/pydoc-${PYVER}" || die "sed failed"
Chad Versace9c71f3c2018-10-24 16:49:31 -0700342
Mike Frysingerdc5029f2021-02-19 15:53:47 -0500343 local -x EPYTHON=python${PYVER}
Chad Versace9c71f3c2018-10-24 16:49:31 -0700344 # if not using a cross-compiler, use the fresh binary
345 if ! tc-is-cross-compiler; then
346 local -x PYTHON=./python
347 local -x LD_LIBRARY_PATH=${LD_LIBRARY_PATH+${LD_LIBRARY_PATH}:}${PWD}
348 else
Mike Frysingerdc5029f2021-02-19 15:53:47 -0500349 local -x PYTHON=${EPREFIX}/usr/bin/${EPYTHON}
Chad Versace9c71f3c2018-10-24 16:49:31 -0700350 fi
351
Chad Versace9c71f3c2018-10-24 16:49:31 -0700352 echo "EPYTHON='${EPYTHON}'" > epython.py || die
353 python_domodule epython.py
354
355 # python-exec wrapping support
356 local pymajor=${PYVER%.*}
Mike Frysingerdc5029f2021-02-19 15:53:47 -0500357 local scriptdir=${D}$(python_get_scriptdir)
358 mkdir -p "${scriptdir}" || die
Chad Versace9c71f3c2018-10-24 16:49:31 -0700359 # python and pythonX
360 ln -s "../../../bin/${abiver}" \
Mike Frysingerdc5029f2021-02-19 15:53:47 -0500361 "${scriptdir}/python${pymajor}" || die
362 ln -s "python${pymajor}" "${scriptdir}/python" || die
Chad Versace9c71f3c2018-10-24 16:49:31 -0700363 # python-config and pythonX-config
364 # note: we need to create a wrapper rather than symlinking it due
365 # to some random dirname(argv[0]) magic performed by python-config
Mike Frysingerdc5029f2021-02-19 15:53:47 -0500366 cat > "${scriptdir}/python${pymajor}-config" <<-EOF || die
Chad Versace9c71f3c2018-10-24 16:49:31 -0700367 #!/bin/sh
368 exec "${abiver}-config" "\${@}"
369 EOF
Mike Frysingerdc5029f2021-02-19 15:53:47 -0500370 chmod +x "${scriptdir}/python${pymajor}-config" || die
Chad Versace9c71f3c2018-10-24 16:49:31 -0700371 ln -s "python${pymajor}-config" \
Mike Frysingerdc5029f2021-02-19 15:53:47 -0500372 "${scriptdir}/python-config" || die
Chad Versace9c71f3c2018-10-24 16:49:31 -0700373 # 2to3, pydoc, pyvenv
374 ln -s "../../../bin/2to3-${PYVER}" \
Mike Frysingerdc5029f2021-02-19 15:53:47 -0500375 "${scriptdir}/2to3" || die
Chad Versace9c71f3c2018-10-24 16:49:31 -0700376 ln -s "../../../bin/pydoc${PYVER}" \
Mike Frysingerdc5029f2021-02-19 15:53:47 -0500377 "${scriptdir}/pydoc" || die
Chad Versace9c71f3c2018-10-24 16:49:31 -0700378 ln -s "../../../bin/pyvenv-${PYVER}" \
Mike Frysingerdc5029f2021-02-19 15:53:47 -0500379 "${scriptdir}/pyvenv" || die
Chad Versace9c71f3c2018-10-24 16:49:31 -0700380 # idle
381 if use tk; then
382 ln -s "../../../bin/idle${PYVER}" \
Mike Frysingerdc5029f2021-02-19 15:53:47 -0500383 "${scriptdir}/idle" || die
Chad Versace9c71f3c2018-10-24 16:49:31 -0700384 fi
Mike Frysinger12f1f692021-02-13 18:32:43 -0500385
386 # Delete unittests as they are a waste of space and are unused.
387 rm -rf "${libdir}/test" "${libdir}"/{ctypes,email,sqlite3,unittest}/test || die
Chad Versace9c71f3c2018-10-24 16:49:31 -0700388}
389
390pkg_preinst() {
391 if has_version "<${CATEGORY}/${PN}-${PYVER}" && ! has_version ">=${CATEGORY}/${PN}-${PYVER}_alpha"; then
392 python_updater_warning="1"
393 fi
394}
395
396eselect_python_update() {
Mike Frysinger0e245162021-02-19 15:39:45 -0500397 if [[ -z "$(eselect python show)" || \
398 ! -f "${EROOT}/usr/bin/$(eselect python show)" ]]; then
Chad Versace9c71f3c2018-10-24 16:49:31 -0700399 eselect python update
400 fi
401
Mike Frysinger0e245162021-02-19 15:39:45 -0500402 if [[ -z "$(eselect python show --python${PV%%.*})" || \
403 ! -f "${EROOT}/usr/bin/$(eselect python show --python${PV%%.*})" ]]
404 then
Chad Versace9c71f3c2018-10-24 16:49:31 -0700405 eselect python update --python${PV%%.*}
406 fi
407}
408
409pkg_postinst() {
410 eselect_python_update
411
412 if [[ "${python_updater_warning}" == "1" ]]; then
413 ewarn "You have just upgraded from an older version of Python."
414 ewarn
415 ewarn "Please adjust PYTHON_TARGETS (if so desired), and run emerge with the --newuse or --changed-use option to rebuild packages installing python modules."
416 fi
417}
418
419pkg_postrm() {
420 eselect_python_update
421}