Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-util/unicorn/
Date: Sun, 06 Nov 2022 05:43:56
Message-Id: 1667713411.074dee347cb36317b2dc90e3f1de16bb82f846b2.sam@gentoo
1 commit: 074dee347cb36317b2dc90e3f1de16bb82f846b2
2 Author: Mario Haustein <mario.haustein <AT> hrz <DOT> tu-chemnitz <DOT> de>
3 AuthorDate: Tue Nov 1 16:41:36 2022 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Sun Nov 6 05:43:31 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=074dee34
7
8 dev-util/unicorn: add 2.0.1
9
10 Signed-off-by: Mario Haustein <mario.haustein <AT> hrz.tu-chemnitz.de>
11 Closes: https://github.com/gentoo/gentoo/pull/28083
12 Signed-off-by: Sam James <sam <AT> gentoo.org>
13
14 dev-util/unicorn/Manifest | 1 +
15 dev-util/unicorn/unicorn-2.0.1.ebuild | 83 +++++++++++++++++++++++++++++++++++
16 2 files changed, 84 insertions(+)
17
18 diff --git a/dev-util/unicorn/Manifest b/dev-util/unicorn/Manifest
19 index bd256c126faa..29cc0380f692 100644
20 --- a/dev-util/unicorn/Manifest
21 +++ b/dev-util/unicorn/Manifest
22 @@ -1 +1,2 @@
23 DIST unicorn-2.0.0.gh.tar.gz 4065595 BLAKE2B c16252a8a4af77c1c76c80101c30b92536d1677f93898acf4711e910dbbe1072715b83b4564c015592465eb51d00333e55849c3e06b07726ea3522286d8429bf SHA512 3996f19755ccdaac6e92a7455160e1c90a592ffb789d55ddc9d1bdcf1e68e8a6150bcfa1025a322780c04878be8de28e0ad5fdd79a7b25887ed2793b769f6789
24 +DIST unicorn-2.0.1.gh.tar.gz 4070004 BLAKE2B 4ab8f92367e7df5762d29ed58dfff524f59053e28548b170b982d16988eea16df46851d2ea559d8beabb4f1315e5ee627f9ded755a4f3b1cfd6d863a50c633b6 SHA512 4249d33d38614ea1ca51e38c7838cb276306100aa44c65ad1b3e39304e4b856ac643a9c6f9d13678fc07bea58989a08b64653d17afe9e62bcef2936ba63e1b1f
25
26 diff --git a/dev-util/unicorn/unicorn-2.0.1.ebuild b/dev-util/unicorn/unicorn-2.0.1.ebuild
27 new file mode 100644
28 index 000000000000..34777b117a28
29 --- /dev/null
30 +++ b/dev-util/unicorn/unicorn-2.0.1.ebuild
31 @@ -0,0 +1,83 @@
32 +# Copyright 1999-2022 Gentoo Authors
33 +# Distributed under the terms of the GNU General Public License v2
34 +
35 +EAPI=8
36 +
37 +MY_PV=${PV/_/-}
38 +
39 +DISTUTILS_USE_PEP517=setuptools
40 +DISTUTILS_OPTIONAL=1
41 +PYTHON_COMPAT=( python3_{8..11} )
42 +inherit cmake distutils-r1
43 +
44 +DESCRIPTION="A lightweight multi-platform, multi-architecture CPU emulator framework"
45 +HOMEPAGE="https://www.unicorn-engine.org"
46 +
47 +if [[ ${PV} == *9999 ]]; then
48 + inherit git-r3
49 + EGIT_REPO_URI="https://github.com/unicorn-engine/unicorn"
50 +else
51 + SRC_URI="https://github.com/unicorn-engine/unicorn/archive/${MY_PV}.tar.gz -> ${P}.gh.tar.gz"
52 + KEYWORDS="~amd64 ~x86"
53 +fi
54 +
55 +S="${WORKDIR}/${PN}-${MY_PV}"
56 +
57 +LICENSE="BSD-2 GPL-2 LGPL-2.1"
58 +SLOT="0/2"
59 +IUSE="python static-libs"
60 +REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
61 +
62 +DEPEND="${PYTHON_DEPS}
63 + dev-libs/glib:2"
64 +RDEPEND="python? ( ${PYTHON_DEPS} )"
65 +BDEPEND="virtual/pkgconfig
66 + python? ( ${DISTUTILS_DEPS} )"
67 +
68 +UNICORN_TARGETS="x86 arm aarch64 riscv mips sparc m68k ppc s390x tricore"
69 +
70 +wrap_python() {
71 + if use python; then
72 + # src_prepare
73 + # Do not compile C extensions
74 + export LIBUNICORN_PATH=1
75 +
76 + pushd bindings/python >/dev/null || die
77 + distutils-r1_${1} "$@"
78 + popd >/dev/null || die
79 + fi
80 +}
81 +
82 +src_prepare() {
83 + # Build from sources
84 + rm -r bindings/python/prebuilt || die "failed to remove prebuilt files"
85 +
86 + cmake_src_prepare
87 + wrap_python ${FUNCNAME}
88 +}
89 +
90 +src_configure(){
91 + local mycmakeargs=(
92 + -DUNICORN_ARCH="${UNICORN_TARGETS// /;}"
93 + )
94 +
95 + cmake_src_configure
96 +
97 + wrap_python ${FUNCNAME}
98 +}
99 +
100 +src_compile() {
101 + cmake_src_compile
102 +
103 + wrap_python ${FUNCNAME}
104 +}
105 +
106 +src_install() {
107 + cmake_src_install
108 +
109 + if ! use static-libs; then
110 + find "${ED}" -type f \( -name "*.a" -o -name "*.la" \) -delete || die
111 + fi
112 +
113 + wrap_python ${FUNCNAME}
114 +}