--- Ice-3.4.0.ebuild +++ Ice-3.4.0.ebuild @@ -5,6 +5,7 @@ EAPI="2" PYTHON_DEPEND="python? 2" +SUPPORT_PYTHON_ABIS="1" RESTRICT_PYTHON_ABIS="3.*" RUBY_OPTIONAL="yes" USE_RUBY="ruby18" @@ -31,10 +32,12 @@ !dev-ruby/IceRuby" DEPEND="${RDEPEND} ncurses? ( sys-libs/ncurses sys-libs/readline ) - test? ( >=dev-lang/python-2.4 )" + test? ( =dev-lang/python-2* )" pkg_setup() { - use python && python_pkg_setup + if use python || use test; then + python_pkg_setup + fi } src_unpack() { @@ -104,8 +107,8 @@ cpp/config/Make.rules{,.Linux} py/config/Make.rules || die "sed failed" if use python ; then - MAKE_RULES_PY="install_pythondir=\"${D}/$(python_get_sitedir)\" - install_libdir=\"${D}/$(python_get_sitedir)\"" + python_copy_sources py + rm -fr py fi if use ruby ; then @@ -135,7 +138,10 @@ fi if use python ; then - emake -C py ${MAKE_RULES} ${MAKE_RULES_PY} || die "emake py failed" + building() { + emake ${MAKE_RULES} + } + python_execute_function -s --source-dir py building fi if use ruby ; then @@ -170,8 +176,11 @@ fi if use python ; then - dodir $(python_get_sitedir) - emake -C py ${MAKE_RULES} ${MAKE_RULES_PY} install || die "emake py install failed" + installation() { + dodir $(python_get_sitedir) + emake ${MAKE_RULES} install_pythondir="\"${D}/$(python_get_sitedir)\"" install_libdir="\"${D}/$(python_get_sitedir)\"" install + } + python_execute_function -s --source-dir py installation docinto py dodoc py/CHANGES py/README @@ -181,7 +190,7 @@ doins -r py/demo/* fi - cd "${D}/$(python_get_sitedir)" + cd "${D}/$(python_get_sitedir -f)" PYTHON_MODULES=(*.py) PYTHON_MODULES+=(Glacier2 IceBox IceGrid IcePatch2 IceStorm) cd "${S}" @@ -220,7 +229,12 @@ emake -C cpp ${MAKE_RULES} test || die "emake test failed" if use python ; then - emake -C py ${MAKE_RULES} ${MAKE_RULES_PY} test || die "emake py test failed" + testing() { + rm -f ../py + ln -s py-${PYTHON_ABI} ../py + emake ${MAKE_RULES} test + } + python_execute_function -s --source-dir py testing fi if use ruby ; then @@ -234,9 +248,9 @@ } pkg_postinst() { - use python && EAPI="3" python_mod_optimize "${PYTHON_MODULES[@]}" + use python && python_mod_optimize "${PYTHON_MODULES[@]}" } pkg_postrm() { - use python && EAPI="3" python_mod_cleanup "${PYTHON_MODULES[@]}" + use python && python_mod_cleanup "${PYTHON_MODULES[@]}" }