diff options
author | Michał Górny <mgorny@gentoo.org> | 2014-07-12 21:27:07 +0000 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2014-07-12 21:27:07 +0000 |
commit | 26dd3cff3592e26a023d9f5fa448a376c9a6d7bc (patch) | |
tree | 6256ed52cf6ef78f69efc2e6bcf8711948032d5a /dev-python | |
parent | Drop old. (diff) | |
download | gentoo-2-26dd3cff3592e26a023d9f5fa448a376c9a6d7bc.tar.gz gentoo-2-26dd3cff3592e26a023d9f5fa448a376c9a6d7bc.tar.bz2 gentoo-2-26dd3cff3592e26a023d9f5fa448a376c9a6d7bc.zip |
Update for new binary builds, thanks to Alice.
(Portage version: 2.2.10/cvs/Linux x86_64, signed Manifest commit with key EFB4464E!)
Diffstat (limited to 'dev-python')
-rw-r--r-- | dev-python/pypy-bin/ChangeLog | 8 | ||||
-rw-r--r-- | dev-python/pypy-bin/files/2.3-21_all_distutils_c++.patch | 321 | ||||
-rw-r--r-- | dev-python/pypy-bin/pypy-bin-2.3.1.ebuild | 170 |
3 files changed, 498 insertions, 1 deletions
diff --git a/dev-python/pypy-bin/ChangeLog b/dev-python/pypy-bin/ChangeLog index 8d17b025ef46..23a35e937399 100644 --- a/dev-python/pypy-bin/ChangeLog +++ b/dev-python/pypy-bin/ChangeLog @@ -1,6 +1,12 @@ # ChangeLog for dev-python/pypy-bin # Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/dev-python/pypy-bin/ChangeLog,v 1.20 2014/07/06 13:18:56 mgorny Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-python/pypy-bin/ChangeLog,v 1.21 2014/07/12 21:27:07 mgorny Exp $ + +*pypy-bin-2.3.1 (12 Jul 2014) + + 12 Jul 2014; Michał Górny <mgorny@gentoo.org> + +files/2.3-21_all_distutils_c++.patch, +pypy-bin-2.3.1.ebuild: + Update for new binary builds, thanks to Alice. 06 Jul 2014; Michał Górny <mgorny@gentoo.org> pypy-bin-2.0.2-r1.ebuild, pypy-bin-2.2.1-r1.ebuild: diff --git a/dev-python/pypy-bin/files/2.3-21_all_distutils_c++.patch b/dev-python/pypy-bin/files/2.3-21_all_distutils_c++.patch new file mode 100644 index 000000000000..2787360c15be --- /dev/null +++ b/dev-python/pypy-bin/files/2.3-21_all_distutils_c++.patch @@ -0,0 +1,321 @@ +http://bugs.python.org/issue1222585 + +--- Lib/distutils/cygwinccompiler.py ++++ Lib/distutils/cygwinccompiler.py +@@ -117,8 +117,10 @@ + # dllwrap 2.10.90 is buggy + if self.ld_version >= "2.10.90": + self.linker_dll = "gcc" ++ self.linker_dll_cxx = "g++" + else: + self.linker_dll = "dllwrap" ++ self.linker_dll_cxx = "dllwrap" + + # ld_version >= "2.13" support -shared so use it instead of + # -mdll -static +@@ -132,9 +134,13 @@ + self.set_executables(compiler='gcc -mcygwin -O -Wall', + compiler_so='gcc -mcygwin -mdll -O -Wall', + compiler_cxx='g++ -mcygwin -O -Wall', ++ compiler_so_cxx='g++ -mcygwin -mdll -O -Wall', + linker_exe='gcc -mcygwin', + linker_so=('%s -mcygwin %s' % +- (self.linker_dll, shared_option))) ++ (self.linker_dll, shared_option)), ++ linker_exe_cxx='g++ -mcygwin', ++ linker_so_cxx=('%s -mcygwin %s' % ++ (self.linker_dll_cxx, shared_option))) + + # cygwin and mingw32 need different sets of libraries + if self.gcc_version == "2.91.57": +@@ -160,8 +166,12 @@ + raise CompileError, msg + else: # for other files use the C-compiler + try: +- self.spawn(self.compiler_so + cc_args + [src, '-o', obj] + +- extra_postargs) ++ if self.detect_language(src) == 'c++': ++ self.spawn(self.compiler_so_cxx + cc_args + [src, '-o', obj] + ++ extra_postargs) ++ else: ++ self.spawn(self.compiler_so + cc_args + [src, '-o', obj] + ++ extra_postargs) + except DistutilsExecError, msg: + raise CompileError, msg + +@@ -327,9 +337,14 @@ + self.set_executables(compiler='gcc%s -O -Wall' % no_cygwin, + compiler_so='gcc%s -mdll -O -Wall' % no_cygwin, + compiler_cxx='g++%s -O -Wall' % no_cygwin, ++ compiler_so_cxx='g++%s -mdll -O -Wall' % no_cygwin, + linker_exe='gcc%s' % no_cygwin, + linker_so='%s%s %s %s' + % (self.linker_dll, no_cygwin, ++ shared_option, entry_point), ++ linker_exe_cxx='g++%s' % no_cygwin, ++ linker_so_cxx='%s%s %s %s' ++ % (self.linker_dll_cxx, no_cygwin, + shared_option, entry_point)) + # Maybe we should also append -mthreads, but then the finished + # dlls need another dll (mingwm10.dll see Mingw32 docs) +--- Lib/distutils/emxccompiler.py ++++ Lib/distutils/emxccompiler.py +@@ -65,8 +65,12 @@ + # XXX optimization, warnings etc. should be customizable. + self.set_executables(compiler='gcc -Zomf -Zmt -O3 -fomit-frame-pointer -mprobe -Wall', + compiler_so='gcc -Zomf -Zmt -O3 -fomit-frame-pointer -mprobe -Wall', ++ compiler_cxx='g++ -Zomf -Zmt -O3 -fomit-frame-pointer -mprobe -Wall', ++ compiler_so_cxx='g++ -Zomf -Zmt -O3 -fomit-frame-pointer -mprobe -Wall', + linker_exe='gcc -Zomf -Zmt -Zcrtdll', +- linker_so='gcc -Zomf -Zmt -Zcrtdll -Zdll') ++ linker_so='gcc -Zomf -Zmt -Zcrtdll -Zdll', ++ linker_exe_cxx='g++ -Zomf -Zmt -Zcrtdll', ++ linker_so_cxx='g++ -Zomf -Zmt -Zcrtdll -Zdll') + + # want the gcc library statically linked (so that we don't have + # to distribute a version dependent on the compiler we have) +@@ -83,8 +87,12 @@ + raise CompileError, msg + else: # for other files use the C-compiler + try: +- self.spawn(self.compiler_so + cc_args + [src, '-o', obj] + +- extra_postargs) ++ if self.detect_language(src) == 'c++': ++ self.spawn(self.compiler_so_cxx + cc_args + [src, '-o', obj] + ++ extra_postargs) ++ else: ++ self.spawn(self.compiler_so + cc_args + [src, '-o', obj] + ++ extra_postargs) + except DistutilsExecError, msg: + raise CompileError, msg + +--- Lib/distutils/sysconfig_cpython.py ++++ Lib/distutils/sysconfig_cpython.py +@@ -170,10 +170,12 @@ + _osx_support.customize_compiler(_config_vars) + _config_vars['CUSTOMIZED_OSX_COMPILER'] = 'True' + +- (cc, cxx, opt, cflags, ccshared, ldshared, so_ext, ar, ar_flags) = \ +- get_config_vars('CC', 'CXX', 'OPT', 'CFLAGS', +- 'CCSHARED', 'LDSHARED', 'SO', 'AR', +- 'ARFLAGS') ++ (cc, cxx, ccshared, ldshared, ldcxxshared, so_ext, ar, ar_flags) = \ ++ get_config_vars('CC', 'CXX', 'CCSHARED', 'LDSHARED', 'LDCXXSHARED', ++ 'SO', 'AR', 'ARFLAGS') ++ ++ cflags = '' ++ cxxflags = '' + + if 'CC' in os.environ: + newcc = os.environ['CC'] +@@ -188,19 +190,27 @@ + cxx = os.environ['CXX'] + if 'LDSHARED' in os.environ: + ldshared = os.environ['LDSHARED'] ++ if 'LDCXXSHARED' in os.environ: ++ ldcxxshared = os.environ['LDCXXSHARED'] + if 'CPP' in os.environ: + cpp = os.environ['CPP'] + else: + cpp = cc + " -E" # not always + if 'LDFLAGS' in os.environ: + ldshared = ldshared + ' ' + os.environ['LDFLAGS'] ++ ldcxxshared = ldcxxshared + ' ' + os.environ['LDFLAGS'] + if 'CFLAGS' in os.environ: +- cflags = opt + ' ' + os.environ['CFLAGS'] ++ cflags = os.environ['CFLAGS'] + ldshared = ldshared + ' ' + os.environ['CFLAGS'] ++ if 'CXXFLAGS' in os.environ: ++ cxxflags = os.environ['CXXFLAGS'] ++ ldcxxshared = ldcxxshared + ' ' + os.environ['CXXFLAGS'] + if 'CPPFLAGS' in os.environ: + cpp = cpp + ' ' + os.environ['CPPFLAGS'] + cflags = cflags + ' ' + os.environ['CPPFLAGS'] ++ cxxflags = cxxflags + ' ' + os.environ['CPPFLAGS'] + ldshared = ldshared + ' ' + os.environ['CPPFLAGS'] ++ ldcxxshared = ldcxxshared + ' ' + os.environ['CPPFLAGS'] + if 'AR' in os.environ: + ar = os.environ['AR'] + if 'ARFLAGS' in os.environ: +@@ -209,13 +219,17 @@ + archiver = ar + ' ' + ar_flags + + cc_cmd = cc + ' ' + cflags ++ cxx_cmd = cxx + ' ' + cxxflags + compiler.set_executables( + preprocessor=cpp, + compiler=cc_cmd, + compiler_so=cc_cmd + ' ' + ccshared, +- compiler_cxx=cxx, ++ compiler_cxx=cxx_cmd, ++ compiler_so_cxx=cxx_cmd + ' ' + ccshared, + linker_so=ldshared, + linker_exe=cc, ++ linker_so_cxx=ldcxxshared, ++ linker_exe_cxx=cxx, + archiver=archiver) + + compiler.shared_lib_extension = so_ext +--- Lib/distutils/unixccompiler.py ++++ Lib/distutils/unixccompiler.py +@@ -55,14 +55,17 @@ + # are pretty generic; they will probably have to be set by an outsider + # (eg. using information discovered by the sysconfig about building + # Python extensions). +- executables = {'preprocessor' : None, +- 'compiler' : ["cc"], +- 'compiler_so' : ["cc"], +- 'compiler_cxx' : ["cc"], +- 'linker_so' : ["cc", "-shared"], +- 'linker_exe' : ["cc"], +- 'archiver' : ["ar", "-cr"], +- 'ranlib' : None, ++ executables = {'preprocessor' : None, ++ 'compiler' : ["cc"], ++ 'compiler_so' : ["cc"], ++ 'compiler_cxx' : ["c++"], ++ 'compiler_so_cxx' : ["c++"], ++ 'linker_so' : ["cc", "-shared"], ++ 'linker_exe' : ["cc"], ++ 'linker_so_cxx' : ["c++", "-shared"], ++ 'linker_exe_cxx' : ["c++"], ++ 'archiver' : ["ar", "-cr"], ++ 'ranlib' : None, + } + + if sys.platform[:6] == "darwin": +@@ -112,12 +115,19 @@ + + def _compile(self, obj, src, ext, cc_args, extra_postargs, pp_opts): + compiler_so = self.compiler_so ++ compiler_so_cxx = self.compiler_so_cxx + if sys.platform == 'darwin': + compiler_so = _osx_support.compiler_fixup(compiler_so, + cc_args + extra_postargs) ++ compiler_so_cxx = _osx_support.compiler_fixup(compiler_so_cxx, ++ cc_args + extra_postargs) + try: +- self.spawn(compiler_so + cc_args + [src, '-o', obj] + +- extra_postargs) ++ if self.detect_language(src) == 'c++': ++ self.spawn(compiler_so_cxx + cc_args + [src, '-o', obj] + ++ extra_postargs) ++ else: ++ self.spawn(compiler_so + cc_args + [src, '-o', obj] + ++ extra_postargs) + except DistutilsExecError, msg: + raise CompileError, msg + +@@ -174,23 +184,16 @@ + ld_args.extend(extra_postargs) + self.mkpath(os.path.dirname(output_filename)) + try: +- if target_desc == CCompiler.EXECUTABLE: +- linker = self.linker_exe[:] ++ if target_lang == "c++": ++ if target_desc == CCompiler.EXECUTABLE: ++ linker = self.linker_exe_cxx[:] ++ else: ++ linker = self.linker_so_cxx[:] + else: +- linker = self.linker_so[:] +- if target_lang == "c++" and self.compiler_cxx: +- # skip over environment variable settings if /usr/bin/env +- # is used to set up the linker's environment. +- # This is needed on OSX. Note: this assumes that the +- # normal and C++ compiler have the same environment +- # settings. +- i = 0 +- if os.path.basename(linker[0]) == "env": +- i = 1 +- while '=' in linker[i]: +- i = i + 1 +- +- linker[i] = self.compiler_cxx[i] ++ if target_desc == CCompiler.EXECUTABLE: ++ linker = self.linker_exe[:] ++ else: ++ linker = self.linker_so[:] + + if sys.platform == 'darwin': + linker = _osx_support.compiler_fixup(linker, ld_args) +--- Lib/_osx_support.py ++++ Lib/_osx_support.py +@@ -14,13 +14,13 @@ + # configuration variables that may contain universal build flags, + # like "-arch" or "-isdkroot", that may need customization for + # the user environment +-_UNIVERSAL_CONFIG_VARS = ('CFLAGS', 'LDFLAGS', 'CPPFLAGS', 'BASECFLAGS', +- 'BLDSHARED', 'LDSHARED', 'CC', 'CXX', +- 'PY_CFLAGS', 'PY_LDFLAGS', 'PY_CPPFLAGS', +- 'PY_CORE_CFLAGS') ++_UNIVERSAL_CONFIG_VARS = ('CFLAGS', 'CXXFLAGS', 'LDFLAGS', 'CPPFLAGS', ++ 'BASECFLAGS', 'BLDSHARED', 'LDSHARED', 'LDCXXSHARED', ++ 'CC', 'CXX', 'PY_CFLAGS', 'PY_LDFLAGS', ++ 'PY_CPPFLAGS', 'PY_CORE_CFLAGS') + + # configuration variables that may contain compiler calls +-_COMPILER_CONFIG_VARS = ('BLDSHARED', 'LDSHARED', 'CC', 'CXX') ++_COMPILER_CONFIG_VARS = ('BLDSHARED', 'LDSHARED', 'LDCXXSHARED', 'CC', 'CXX') + + # prefix added to original configuration variable names + _INITPRE = '_OSX_SUPPORT_INITIAL_' +--- a/distutils/sysconfig_pypy.py ++++ b/distutils/sysconfig_pypy.py +@@ -123,7 +123,55 @@ + optional C speedup components. + """ + if compiler.compiler_type == "unix": +- compiler.compiler_so.extend(['-O2', '-fPIC', '-Wimplicit']) ++ cc = ' '.join(compiler.compiler) ++ cxx = ' '.join(compiler.compiler_cxx) ++ ldshared = ' '.join(compiler.linker_so) ++ ldcxxshared = ' '.join(compiler.linker_so_cxx) ++ ++ cflags = '' ++ cxxflags = '' ++ ccshared = '-fPIC' ++ ++ if 'CC' in os.environ: ++ cc = os.environ['CC'] ++ if 'CXX' in os.environ: ++ cxx = os.environ['CXX'] ++ if 'LDSHARED' in os.environ: ++ ldshared = os.environ['LDSHARED'] ++ if 'LDCXXSHARED' in os.environ: ++ ldcxxshared = os.environ['LDCXXSHARED'] ++ if 'CPP' in os.environ: ++ cpp = os.environ['CPP'] ++ else: ++ cpp = cc + " -E" # not always ++ if 'LDFLAGS' in os.environ: ++ ldshared = ldshared + ' ' + os.environ['LDFLAGS'] ++ ldcxxshared = ldcxxshared + ' ' + os.environ['LDFLAGS'] ++ if 'CFLAGS' in os.environ: ++ cflags = os.environ['CFLAGS'] ++ ldshared = ldshared + ' ' + os.environ['CFLAGS'] ++ if 'CXXFLAGS' in os.environ: ++ cxxflags = os.environ['CXXFLAGS'] ++ ldcxxshared = ldcxxshared + ' ' + os.environ['CXXFLAGS'] ++ if 'CPPFLAGS' in os.environ: ++ cpp = cpp + ' ' + os.environ['CPPFLAGS'] ++ cflags = cflags + ' ' + os.environ['CPPFLAGS'] ++ cxxflags = cxxflags + ' ' + os.environ['CPPFLAGS'] ++ ldshared = ldshared + ' ' + os.environ['CPPFLAGS'] ++ ldcxxshared = ldcxxshared + ' ' + os.environ['CPPFLAGS'] ++ ++ cc_cmd = cc + ' ' + cflags ++ cxx_cmd = cxx + ' ' + cxxflags ++ compiler.set_executables( ++ preprocessor=cpp, ++ compiler=cc_cmd, ++ compiler_so=cc_cmd + ' ' + ccshared, ++ compiler_cxx=cxx_cmd, ++ compiler_so_cxx=cxx_cmd + ' ' + ccshared, ++ linker_so=ldshared, ++ linker_exe=cc, ++ linker_so_cxx=ldcxxshared, ++ linker_exe_cxx=cxx) + compiler.shared_lib_extension = get_config_var('SO') + if "CPPFLAGS" in os.environ: + cppflags = shlex.split(os.environ["CPPFLAGS"]) diff --git a/dev-python/pypy-bin/pypy-bin-2.3.1.ebuild b/dev-python/pypy-bin/pypy-bin-2.3.1.ebuild new file mode 100644 index 000000000000..673e6fc6659c --- /dev/null +++ b/dev-python/pypy-bin/pypy-bin-2.3.1.ebuild @@ -0,0 +1,170 @@ +# Copyright 1999-2014 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-python/pypy-bin/pypy-bin-2.3.1.ebuild,v 1.1 2014/07/12 21:27:07 mgorny Exp $ + +EAPI=5 + +PYTHON_COMPAT=( python2_7 pypy pypy2_0 ) +inherit eutils multilib pax-utils python-any-r1 vcs-snapshot versionator + +BINHOST="http://pypy.aliceinwire.net/pypy-bin/" + +DESCRIPTION="A fast, compliant alternative implementation of the Python language (binary package)" +HOMEPAGE="http://pypy.org/" +SRC_URI="https://www.bitbucket.org/pypy/pypy/downloads/pypy-${PV}-src.tar.bz2 + amd64? ( + jit? ( shadowstack? ( + ${BINHOST}/${P}-amd64+bzip2+jit+ncurses+shadowstack.tar.xz + -> ${P}-r1-amd64+bzip2+jit+ncurses+shadowstack.tar.xz + ) ) + jit? ( !shadowstack? ( + ${BINHOST}/${P}-amd64+bzip2+jit+ncurses.tar.xz + -> ${P}-r1-amd64+bzip2+jit+ncurses.tar.xz + ) ) + !jit? ( !shadowstack? ( + ${BINHOST}/${P}-amd64+bzip2+ncurses.tar.xz + -> ${P}-r1-amd64+bzip2+ncurses.tar.xz + ) ) + ) + x86? ( + sse2? ( + jit? ( shadowstack? ( + ${BINHOST}/${P}-x86+bzip2+jit+ncurses+shadowstack+sse2.tar.xz + -> ${P}-r1-x86+bzip2+jit+ncurses+shadowstack+sse2.tar.xz + ) ) + jit? ( !shadowstack? ( + ${BINHOST}/${P}-x86+bzip2+jit+ncurses+sse2.tar.xz + -> ${P}-r1-x86+bzip2+jit+ncurses+sse2.tar.xz + ) ) + !jit? ( !shadowstack? ( + ${BINHOST}/${P}-x86+bzip2+ncurses+sse2.tar.xz + -> ${P}-r1-x86+bzip2+ncurses+sse2.tar.xz + ) ) + ) + !sse2? ( + !jit? ( !shadowstack? ( + ${BINHOST}/${P}-x86+bzip2+ncurses.tar.xz + -> ${P}-r1-x86+bzip2+ncurses.tar.xz + ) ) + ) + )" + +# Supported variants +REQUIRED_USE="!jit? ( !shadowstack ) + x86? ( !sse2? ( !jit !shadowstack ) )" + +LICENSE="MIT" +SLOT="0/$(get_version_component_range 1-2 ${PV})" +KEYWORDS="~amd64 ~x86" +IUSE="doc +jit shadowstack sqlite sse2 test tk" + +# yep, world would be easier if people started filling subslots... +RDEPEND=" + app-arch/bzip2:0 + dev-libs/expat:0 + dev-libs/libffi:0 + dev-libs/openssl:0 + sys-libs/glibc:2.2 + sys-libs/ncurses:5 + sys-libs/zlib:0 + sqlite? ( dev-db/sqlite:3 ) + tk? ( + dev-lang/tk:0 + dev-tcltk/tix + ) + !dev-python/pypy:0" +DEPEND="app-arch/xz-utils + doc? ( ${PYTHON_DEPS} + dev-python/sphinx ) + test? ( ${RDEPEND} )" +PDEPEND="app-admin/python-updater" + +S=${WORKDIR}/pypy-${PV}-src + +pkg_setup() { + use doc && python-any-r1_pkg_setup +} + +src_prepare() { + epatch "${FILESDIR}/1.9-scripts-location.patch" + epatch "${FILESDIR}/1.9-distutils.unixccompiler.UnixCCompiler.runtime_library_dir_option.patch" + + pushd lib-python/2.7 > /dev/null || die + epatch "${FILESDIR}/2.3-21_all_distutils_c++.patch" + popd > /dev/null || die + + epatch_user +} + +src_compile() { + # Tadaam! PyPy compiled! + mv "${WORKDIR}"/${P}*/{libpypy-c.so,pypy-c} . || die + mv "${WORKDIR}"/${P}*/include/*.h include/ || die + mv pypy/module/cpyext/include/*.h include/ || die + + use doc && emake -C pypy/doc/ html + #needed even without jit :( also needed in both compile and install phases + pax-mark m pypy-c +} + +src_test() { + # (unset) + local -x PYTHONDONTWRITEBYTECODE + + ./pypy-c ./pypy/test_all.py --pypy=./pypy-c lib-python || die +} + +src_install() { + einfo "Installing PyPy ..." + insinto "/usr/$(get_libdir)/pypy" + doins -r include lib_pypy lib-python pypy-c libpypy-c.so + fperms a+x ${INSDESTTREE}/pypy-c ${INSDESTTREE}/libpypy-c.so + pax-mark m "${ED%/}${INSDESTTREE}/pypy-c" "${ED%/}${INSDESTTREE}/libpypy-c.so" + dosym ../$(get_libdir)/pypy/pypy-c /usr/bin/pypy + dosym ../$(get_libdir)/pypy/libpypy-c.so /usr/$(get_libdir)/libpypy-c.so + dodoc README.rst + + if ! use sqlite; then + rm -r "${ED%/}${INSDESTTREE}"/lib-python/*2.7/sqlite3 \ + "${ED%/}${INSDESTTREE}"/lib_pypy/_sqlite3.py \ + "${ED%/}${INSDESTTREE}"/lib-python/*2.7/test/test_sqlite.py || die + fi + if ! use tk; then + rm -r "${ED%/}${INSDESTTREE}"/lib-python/*2.7/{idlelib,lib-tk} \ + "${ED%/}${INSDESTTREE}"/lib_pypy/_tkinter \ + "${ED%/}${INSDESTTREE}"/lib-python/*2.7/test/test_{tcl,tk,ttk*}.py || die + fi + + # Install docs + use doc && dohtml -r pypy/doc/_build/html/ + + einfo "Generating caches and byte-compiling ..." + + python_export pypy EPYTHON PYTHON PYTHON_SITEDIR + local PYTHON=${ED%/}${INSDESTTREE}/pypy-c + local -x LD_LIBRARY_PATH="${ED%/}${INSDESTTREE}" + + echo "EPYTHON='${EPYTHON}'" > epython.py + python_domodule epython.py + + # Generate Grammar and PatternGrammar pickles. + "${PYTHON}" -c "import lib2to3.pygram, lib2to3.patcomp; lib2to3.patcomp.PatternCompiler()" \ + || die "Generation of Grammar and PatternGrammar pickles failed" + + # Generate cffi cache + "${PYTHON}" -c "import _curses" || die "Failed to import _curses (cffi)" + "${PYTHON}" -c "import syslog" || die "Failed to import syslog (cffi)" + if use sqlite; then + "${PYTHON}" -c "import _sqlite3" || die "Failed to import _sqlite3 (cffi)" + fi + if use tk; then + "${PYTHON}" -c "import _tkinter" || die "Failed to import _tkinter (cffi)" + fi + + # Cleanup temporary objects + find "${ED%/}${INSDESTTREE}" -name "_cffi_*.[co]" -delete || die + find "${ED%/}${INSDESTTREE}" -type d -empty -delete || die + + # compile the installed modules + python_optimize "${ED%/}${INSDESTTREE}" +} |