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/rizin/
Date: Wed, 11 May 2022 02:11:16
Message-Id: 1652235059.1ad7d6ae49a3522c71c69e999fd317f2eb147724.sam@gentoo
1 commit: 1ad7d6ae49a3522c71c69e999fd317f2eb147724
2 Author: Mario Haustein <mario.haustein <AT> hrz <DOT> tu-chemnitz <DOT> de>
3 AuthorDate: Tue May 10 21:33:40 2022 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Wed May 11 02:10:59 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1ad7d6ae
7
8 dev-util/rizin: restrict to Capstone 4
9
10 Code doesn't build yet with Capstone 5.
11
12 Package-Manager: Portage-3.0.30, Repoman-3.0.3
13 Signed-off-by: Mario Haustein <mario.haustein <AT> hrz.tu-chemnitz.de>
14 Signed-off-by: Sam James <sam <AT> gentoo.org>
15
16 dev-util/rizin/rizin-0.3.4-r1.ebuild | 103 +++++++++++++++++++++++++++++++++++
17 1 file changed, 103 insertions(+)
18
19 diff --git a/dev-util/rizin/rizin-0.3.4-r1.ebuild b/dev-util/rizin/rizin-0.3.4-r1.ebuild
20 new file mode 100644
21 index 000000000000..cc3e0fb5efbd
22 --- /dev/null
23 +++ b/dev-util/rizin/rizin-0.3.4-r1.ebuild
24 @@ -0,0 +1,103 @@
25 +# Copyright 1999-2022 Gentoo Authors
26 +# Distributed under the terms of the GNU General Public License v2
27 +
28 +EAPI=8
29 +
30 +PYTHON_COMPAT=( python3_{8..10} )
31 +
32 +# This is the commit that the CI for the release commit used
33 +BINS_COMMIT="aa6a88dcdfaad54335e3935c16ce21a124ff861d"
34 +
35 +inherit meson python-any-r1
36 +
37 +DESCRIPTION="reverse engineering framework for binary analysis"
38 +HOMEPAGE="https://rizin.re/"
39 +
40 +SRC_URI="mirror+https://github.com/rizinorg/rizin/releases/download/v${PV}/rizin-src-v${PV}.tar.xz
41 + test? ( https://github.com/rizinorg/rizin-testbins/archive/${BINS_COMMIT}.tar.gz -> rizin-testbins-${BINS_COMMIT}.tar.gz )"
42 +KEYWORDS="~amd64 ~arm64 ~x86"
43 +
44 +LICENSE="Apache-2.0 BSD LGPL-3 MIT"
45 +SLOT="0/${PV}"
46 +IUSE="test"
47 +
48 +# Need to audit licenses of the binaries used for testing
49 +RESTRICT="fetch !test? ( test )"
50 +
51 +RDEPEND="
52 + sys-apps/file
53 + app-arch/lz4:0=
54 + <dev-libs/capstone-5:0=
55 + dev-libs/libuv:0=
56 + dev-libs/libzip:0=
57 + dev-libs/openssl:0=
58 + >=dev-libs/tree-sitter-0.19.0
59 + dev-libs/xxhash
60 + sys-libs/zlib:0=
61 +"
62 +DEPEND="${RDEPEND}"
63 +BDEPEND="${PYTHON_DEPS}"
64 +
65 +PATCHES=(
66 + "${FILESDIR}/${PN}-0.3.0-typedb-prefix.patch"
67 + "${FILESDIR}/${PN}-0.3.2-never-rebuild-parser.patch"
68 +)
69 +
70 +S="${WORKDIR}/${PN}-v${PV}"
71 +
72 +src_prepare() {
73 + default
74 +
75 + local py_to_mangle=(
76 + librz/core/cmd_descs/cmd_descs_generate.py
77 + subprojects/lz4-1.9.3/contrib/meson/meson/GetLz4LibraryVersion.py
78 + subprojects/lz4-1.9.3/contrib/meson/meson/InstallSymlink.py
79 + subprojects/lz4-1.9.3/tests/test-lz4-list.py
80 + subprojects/lz4-1.9.3/tests/test-lz4-speed.py
81 + subprojects/lz4-1.9.3/tests/test-lz4-versions.py
82 + sys/clang-format.py
83 + test/fuzz/scripts/fuzz_rz_asm.py
84 + test/scripts/gdbserver.py
85 + )
86 +
87 + python_fix_shebang "${py_to_mangle[@]}"
88 +
89 + if use test; then
90 + cp -r "${WORKDIR}/rizin-testbins-${BINS_COMMIT}" "${S}/test/bins" || die
91 + cp -r "${WORKDIR}/rizin-testbins-${BINS_COMMIT}" "${S}" || die
92 + fi
93 +}
94 +
95 +src_configure() {
96 + local emesonargs=(
97 + -Dcli=enabled
98 + -Duse_sys_capstone=enabled
99 + -Duse_sys_magic=enabled
100 + -Duse_sys_libzip=enabled
101 + -Duse_sys_zlib=enabled
102 + -Duse_sys_lz4=enabled
103 + -Duse_sys_xxhash=enabled
104 + -Duse_sys_openssl=enabled
105 + -Duse_sys_tree_sitter=enabled
106 +
107 + $(meson_use test enable_tests)
108 + $(meson_use test enable_rz_test)
109 + )
110 + meson_src_configure
111 +}
112 +
113 +src_test() {
114 + # Rizin uses data files that it expects to be installed on the
115 + # system. To hack around this, we create a tree of what it expects
116 + # in ${T}, and patch the tests to support a prefix from the
117 + # environment. https://github.com/rizinorg/rizin/issues/1789
118 + mkdir -p "${T}/usr/share/${PN}/${PV}" || die
119 + ln -sf "${BUILD_DIR}/librz/analysis/d" "${T}/usr/share/${PN}/${PV}/types" || die
120 + ln -sf "${BUILD_DIR}/librz/syscall/d" "${T}/usr/share/${PN}/${PV}/syscall" || die
121 + ln -sf "${BUILD_DIR}/librz/asm/d" "${T}/usr/share/${PN}/${PV}/opcodes" || die
122 + # https://github.com/rizinorg/rizin/issues/1797
123 + ln -sf "${BUILD_DIR}/librz/flag/d" "${T}/usr/share/${PN}/${PV}/flag" || die
124 + export RZ_PREFIX="${T}/usr"
125 +
126 + meson_src_test
127 +}