--- file_not_specified_in_diff +++ file_not_specified_in_diff @@ -, +, @@ --- yasm-1.1.0.ebuild +++ yasm-1.1.0.ebuild @@ -4,8 +4,10 @@ EAPI=2 PYTHON_DEPEND="python? 2:2.4" +SUPPORT_PYTHON_ABIS="1" +RESTRICT_PYTHON_ABIS="3.*" -inherit autotools eutils python +inherit autotools distutils eutils DESCRIPTION="An assembler for x86 and x86_64 instruction sets" HOMEPAGE="http://www.tortall.net/projects/yasm/" @@ -20,14 +22,17 @@ DEPEND="nls? ( sys-devel/gettext ) python? ( >=dev-python/cython-0.11.3 )" +DISTUTILS_SETUP_FILES=("tools/python-yasm/setup.py") + pkg_setup() { - if use python; then - python_set_active_version 2 - python_pkg_setup - fi + use python && python_pkg_setup } src_prepare() { + # Python bindings are built/tested/installed manually. + sed -e "/\$(PYTHON).*tools\/python-yasm\/setup\.py/d" -i tools/python-yasm/Makefile.inc || die + sed -e "/TESTS += tools\/python-yasm\/tests\/python_test\.sh/d" -i tools/python-yasm/tests/Makefile.inc || die + epatch "${FILESDIR}"/${PN}-1.1.0-skip_cython_check.patch eautoreconf } @@ -40,7 +45,25 @@ $(use_enable nls) } +src_compile() { + default + use python && distutils_src_compile +} + +src_test() { + default + + if use python; then + testing() { + # Based on tools/python-yasm/tests/python_test.sh. + PYTHONPATH="$(ls -d build-${PYTHON_ABI}/lib.*):tools/python-yasm" "$(PYTHON)" -c "import tests; raise SystemExit(tests.unit())" + } + python_execute_function testing + fi +} + src_install() { emake DESTDIR="${D}" install || die + use python && distutils_src_install dodoc AUTHORS }