blob: d9eebdc95b44b08de916f144e69c3c1d3571e420 [file] [log] [blame]
Mike Frysinger51f0d522015-11-21 00:11:17 +00001# Copyright 1999-2015 Gentoo Foundation
Mike Frysinger682d0652012-07-30 11:38:25 -04002# Distributed under the terms of the GNU General Public License v2
Mike Frysinger51f0d522015-11-21 00:11:17 +00003# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/python-2.7.10.ebuild,v 1.2 2015/06/29 17:26:27 floppym Exp $
Mike Frysinger682d0652012-07-30 11:38:25 -04004
Cheng-Yi Chiangb88f6962015-08-06 13:49:23 +00005# ******************************* README ***************************************
6# WARNING! ANY CHANGE TO THIS FILE *MUST* BE ACCOMPANIED BY A CHANGE TO
7# chromeos-base/dev-install's ebuild, which depends on python indirectly.
8# Otherwise, incremental builds will break. See crbug.com/489895.
9# ******************************************************************************
10
Mike Frysinger51f0d522015-11-21 00:11:17 +000011EAPI="4"
Mike Frysinger682d0652012-07-30 11:38:25 -040012WANT_LIBTOOL="none"
13
Mike Frysinger4cfb44a2013-03-18 22:37:33 -040014inherit autotools eutils flag-o-matic multilib pax-utils python-utils-r1 toolchain-funcs multiprocessing
Mike Frysinger682d0652012-07-30 11:38:25 -040015
16MY_P="Python-${PV}"
Mike Frysinger51f0d522015-11-21 00:11:17 +000017PATCHSET_VERSION="2.7.10-0"
Mike Frysinger682d0652012-07-30 11:38:25 -040018
Mike Frysinger4cfb44a2013-03-18 22:37:33 -040019DESCRIPTION="An interpreted, interactive, object-oriented programming language"
Mike Frysinger682d0652012-07-30 11:38:25 -040020HOMEPAGE="http://www.python.org/"
Mike Frysinger51f0d522015-11-21 00:11:17 +000021SRC_URI="http://www.python.org/ftp/python/${PV}/${MY_P}.tar.xz
22 http://dev.gentoo.org/~floppym/python/python-gentoo-patches-${PATCHSET_VERSION}.tar.xz"
Mike Frysinger682d0652012-07-30 11:38:25 -040023
24LICENSE="PSF-2"
Mike Frysinger4cfb44a2013-03-18 22:37:33 -040025SLOT="2.7"
Mike Frysinger65332152014-02-14 13:55:27 -050026KEYWORDS="*"
Mike Frysinger4cfb44a2013-03-18 22:37:33 -040027IUSE="-berkdb build doc elibc_uclibc examples gdbm hardened ipv6 +ncurses +readline sqlite +ssl +threads tk +wide-unicode wininst +xml"
28
29# Do not add a dependency on dev-lang/python to this ebuild.
30# If you need to apply a patch which requires python for bootstrapping, please
31# run the bootstrap code on your dev box and include the results in the
32# patchset. See bug 447752.
Mike Frysinger682d0652012-07-30 11:38:25 -040033
34RDEPEND="app-arch/bzip2
Mike Frysinger4cfb44a2013-03-18 22:37:33 -040035 >=sys-libs/zlib-1.1.3
36 virtual/libffi
37 virtual/libintl
38 !build? (
39 berkdb? ( || (
Mike Frysinger51f0d522015-11-21 00:11:17 +000040 sys-libs/db:5.3
41 sys-libs/db:5.2
42 sys-libs/db:5.1
43 sys-libs/db:5.0
Mike Frysinger4cfb44a2013-03-18 22:37:33 -040044 sys-libs/db:4.8
45 sys-libs/db:4.7
46 sys-libs/db:4.6
47 sys-libs/db:4.5
48 sys-libs/db:4.4
49 sys-libs/db:4.3
50 sys-libs/db:4.2
51 ) )
52 gdbm? ( sys-libs/gdbm )
53 ncurses? (
54 >=sys-libs/ncurses-5.2
55 readline? ( >=sys-libs/readline-4.1 )
Mike Frysinger682d0652012-07-30 11:38:25 -040056 )
Ryan Sleevi1a745162014-10-27 18:14:49 -070057 sqlite? ( >=dev-db/sqlite-3.3.8:3 )
Mike Frysinger4cfb44a2013-03-18 22:37:33 -040058 ssl? ( dev-libs/openssl )
59 tk? (
60 >=dev-lang/tk-8.0
61 dev-tcltk/blt
Mike Frysinger51f0d522015-11-21 00:11:17 +000062 dev-tcltk/tix
Mike Frysinger4cfb44a2013-03-18 22:37:33 -040063 )
64 xml? ( >=dev-libs/expat-2.1 )
65 )
66 !!<sys-apps/portage-2.1.9"
Mike Frysinger682d0652012-07-30 11:38:25 -040067DEPEND="${RDEPEND}
Mike Frysinger4cfb44a2013-03-18 22:37:33 -040068 virtual/pkgconfig
69 >=sys-devel/autoconf-2.65
70 !sys-devel/gcc[libffi]"
Mike Frysinger682d0652012-07-30 11:38:25 -040071RDEPEND+=" !build? ( app-misc/mime-types )
72 doc? ( dev-python/python-docs:${SLOT} )"
Mike Frysinger51f0d522015-11-21 00:11:17 +000073PDEPEND="app-admin/eselect-python
74 app-admin/python-updater"
Mike Frysinger682d0652012-07-30 11:38:25 -040075
76S="${WORKDIR}/${MY_P}"
77
78pkg_setup() {
Mike Frysinger682d0652012-07-30 11:38:25 -040079 if use berkdb; then
Mike Frysinger4cfb44a2013-03-18 22:37:33 -040080 ewarn "'bsddb' module is out-of-date and no longer maintained inside"
81 ewarn "dev-lang/python. 'bsddb' and 'dbhash' modules have been additionally"
82 ewarn "removed in Python 3. A maintained alternative of 'bsddb3' module"
83 ewarn "is provided by dev-python/bsddb3."
Mike Frysinger682d0652012-07-30 11:38:25 -040084 else
85 if has_version "=${CATEGORY}/${PN}-${PV%%.*}*[berkdb]"; then
Mike Frysinger4cfb44a2013-03-18 22:37:33 -040086 ewarn "You are migrating from =${CATEGORY}/${PN}-${PV%%.*}*[berkdb]"
87 ewarn "to =${CATEGORY}/${PN}-${PV%%.*}*[-berkdb]."
Mike Frysinger682d0652012-07-30 11:38:25 -040088 ewarn "You might need to migrate your databases."
89 fi
90 fi
91}
92
93src_prepare() {
94 # Ensure that internal copies of expat, libffi and zlib are not used.
Mike Frysinger51f0d522015-11-21 00:11:17 +000095 rm -r Modules/expat || die
96 rm -r Modules/_ctypes/libffi* || die
97 rm -r Modules/zlib || die
Mike Frysinger682d0652012-07-30 11:38:25 -040098
Mike Frysinger51f0d522015-11-21 00:11:17 +000099 if tc-is-cross-compiler; then
100 local EPATCH_EXCLUDE="*_regenerate_platform-specific_modules.patch"
Mike Frysinger682d0652012-07-30 11:38:25 -0400101 fi
102
Mike Frysinger51f0d522015-11-21 00:11:17 +0000103 EPATCH_SUFFIX="patch" epatch "${WORKDIR}/patches"
Mike Frysinger682d0652012-07-30 11:38:25 -0400104
105 #
106 # START: ChromiumOS specific changes
107 #
108 if tc-is-cross-compiler ; then
Mike Frysinger51f0d522015-11-21 00:11:17 +0000109 epatch "${FILESDIR}"/python-2.7.10-cross-h2py.patch
110 epatch "${FILESDIR}"/python-2.7.10-cross-hack-compiler.patch
Mike Frysinger682d0652012-07-30 11:38:25 -0400111 sed -i 's:^python$EXE:${HOSTPYTHON}:' Lib/*/regen || die
112 fi
Mike Frysinger51f0d522015-11-21 00:11:17 +0000113 epatch "${FILESDIR}"/python-2.7.10-cross-setup-sysroot.patch
114 epatch "${FILESDIR}"/python-2.7.10-cross-distutils.patch
Paul Hobbs43d07e62015-05-14 16:43:16 -0700115 epatch "${FILESDIR}"/python-2.7.3-unique-semaphore-name.patch
Mike Frysinger51f0d522015-11-21 00:11:17 +0000116 epatch "${FILESDIR}"/python-2.7.10-ldshared.patch
Mike Frysingereb047962014-04-06 10:08:56 -0400117 # Undo the @libdir@ change for portage's pym folder as it is always
118 # installed into /usr/lib/ and not the abi libdir.
119 sed -i \
120 -e '/portage.*pym/s:@@GENTOO_LIBDIR@@:lib:g' \
121 Lib/site.py || die
Mike Frysinger682d0652012-07-30 11:38:25 -0400122
123 sed -i -e "s:sys.exec_prefix]:sys.exec_prefix, '/usr/local']:g" \
124 Lib/site.py || die "sed failed to add /usr/local to prefixes"
125 #
126 # END: ChromiumOS specific changes
127 #
128
Mike Frysinger51f0d522015-11-21 00:11:17 +0000129 # Fix for cross-compiling.
130 epatch "${FILESDIR}/python-2.7.5-nonfatal-compileall.patch"
131 epatch "${FILESDIR}/python-2.7.9-ncurses-pkg-config.patch"
132
Mike Frysinger682d0652012-07-30 11:38:25 -0400133 sed -i -e "s:@@GENTOO_LIBDIR@@:$(get_libdir):g" \
134 Lib/distutils/command/install.py \
135 Lib/distutils/sysconfig.py \
136 Lib/site.py \
Mike Frysinger4cfb44a2013-03-18 22:37:33 -0400137 Lib/sysconfig.py \
138 Lib/test/test_site.py \
Mike Frysinger682d0652012-07-30 11:38:25 -0400139 Makefile.pre.in \
140 Modules/Setup.dist \
141 Modules/getpath.c \
142 setup.py || die "sed failed to replace @@GENTOO_LIBDIR@@"
143
Mike Frysinger51f0d522015-11-21 00:11:17 +0000144 epatch_user
145
146 eautoreconf
Mike Frysinger682d0652012-07-30 11:38:25 -0400147}
148
149src_configure() {
150 if use build; then
151 # Disable extraneous modules with extra dependencies.
152 export PYTHON_DISABLE_MODULES="dbm _bsddb gdbm _curses _curses_panel readline _sqlite3 _tkinter _elementtree pyexpat"
153 export PYTHON_DISABLE_SSL="1"
154 else
155 # dbm module can be linked against berkdb or gdbm.
156 # Defaults to gdbm when both are enabled, #204343.
157 local disable
158 use berkdb || use gdbm || disable+=" dbm"
159 use berkdb || disable+=" _bsddb"
160 use gdbm || disable+=" gdbm"
161 use ncurses || disable+=" _curses _curses_panel"
162 use readline || disable+=" readline"
163 use sqlite || disable+=" _sqlite3"
164 use ssl || export PYTHON_DISABLE_SSL="1"
165 use tk || disable+=" _tkinter"
166 use xml || disable+=" _elementtree pyexpat" # _elementtree uses pyexpat.
167 export PYTHON_DISABLE_MODULES="${disable}"
168
169 if ! use xml; then
170 ewarn "You have configured Python without XML support."
171 ewarn "This is NOT a recommended configuration as you"
172 ewarn "may face problems parsing any XML documents."
173 fi
174 fi
175
176 if [[ -n "${PYTHON_DISABLE_MODULES}" ]]; then
177 einfo "Disabled modules: ${PYTHON_DISABLE_MODULES}"
178 fi
179
180 if [[ "$(gcc-major-version)" -ge 4 ]]; then
181 append-flags -fwrapv
182 fi
183
184 filter-flags -malign-double
185
186 [[ "${ARCH}" == "alpha" ]] && append-flags -fPIC
187
188 # https://bugs.gentoo.org/show_bug.cgi?id=50309
189 if is-flagq -O3; then
190 is-flagq -fstack-protector-all && replace-flags -O3 -O2
191 use hardened && replace-flags -O3 -O2
192 fi
193
Mike Frysinger682d0652012-07-30 11:38:25 -0400194 if tc-is-cross-compiler; then
Mike Frysinger51f0d522015-11-21 00:11:17 +0000195 # Force some tests that try to poke fs paths.
196 export ac_cv_file__dev_ptc=no
197 export ac_cv_file__dev_ptmx=yes
Mike Frysinger682d0652012-07-30 11:38:25 -0400198 fi
199
200 # Export CXX so it ends up in /usr/lib/python2.X/config/Makefile.
201 tc-export CXX
202 # The configure script fails to use pkg-config correctly.
203 # http://bugs.python.org/issue15506
204 export ac_cv_path_PKG_CONFIG=$(tc-getPKG_CONFIG)
205
Mike Frysinger4cfb44a2013-03-18 22:37:33 -0400206 # Set LDFLAGS so we link modules with -lpython2.7 correctly.
207 # Needed on FreeBSD unless Python 2.7 is already installed.
Mike Frysinger682d0652012-07-30 11:38:25 -0400208 # Please query BSD team before removing this!
209 append-ldflags "-L."
210
Mike Frysinger4cfb44a2013-03-18 22:37:33 -0400211 local dbmliborder
212 if use gdbm; then
213 dbmliborder+="${dbmliborder:+:}gdbm"
214 fi
215 if use berkdb; then
216 dbmliborder+="${dbmliborder:+:}bdb"
217 fi
218
Mike Frysinger51f0d522015-11-21 00:11:17 +0000219 BUILD_DIR="${WORKDIR}/${CHOST}"
220 mkdir -p "${BUILD_DIR}" || die
221 cd "${BUILD_DIR}" || die
222
223 ECONF_SOURCE="${S}" OPT="" \
Mike Frysinger682d0652012-07-30 11:38:25 -0400224 econf \
225 --with-fpectl \
226 --enable-shared \
227 $(use_enable ipv6) \
228 $(use_with threads) \
229 $(use wide-unicode && echo "--enable-unicode=ucs4" || echo "--enable-unicode=ucs2") \
230 --infodir='${prefix}/share/info' \
231 --mandir='${prefix}/share/man' \
Mike Frysinger4cfb44a2013-03-18 22:37:33 -0400232 --with-dbmliborder="${dbmliborder}" \
Mike Frysinger682d0652012-07-30 11:38:25 -0400233 --with-libc="" \
Mike Frysinger4cfb44a2013-03-18 22:37:33 -0400234 --enable-loadable-sqlite-extensions \
235 --with-system-expat \
Mike Frysinger51f0d522015-11-21 00:11:17 +0000236 --with-system-ffi \
237 --without-ensurepip
Mike Frysinger682d0652012-07-30 11:38:25 -0400238
Mike Frysinger51f0d522015-11-21 00:11:17 +0000239 if use threads && grep -q "#define POSIX_SEMAPHORES_NOT_ENABLED 1" pyconfig.h; then
240 eerror "configure has detected that the sem_open function is broken."
241 eerror "Please ensure that /dev/shm is mounted as a tmpfs with mode 1777."
242 die "Broken sem_open function (bug 496328)"
Mike Frysinger682d0652012-07-30 11:38:25 -0400243 fi
Mike Frysinger682d0652012-07-30 11:38:25 -0400244}
245
246src_compile() {
Mike Frysinger51f0d522015-11-21 00:11:17 +0000247 # Avoid invoking pgen for cross-compiles.
248 touch Include/graminit.h Python/graminit.c
249
250 cd "${BUILD_DIR}" || die
251 emake
252
253 # Work around bug 329499. See also bug 413751 and 457194.
254 if has_version dev-libs/libffi[pax_kernel]; then
255 pax-mark E python
256 else
257 pax-mark m python
Mike Frysinger682d0652012-07-30 11:38:25 -0400258 fi
Mike Frysinger682d0652012-07-30 11:38:25 -0400259}
260
261src_test() {
262 # Tests will not work when cross compiling.
263 if tc-is-cross-compiler; then
264 elog "Disabling tests due to crosscompiling."
265 return
266 fi
267
Mike Frysinger51f0d522015-11-21 00:11:17 +0000268 cd "${BUILD_DIR}" || die
Mike Frysinger682d0652012-07-30 11:38:25 -0400269
Mike Frysinger682d0652012-07-30 11:38:25 -0400270 # Skip failing tests.
Mike Frysinger4cfb44a2013-03-18 22:37:33 -0400271 local skipped_tests="distutils gdb"
Mike Frysinger682d0652012-07-30 11:38:25 -0400272
273 for test in ${skipped_tests}; do
Mike Frysinger4cfb44a2013-03-18 22:37:33 -0400274 mv "${S}"/Lib/test/test_${test}.py "${T}"
Mike Frysinger682d0652012-07-30 11:38:25 -0400275 done
276
277 # Rerun failed tests in verbose mode (regrtest -w).
278 emake test EXTRATESTOPTS="-w" < /dev/tty
279 local result="$?"
280
281 for test in ${skipped_tests}; do
Mike Frysinger4cfb44a2013-03-18 22:37:33 -0400282 mv "${T}/test_${test}.py" "${S}"/Lib/test
Mike Frysinger682d0652012-07-30 11:38:25 -0400283 done
284
285 elog "The following tests have been skipped:"
286 for test in ${skipped_tests}; do
287 elog "test_${test}.py"
288 done
289
290 elog "If you would like to run them, you may:"
Mike Frysinger4cfb44a2013-03-18 22:37:33 -0400291 elog "cd '${EPREFIX}/usr/$(get_libdir)/python${SLOT}/test'"
Mike Frysinger682d0652012-07-30 11:38:25 -0400292 elog "and run the tests separately."
293
294 python_disable_pyc
295
296 if [[ "${result}" -ne 0 ]]; then
297 die "emake test failed"
298 fi
299}
300
301src_install() {
Mike Frysinger4cfb44a2013-03-18 22:37:33 -0400302 local libdir=${ED}/usr/$(get_libdir)/python${SLOT}
303
Mike Frysinger51f0d522015-11-21 00:11:17 +0000304 cd "${BUILD_DIR}" || die
305 emake DESTDIR="${D}" altinstall
Mike Frysinger682d0652012-07-30 11:38:25 -0400306
Mike Frysinger4cfb44a2013-03-18 22:37:33 -0400307 sed -e "s/\(LDFLAGS=\).*/\1/" -i "${libdir}/config/Makefile" || die "sed failed"
308
309 # Backwards compat with Gentoo divergence.
Mike Frysinger51f0d522015-11-21 00:11:17 +0000310 dosym python${SLOT}-config /usr/bin/python-config-${SLOT}
Mike Frysinger682d0652012-07-30 11:38:25 -0400311
312 # Fix collisions between different slots of Python.
313 mv "${ED}usr/bin/2to3" "${ED}usr/bin/2to3-${SLOT}"
314 mv "${ED}usr/bin/pydoc" "${ED}usr/bin/pydoc${SLOT}"
315 mv "${ED}usr/bin/idle" "${ED}usr/bin/idle${SLOT}"
Mike Frysinger682d0652012-07-30 11:38:25 -0400316 rm -f "${ED}usr/bin/smtpd.py"
317
318 if use build; then
Mike Frysinger4cfb44a2013-03-18 22:37:33 -0400319 rm -fr "${ED}usr/bin/idle${SLOT}" "${libdir}/"{bsddb,dbhash.py,idlelib,lib-tk,sqlite3,test}
Mike Frysinger682d0652012-07-30 11:38:25 -0400320 else
Mike Frysinger51f0d522015-11-21 00:11:17 +0000321 use berkdb || rm -r "${libdir}/"{bsddb,dbhash.py,test/test_bsddb*} || die
322 use sqlite || rm -r "${libdir}/"{sqlite3,test/test_sqlite*} || die
323 use tk || rm -r "${ED}usr/bin/idle${SLOT}" "${libdir}/"{idlelib,lib-tk} || die
Mike Frysinger4cfb44a2013-03-18 22:37:33 -0400324 use elibc_uclibc && rm -fr "${libdir}/"{bsddb/test,test}
Mike Frysinger682d0652012-07-30 11:38:25 -0400325 fi
326
Mike Frysinger51f0d522015-11-21 00:11:17 +0000327 use threads || rm -r "${libdir}/multiprocessing" || die
328 use wininst || rm -r "${libdir}/distutils/command/"wininst-*.exe || die
Mike Frysinger682d0652012-07-30 11:38:25 -0400329
Mike Frysinger51f0d522015-11-21 00:11:17 +0000330 dodoc "${S}"/Misc/{ACKS,HISTORY,NEWS}
Mike Frysinger682d0652012-07-30 11:38:25 -0400331
332 if use examples; then
333 insinto /usr/share/doc/${PF}/examples
Mike Frysinger51f0d522015-11-21 00:11:17 +0000334 doins -r "${S}"/Tools
Mike Frysinger682d0652012-07-30 11:38:25 -0400335 fi
Mike Frysinger4cfb44a2013-03-18 22:37:33 -0400336 insinto /usr/share/gdb/auto-load/usr/$(get_libdir) #443510
337 local libname=$(printf 'e:\n\t@echo $(INSTSONAME)\ninclude Makefile\n' | \
338 emake --no-print-directory -s -f - 2>/dev/null)
339 newins "${S}"/Tools/gdb/libpython.py "${libname}"-gdb.py
Mike Frysinger682d0652012-07-30 11:38:25 -0400340
Mike Frysinger51f0d522015-11-21 00:11:17 +0000341 newconfd "${FILESDIR}/pydoc.conf" pydoc-${SLOT}
342 newinitd "${FILESDIR}/pydoc.init" pydoc-${SLOT}
Mike Frysinger682d0652012-07-30 11:38:25 -0400343 sed \
344 -e "s:@PYDOC_PORT_VARIABLE@:PYDOC${SLOT/./_}_PORT:" \
345 -e "s:@PYDOC@:pydoc${SLOT}:" \
346 -i "${ED}etc/conf.d/pydoc-${SLOT}" "${ED}etc/init.d/pydoc-${SLOT}" || die "sed failed"
Mike Frysinger4cfb44a2013-03-18 22:37:33 -0400347
348 # for python-exec
349 python_export python${SLOT} EPYTHON PYTHON PYTHON_SITEDIR
350
351 # if not using a cross-compiler, use the fresh binary
352 if ! tc-is-cross-compiler; then
Mike Frysinger51f0d522015-11-21 00:11:17 +0000353 local PYTHON=./python
354 local -x LD_LIBRARY_PATH=${LD_LIBRARY_PATH+${LD_LIBRARY_PATH}:}.
Mike Frysinger4cfb44a2013-03-18 22:37:33 -0400355 fi
356
357 echo "EPYTHON='${EPYTHON}'" > epython.py
358 python_domodule epython.py
359
360 # The sysconfig module will actually read the pyconfig.h at runtime to see what kind
361 # of functionality is enabled in the build. Deploy it behind the back of portage as
362 # need be.
Mike Frysingerd7685db2013-04-06 02:03:53 -0400363 ln "${ED}/usr/include/python${SLOT}/pyconfig.h" "${libdir}/pyconfig_h" || die
364
365 # Workaround https://bugs.gentoo.org/380569
366 keepdir /etc/env.d/python
Mike Frysinger682d0652012-07-30 11:38:25 -0400367}
368
369pkg_preinst() {
Mike Frysinger4cfb44a2013-03-18 22:37:33 -0400370 if has_version "<${CATEGORY}/${PN}-${SLOT}" && ! has_version "${CATEGORY}/${PN}:2.7"; then
Mike Frysinger682d0652012-07-30 11:38:25 -0400371 python_updater_warning="1"
372 fi
373}
374
375eselect_python_update() {
Mike Frysinger682d0652012-07-30 11:38:25 -0400376 if [[ -z "$(eselect python show)" || ! -f "${EROOT}usr/bin/$(eselect python show)" ]]; then
377 eselect python update
378 fi
379
380 if [[ -z "$(eselect python show --python${PV%%.*})" || ! -f "${EROOT}usr/bin/$(eselect python show --python${PV%%.*})" ]]; then
381 eselect python update --python${PV%%.*}
382 fi
383}
384
385pkg_postinst() {
386 eselect_python_update
387
Mike Frysinger682d0652012-07-30 11:38:25 -0400388 if [[ "${python_updater_warning}" == "1" ]]; then
389 ewarn "You have just upgraded from an older version of Python."
390 ewarn "You should switch active version of Python ${PV%%.*} and run"
391 ewarn "'python-updater [options]' to rebuild Python modules."
392 fi
Mike Frysinger4cfb44a2013-03-18 22:37:33 -0400393
Mike Frysingerd7685db2013-04-06 02:03:53 -0400394 local pyconfig="${EROOT}/usr/$(get_libdir)/python${SLOT}/pyconfig_h"
Mike Frysinger4cfb44a2013-03-18 22:37:33 -0400395 if [[ ! -e ${EROOT}/usr/include/python${SLOT}/pyconfig.h ]] ; then
396 # See pkg_preinst above for details.
Mike Frysingerd7685db2013-04-06 02:03:53 -0400397 install -D -m644 "${pyconfig}" "${EROOT}/usr/include/python${SLOT}/pyconfig.h" || die
Mike Frysinger4cfb44a2013-03-18 22:37:33 -0400398 fi
Mike Frysingerd7685db2013-04-06 02:03:53 -0400399 rm "${pyconfig}" || die
Mike Frysinger682d0652012-07-30 11:38:25 -0400400}
401
402pkg_postrm() {
403 eselect_python_update
Mike Frysinger682d0652012-07-30 11:38:25 -0400404}