Gentoo Archives: gentoo-commits

From: John Helmert III <ajak@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: profiles/base/, dev-util/rizin/
Date: Fri, 31 Dec 2021 22:13:33
Message-Id: 1640988774.af999ae1bdd9824cc92e59791845c6bc2006776e.ajak@gentoo
1 commit: af999ae1bdd9824cc92e59791845c6bc2006776e
2 Author: John Helmert III <ajak <AT> gentoo <DOT> org>
3 AuthorDate: Fri Dec 31 11:46:07 2021 +0000
4 Commit: John Helmert III <ajak <AT> gentoo <DOT> org>
5 CommitDate: Fri Dec 31 22:12:54 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=af999ae1
7
8 dev-util/rizin: add 0.3.2
9
10 Signed-off-by: John Helmert III <ajak <AT> gentoo.org>
11
12 dev-util/rizin/Manifest | 2 +
13 dev-util/rizin/rizin-0.3.2.ebuild | 102 ++++++++++++++++++++++++++++++++++++++
14 profiles/base/package.use.mask | 6 +++
15 3 files changed, 110 insertions(+)
16
17 diff --git a/dev-util/rizin/Manifest b/dev-util/rizin/Manifest
18 index a20c8d129ca6..c6d198b9cfd0 100644
19 --- a/dev-util/rizin/Manifest
20 +++ b/dev-util/rizin/Manifest
21 @@ -1,2 +1,4 @@
22 DIST rizin-src-v0.3.0.tar.xz 64097204 BLAKE2B 308037ce60ec6523f337580221ea265c912ff92032fc5e1c2ab37430eae5a16cc2e8efa74447a79735c7814a35d3b08e5fc2f548612a1553c5edc2f314d22df5 SHA512 68f71e612bd4df90c79ebd4cb26c3e09bb370ccd9e51f574f2687f940b3934d9bf417108f3f7e678cabc6ddba7402e0420aab569c24316e07b2b56ed33153ed3
23 DIST rizin-src-v0.3.1.tar.xz 64089580 BLAKE2B 04f7e3cfa20a787f47af90c78405f295b346cc0c7d81164ff01bc6a69df526f3f9112ab4cb62092297ae2dda1fa738a2e7feff35e0f1b7f3e7467a8c6e4d1a1e SHA512 743f8f2c9ddb045f39147de9ad971d47f1a26bfcc233f41c12c64ade5e31c992104cf3f93c44c5035142b554779e895224b68f839cd87a59aaf344b4ec88d5fe
24 +DIST rizin-src-v0.3.2.tar.xz 64170200 BLAKE2B fe11317e4acc1a803323f42fd4c2c6435a2fe4032581ed509f37f7221ec53e0afac04ebe8cb9da693ac283b61c0a70e135007d635c4c5010519a5c7e7cfa19cf SHA512 c472770ee1b156d42a98d4641f365e2255f16489b2223b117c8b88dcac0d72065d1fd7eedad70046188231889e492bafb7b8462987c68311143f14808eaab1cc
25 +DIST rizin-testbins-d66fa0feaf3b1ecdad261ca17542f1d5d0b101cc.tar.gz 126773703 BLAKE2B f5eaeb7e99e9091b6ca043dd50d03143950adc06b75b5834886d96d6280207c0bea73101a5f9e06c38ba60c0d4cff82dbf1f00364f7d87fe183c0687b06d1904 SHA512 0a017954017c8d57133d51b441411a50aa9ed062c0cc61e1561951fdf0703f5244230cda377885199e9e35dca6780d8582a445ac92286b63ef2ac784777ec0c4
26
27 diff --git a/dev-util/rizin/rizin-0.3.2.ebuild b/dev-util/rizin/rizin-0.3.2.ebuild
28 new file mode 100644
29 index 000000000000..be6e33690c5a
30 --- /dev/null
31 +++ b/dev-util/rizin/rizin-0.3.2.ebuild
32 @@ -0,0 +1,102 @@
33 +# Copyright 1999-2021 Gentoo Authors
34 +# Distributed under the terms of the GNU General Public License v2
35 +
36 +EAPI=8
37 +
38 +PYTHON_COMPAT=(python3_{8,9,10})
39 +
40 +# This is the commit that the CI for the release commit used
41 +BINS_COMMIT="d66fa0feaf3b1ecdad261ca17542f1d5d0b101cc"
42 +
43 +inherit meson python-any-r1
44 +
45 +DESCRIPTION="reverse engineering framework for binary analysis"
46 +HOMEPAGE="https://rizin.re/"
47 +
48 +SRC_URI="mirror+https://github.com/rizinorg/rizin/releases/download/v${PV}/rizin-src-v${PV}.tar.xz
49 + test? ( https://github.com/rizinorg/rizin-testbins/archive/${BINS_COMMIT}.tar.gz -> rizin-testbins-${BINS_COMMIT}.tar.gz )"
50 +KEYWORDS="~amd64 ~arm64 ~x86"
51 +
52 +LICENSE="Apache-2.0 BSD LGPL-3 MIT"
53 +SLOT="0/${PV}"
54 +IUSE="test"
55 +
56 +# Need to audit licenses of the binaries used for testing
57 +RESTRICT="fetch !test? ( test )"
58 +
59 +RDEPEND="
60 + sys-apps/file
61 + app-arch/lz4:0=
62 + dev-libs/capstone:0=
63 + dev-libs/libuv:0=
64 + dev-libs/libzip:0=
65 + dev-libs/openssl:0=
66 + >=dev-libs/tree-sitter-0.19.0
67 + dev-libs/xxhash
68 + sys-libs/zlib:0=
69 +"
70 +DEPEND="${RDEPEND}"
71 +BDEPEND="${PYTHON_DEPS}"
72 +
73 +PATCHES=(
74 + "${FILESDIR}/${PN}-0.3.0-typedb-prefix.patch"
75 +)
76 +
77 +S="${WORKDIR}/${PN}-v${PV}"
78 +
79 +src_prepare() {
80 + default
81 +
82 + local py_to_mangle=(
83 + librz/core/cmd_descs/cmd_descs_generate.py
84 + subprojects/lz4-1.9.3/contrib/meson/meson/GetLz4LibraryVersion.py
85 + subprojects/lz4-1.9.3/contrib/meson/meson/InstallSymlink.py
86 + subprojects/lz4-1.9.3/tests/test-lz4-list.py
87 + subprojects/lz4-1.9.3/tests/test-lz4-speed.py
88 + subprojects/lz4-1.9.3/tests/test-lz4-versions.py
89 + sys/clang-format.py
90 + test/fuzz/scripts/fuzz_rz_asm.py
91 + test/scripts/gdbserver.py
92 + )
93 +
94 + python_fix_shebang "${py_to_mangle[@]}"
95 +
96 + if use test; then
97 + cp -r "${WORKDIR}/rizin-testbins-${BINS_COMMIT}" "${S}/test/bins" || die
98 + cp -r "${WORKDIR}/rizin-testbins-${BINS_COMMIT}" "${S}" || die
99 + fi
100 +}
101 +
102 +src_configure() {
103 + local emesonargs=(
104 + -Dcli=enabled
105 + -Duse_sys_capstone=enabled
106 + -Duse_sys_magic=enabled
107 + -Duse_sys_libzip=enabled
108 + -Duse_sys_zlib=enabled
109 + -Duse_sys_lz4=enabled
110 + -Duse_sys_xxhash=enabled
111 + -Duse_sys_openssl=enabled
112 + -Duse_sys_tree_sitter=enabled
113 +
114 + $(meson_use test enable_tests)
115 + $(meson_use test enable_rz_test)
116 + )
117 + meson_src_configure
118 +}
119 +
120 +src_test() {
121 + # Rizin uses data files that it expects to be installed on the
122 + # system. To hack around this, we create a tree of what it expects
123 + # in ${T}, and patch the tests to support a prefix from the
124 + # environment. https://github.com/rizinorg/rizin/issues/1789
125 + mkdir -p "${T}/usr/share/${PN}/${PV}" || die
126 + ln -sf "${BUILD_DIR}/librz/analysis/d" "${T}/usr/share/${PN}/${PV}/types" || die
127 + ln -sf "${BUILD_DIR}/librz/syscall/d" "${T}/usr/share/${PN}/${PV}/syscall" || die
128 + ln -sf "${BUILD_DIR}/librz/asm/d" "${T}/usr/share/${PN}/${PV}/opcodes" || die
129 + # https://github.com/rizinorg/rizin/issues/1797
130 + ln -sf "${BUILD_DIR}/librz/flag/d" "${T}/usr/share/${PN}/${PV}/flag" || die
131 + export RZ_PREFIX="${T}/usr"
132 +
133 + meson_src_test
134 +}
135
136 diff --git a/profiles/base/package.use.mask b/profiles/base/package.use.mask
137 index cc997a8c5d49..0d2a178a42f0 100644
138 --- a/profiles/base/package.use.mask
139 +++ b/profiles/base/package.use.mask
140 @@ -6,6 +6,12 @@
141 # This file is only for generic masks. For arch-specific masks (i.e.
142 # mask everywhere, unmask on arch/*) use arch/base.
143
144 +# John Helmert III <ajak@g.o> (2021-12-31)
145 +# Rizin tests require a tarball of binaries of ambiguous license.
146 +# As such, we cannot properly test it, so mask the flag until this
147 +# situation is resolved.
148 +dev-util/rizin test
149 +
150 # Sam James <sam@g.o> (2021-12-27)
151 # Doc building is broken and no new releases in a long time.
152 # bug #830013