commit: 09bad021f5e1eefc71c6b421d56fa60340111057 Author: Mario Haustein <mario.haustein <AT> hrz <DOT> tu-chemnitz <DOT> de> AuthorDate: Sun Feb 16 12:38:17 2025 +0000 Commit: Sam James <sam <AT> gentoo <DOT> org> CommitDate: Sun Feb 16 12:46:42 2025 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=09bad021
dev-util/unicorn: sync live Signed-off-by: Mario Haustein <mario.haustein <AT> hrz.tu-chemnitz.de> Closes: https://github.com/gentoo/gentoo/pull/40595 Signed-off-by: Sam James <sam <AT> gentoo.org> dev-util/unicorn/unicorn-9999.ebuild | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/dev-util/unicorn/unicorn-9999.ebuild b/dev-util/unicorn/unicorn-9999.ebuild index c5f1b2deb1ce..6afc0cd70a64 100644 --- a/dev-util/unicorn/unicorn-9999.ebuild +++ b/dev-util/unicorn/unicorn-9999.ebuild @@ -1,4 +1,4 @@ -# Copyright 1999-2024 Gentoo Authors +# Copyright 1999-2025 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=8 @@ -8,6 +8,7 @@ MY_PV=${PV/_/-} DISTUTILS_USE_PEP517=setuptools DISTUTILS_OPTIONAL=1 PYTHON_COMPAT=( python3_{10..13} ) + inherit cmake distutils-r1 DESCRIPTION="A lightweight multi-platform, multi-architecture CPU emulator framework" @@ -25,7 +26,7 @@ S="${WORKDIR}/${PN}-${MY_PV}" LICENSE="BSD-2 GPL-2 LGPL-2.1" SLOT="0/2" -IUSE="logging python static-libs" +IUSE="logging python static-libs test" REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )" DEPEND="${PYTHON_DEPS} @@ -34,6 +35,8 @@ RDEPEND="python? ( ${PYTHON_DEPS} )" BDEPEND="virtual/pkgconfig python? ( ${DISTUTILS_DEPS} )" +RESTRICT="!test? ( test )" + UNICORN_TARGETS="x86 arm aarch64 riscv mips sparc m68k ppc s390x tricore" wrap_python() { @@ -54,6 +57,7 @@ src_prepare() { cmake_src_prepare wrap_python ${FUNCNAME} + if use elibc_musl ; then QA_CONFIG_IMPL_DECL_SKIP=( malloc_trim ) fi @@ -63,6 +67,7 @@ src_configure(){ local mycmakeargs=( -DUNICORN_ARCH="${UNICORN_TARGETS// /;}" -DUNICORN_LOGGING=$(usex logging) + -DUNICORN_LEGACY_STATIC_ARCHIVE=$(usex static-libs) -DZIG_BUILD=OFF ) @@ -77,12 +82,23 @@ src_compile() { wrap_python ${FUNCNAME} } -src_install() { +src_test() { cmake_src_install - if ! use static-libs; then - find "${ED}" -type f \( -name "*.a" -o -name "*.la" \) -delete || die - fi + wrap_python ${FUNCNAME} +} + +python_test() { +# export LD_LIBRARY_PATH="${ED}/usr/$(get_libdir):${LD_LIBRARY_PATH}" + for f in tests/test_*.py; do + if test -x ${f}; then + LD_LIBRARY_PATH="${ED}/usr/$(get_libdir)" ${EPYHTON} ${f} || die + fi + done +} + +src_install() { + cmake_src_install wrap_python ${FUNCNAME} }
