commit:     074dee347cb36317b2dc90e3f1de16bb82f846b2
Author:     Mario Haustein <mario.haustein <AT> hrz <DOT> tu-chemnitz <DOT> de>
AuthorDate: Tue Nov  1 16:41:36 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Nov  6 05:43:31 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=074dee34

dev-util/unicorn: add 2.0.1

Signed-off-by: Mario Haustein <mario.haustein <AT> hrz.tu-chemnitz.de>
Closes: https://github.com/gentoo/gentoo/pull/28083
Signed-off-by: Sam James <sam <AT> gentoo.org>

 dev-util/unicorn/Manifest             |  1 +
 dev-util/unicorn/unicorn-2.0.1.ebuild | 83 +++++++++++++++++++++++++++++++++++
 2 files changed, 84 insertions(+)

diff --git a/dev-util/unicorn/Manifest b/dev-util/unicorn/Manifest
index bd256c126faa..29cc0380f692 100644
--- a/dev-util/unicorn/Manifest
+++ b/dev-util/unicorn/Manifest
@@ -1 +1,2 @@
 DIST unicorn-2.0.0.gh.tar.gz 4065595 BLAKE2B 
c16252a8a4af77c1c76c80101c30b92536d1677f93898acf4711e910dbbe1072715b83b4564c015592465eb51d00333e55849c3e06b07726ea3522286d8429bf
 SHA512 
3996f19755ccdaac6e92a7455160e1c90a592ffb789d55ddc9d1bdcf1e68e8a6150bcfa1025a322780c04878be8de28e0ad5fdd79a7b25887ed2793b769f6789
+DIST unicorn-2.0.1.gh.tar.gz 4070004 BLAKE2B 
4ab8f92367e7df5762d29ed58dfff524f59053e28548b170b982d16988eea16df46851d2ea559d8beabb4f1315e5ee627f9ded755a4f3b1cfd6d863a50c633b6
 SHA512 
4249d33d38614ea1ca51e38c7838cb276306100aa44c65ad1b3e39304e4b856ac643a9c6f9d13678fc07bea58989a08b64653d17afe9e62bcef2936ba63e1b1f

diff --git a/dev-util/unicorn/unicorn-2.0.1.ebuild 
b/dev-util/unicorn/unicorn-2.0.1.ebuild
new file mode 100644
index 000000000000..34777b117a28
--- /dev/null
+++ b/dev-util/unicorn/unicorn-2.0.1.ebuild
@@ -0,0 +1,83 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+MY_PV=${PV/_/-}
+
+DISTUTILS_USE_PEP517=setuptools
+DISTUTILS_OPTIONAL=1
+PYTHON_COMPAT=( python3_{8..11} )
+inherit cmake distutils-r1
+
+DESCRIPTION="A lightweight multi-platform, multi-architecture CPU emulator 
framework"
+HOMEPAGE="https://www.unicorn-engine.org";
+
+if [[ ${PV} == *9999 ]]; then
+       inherit git-r3
+       EGIT_REPO_URI="https://github.com/unicorn-engine/unicorn";
+else
+       
SRC_URI="https://github.com/unicorn-engine/unicorn/archive/${MY_PV}.tar.gz -> 
${P}.gh.tar.gz"
+       KEYWORDS="~amd64 ~x86"
+fi
+
+S="${WORKDIR}/${PN}-${MY_PV}"
+
+LICENSE="BSD-2 GPL-2 LGPL-2.1"
+SLOT="0/2"
+IUSE="python static-libs"
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+DEPEND="${PYTHON_DEPS}
+       dev-libs/glib:2"
+RDEPEND="python? ( ${PYTHON_DEPS} )"
+BDEPEND="virtual/pkgconfig
+       python? ( ${DISTUTILS_DEPS} )"
+
+UNICORN_TARGETS="x86 arm aarch64 riscv mips sparc m68k ppc s390x tricore"
+
+wrap_python() {
+       if use python; then
+               # src_prepare
+               # Do not compile C extensions
+               export LIBUNICORN_PATH=1
+
+               pushd bindings/python >/dev/null || die
+               distutils-r1_${1} "$@"
+               popd >/dev/null || die
+       fi
+}
+
+src_prepare() {
+       # Build from sources
+       rm -r bindings/python/prebuilt || die "failed to remove prebuilt files"
+
+       cmake_src_prepare
+       wrap_python ${FUNCNAME}
+}
+
+src_configure(){
+       local mycmakeargs=(
+               -DUNICORN_ARCH="${UNICORN_TARGETS// /;}"
+       )
+
+       cmake_src_configure
+
+       wrap_python ${FUNCNAME}
+}
+
+src_compile() {
+       cmake_src_compile
+
+       wrap_python ${FUNCNAME}
+}
+
+src_install() {
+       cmake_src_install
+
+       if ! use static-libs; then
+               find "${ED}" -type f \( -name "*.a" -o -name "*.la" \) -delete 
|| die
+       fi
+
+       wrap_python ${FUNCNAME}
+}

Reply via email to