diff options
author | Michał Górny <mgorny@gentoo.org> | 2017-03-08 10:04:47 +0100 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2017-03-08 12:32:43 +0100 |
commit | 80dfd9952e4b140aa5b797b765f4d95fb65a7c98 (patch) | |
tree | a0538a9b208affb63f526c1b2879b129b83a87b0 /dev-python/pypy | |
parent | dev-python/pypy: Sync the live ebuild (diff) | |
download | gentoo-80dfd9952e4b140aa5b797b765f4d95fb65a7c98.tar.gz gentoo-80dfd9952e4b140aa5b797b765f4d95fb65a7c98.tar.bz2 gentoo-80dfd9952e4b140aa5b797b765f4d95fb65a7c98.zip |
dev-python/pypy: Split translation and compile phases
Use the --source option to disable automatic compiling of generating C
sources, and build them manually afterwards. Most importantly, this
significantly reduces memory use because pypy failed to free memory that
was used for the translation, and that is no longer needed when
the compilation is started. Furthermore, it makes resuming compilation
possible.
Diffstat (limited to 'dev-python/pypy')
-rw-r--r-- | dev-python/pypy/pypy-5.6.0.ebuild | 25 | ||||
-rw-r--r-- | dev-python/pypy/pypy-9999.ebuild | 25 |
2 files changed, 36 insertions, 14 deletions
diff --git a/dev-python/pypy/pypy-5.6.0.ebuild b/dev-python/pypy/pypy-5.6.0.ebuild index ce1b1a3f7641..34c1826c856f 100644 --- a/dev-python/pypy/pypy-5.6.0.ebuild +++ b/dev-python/pypy/pypy-5.6.0.ebuild @@ -105,7 +105,7 @@ src_prepare() { epatch_user } -src_compile() { +src_configure() { tc-export CC local jit_backend @@ -162,12 +162,22 @@ src_compile() { "${PYTHON}" --jit loop_longevity=300 ) fi - set -- "${interp[@]}" rpython/bin/rpython --batch "${args[@]}" + # translate into the C sources + # we're going to make them ourselves since otherwise pypy does not + # free up the unneeded memory before spawning the compiler + set -- "${interp[@]}" rpython/bin/rpython --batch --source "${args[@]}" echo -e "\033[1m${@}\033[0m" - "${@}" || die "compile error" + "${@}" || die "translation failed" +} + +src_compile() { + emake -C "${T}"/usession*-current/testing_1 - use doc && emake -C pypy/doc/ html + # copy back to make sys.prefix happy + cp -p "${T}"/usession*-current/testing_1/{pypy-c,libpypy-c.so} . || die pax-mark m pypy-c libpypy-c.so + + use doc && emake -C pypy/doc html } src_test() { @@ -180,10 +190,11 @@ src_test() { src_install() { local dest=/usr/$(get_libdir)/pypy einfo "Installing PyPy ..." - insinto "${dest}" - doins -r include lib_pypy lib-python pypy-c libpypy-c.so - fperms a+x ${dest}/pypy-c ${dest}/libpypy-c.so + exeinto "${dest}" + doexe pypy-c libpypy-c.so pax-mark m "${ED%/}${dest}/pypy-c" "${ED%/}${dest}/libpypy-c.so" + insinto "${dest}" + doins -r include lib_pypy lib-python dosym ../$(get_libdir)/pypy/pypy-c /usr/bin/pypy dodoc README.rst diff --git a/dev-python/pypy/pypy-9999.ebuild b/dev-python/pypy/pypy-9999.ebuild index de88fb98a5f1..de566f88e80d 100644 --- a/dev-python/pypy/pypy-9999.ebuild +++ b/dev-python/pypy/pypy-9999.ebuild @@ -111,7 +111,7 @@ src_prepare() { epatch_user } -src_compile() { +src_configure() { tc-export CC local jit_backend @@ -168,12 +168,22 @@ src_compile() { "${PYTHON}" --jit loop_longevity=300 ) fi - set -- "${interp[@]}" rpython/bin/rpython --batch "${args[@]}" + # translate into the C sources + # we're going to make them ourselves since otherwise pypy does not + # free up the unneeded memory before spawning the compiler + set -- "${interp[@]}" rpython/bin/rpython --batch --source "${args[@]}" echo -e "\033[1m${@}\033[0m" - "${@}" || die "compile error" + "${@}" || die "translation failed" +} + +src_compile() { + emake -C "${T}"/usession*-current/testing_1 - use doc && emake -C pypy/doc/ html + # copy back to make sys.prefix happy + cp -p "${T}"/usession*-current/testing_1/{pypy-c,libpypy-c.so} . || die pax-mark m pypy-c libpypy-c.so + + use doc && emake -C pypy/doc html } src_test() { @@ -186,10 +196,11 @@ src_test() { src_install() { local dest=/usr/$(get_libdir)/pypy einfo "Installing PyPy ..." - insinto "${dest}" - doins -r include lib_pypy lib-python pypy-c libpypy-c.so - fperms a+x ${dest}/pypy-c ${dest}/libpypy-c.so + exeinto "${dest}" + doexe pypy-c libpypy-c.so pax-mark m "${ED%/}${dest}/pypy-c" "${ED%/}${dest}/libpypy-c.so" + insinto "${dest}" + doins -r include lib_pypy lib-python dosym ../$(get_libdir)/pypy/pypy-c /usr/bin/pypy dodoc README.rst |