summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'dev-util/rizin')
-rw-r--r--dev-util/rizin/Manifest2
-rw-r--r--dev-util/rizin/files/rizin-0.5.0-capstone-include-path.patch52
-rw-r--r--dev-util/rizin/rizin-0.5.0.ebuild90
3 files changed, 144 insertions, 0 deletions
diff --git a/dev-util/rizin/Manifest b/dev-util/rizin/Manifest
index aaaf7a30d602..3507cb8b84c3 100644
--- a/dev-util/rizin/Manifest
+++ b/dev-util/rizin/Manifest
@@ -1,2 +1,4 @@
DIST rizin-src-v0.4.1.tar.xz 11453808 BLAKE2B dcae21320e2533904d9a337d4fb9cc9a450439753106dc5c341e3ca7c788f0a44034340eb0dfe3fad4f1d8a7ebe873720d42d70ce343e8c7b953d4d148a38da2 SHA512 565358e11fd4db44ec7f8c25313a1cfc726c38a17afcb699c3fc2af520242fb343ea4a267f0a8e35bdc08e9a765a6a17ec7b8eaba9f9ad9ef5a7dcfe01c7354c
+DIST rizin-src-v0.5.0.tar.xz 11774892 BLAKE2B ae64f2b14829eaedeff2e4ef9986778e311edddff7aac7b9a05a84d09015e13e67725e170d79f1f6bc85933726631ad76df2986e5c8fa64f3387418099296c2f SHA512 690a3220b808d41bcf56752556233d0d0b68b458c767441ce74f35358b2b4fa5e46a483a220d635e53bd287a0e10d16e5c141ba5cb916b984683f42eef10fcff
+DIST rizin-testbins-0264ae4ee5bd606ec6c6a539255eeb57ce2c82c2.tar.gz 179281553 BLAKE2B b86278589da2f8e5859b0f4b16e2667a6e7477c9a889158da5a2c1a1b6e29af4798d56a22dd4c3e23aec1908e7b444ca999502e73f8d8ccf4e0bf2a969380564 SHA512 ae11b6da5cb995f8f1cc996a7b772234b3e7e7c2b0695d0b223657ba839c82dbbcb390600aeb0d16c7c61a5037ba9d0739df79efd730c1b96392cfc1e6f6613d
DIST rizin-testbins-aef7f7b714a696f382f55b8cbbf94c5b69518de3.tar.gz 178497762 BLAKE2B 8c82a537a58e65d35bd8b309311c4377b5996ff4b650fc6cff4cf347e04fbe4b2ec0e88f03ff43572c8e99675186b05b393b7da070a60ab107c3cca829d2544b SHA512 2745b58646963c28a45b46e8e709845c355863e61cf796aeb3d2e617f1bf2f9916a4b106cd08f48b1ef6e36f7f38624b5977dcd62c921124b0a1122b7220baa8
diff --git a/dev-util/rizin/files/rizin-0.5.0-capstone-include-path.patch b/dev-util/rizin/files/rizin-0.5.0-capstone-include-path.patch
new file mode 100644
index 000000000000..485a131cf483
--- /dev/null
+++ b/dev-util/rizin/files/rizin-0.5.0-capstone-include-path.patch
@@ -0,0 +1,52 @@
+Upstreamed at: https://github.com/rizinorg/rizin/pull/3380
+
+commit e1a65044139443c43a14c8304d095d9d6cddae56
+Author: John Helmert III <ajak@gentoo.org>
+Date: Sat Feb 18 18:22:42 2023 -0600
+
+ fix capstone include paths
+
+ capstone include paths were adjusted in
+ 2b8104bc5e763ed841d6dbffacbeaf02e86b8421, and this wasn't picked up in
+ the "PPC uplifting" commit, leading to a build failure with system
+ capstone.
+
+ Also fix the path of the ppc.h include, which seems to mistakenly use
+ capstone's ppc.h when building with bundled capstone.
+
+ Fixes: b46e7bd4f2 ("PPC uplifting to RzIL (#2823)")
+ Signed-off-by: John Helmert III <ajak@gentoo.org>
+
+diff --git a/librz/analysis/arch/ppc/ppc_il.h b/librz/analysis/arch/ppc/ppc_il.h
+index ee91eb050b..7871414cef 100644
+--- a/librz/analysis/arch/ppc/ppc_il.h
++++ b/librz/analysis/arch/ppc/ppc_il.h
+@@ -9,7 +9,7 @@
+ #include <rz_analysis.h>
+ #include <rz_il.h>
+ #include <rz_types.h>
+-#include <capstone.h>
++#include <capstone/capstone.h>
+
+ #define PPC_BYTE 8
+ #define PPC_HWORD 16
+diff --git a/librz/analysis/arch/ppc/ppc_il_ops.c b/librz/analysis/arch/ppc/ppc_il_ops.c
+index f7a2261093..31a730c009 100644
+--- a/librz/analysis/arch/ppc/ppc_il_ops.c
++++ b/librz/analysis/arch/ppc/ppc_il_ops.c
+@@ -1,13 +1,13 @@
+ // SPDX-FileCopyrightText: 2022 Rot127 <unisono@quyllur.org>
+ // SPDX-License-Identifier: LGPL-3.0-only
+
+-#include "ppc.h"
++#include "opcode/ppc.h"
+ #include "ppc_il.h"
+ #include "ppc_analysis.h"
+ #include "rz_types_base.h"
+ #include <rz_il/rz_il_opcodes.h>
+ #include <rz_util/rz_assert.h>
+-#include <capstone.h>
++#include <capstone/capstone.h>
+ #include <rz_il/rz_il_opbuilder_begin.h>
+
+ static RzILOpEffect *load_op(RZ_BORROW csh handle, RZ_BORROW cs_insn *insn, const cs_mode mode) {
diff --git a/dev-util/rizin/rizin-0.5.0.ebuild b/dev-util/rizin/rizin-0.5.0.ebuild
new file mode 100644
index 000000000000..7b26e28e6034
--- /dev/null
+++ b/dev-util/rizin/rizin-0.5.0.ebuild
@@ -0,0 +1,90 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{9..11} )
+
+# This is the commit that the CI for the release commit used
+BINS_COMMIT="0264ae4ee5bd606ec6c6a539255eeb57ce2c82c2"
+
+inherit meson python-any-r1
+
+DESCRIPTION="reverse engineering framework for binary analysis"
+HOMEPAGE="https://rizin.re/"
+
+SRC_URI="mirror+https://github.com/rizinorg/rizin/releases/download/v${PV}/rizin-src-v${PV}.tar.xz
+ test? ( https://github.com/rizinorg/rizin-testbins/archive/${BINS_COMMIT}.tar.gz -> rizin-testbins-${BINS_COMMIT}.tar.gz )"
+KEYWORDS="~amd64 ~arm64 ~x86"
+
+LICENSE="Apache-2.0 BSD LGPL-3 MIT"
+SLOT="0/${PV}"
+IUSE="test"
+
+# Need to audit licenses of the binaries used for testing
+RESTRICT="!test? ( test )"
+
+RDEPEND="
+ sys-apps/file
+ app-arch/lz4:0=
+ dev-libs/capstone:0=
+ dev-libs/libuv:0=
+ dev-libs/libzip:0=
+ dev-libs/openssl:0=
+ >=dev-libs/tree-sitter-0.19.0
+ dev-libs/xxhash
+ sys-libs/zlib:0=
+"
+DEPEND="${RDEPEND}"
+BDEPEND="${PYTHON_DEPS}"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-0.4.0-never-rebuild-parser.patch"
+ "${FILESDIR}/${PN}-0.5.0-capstone-include-path.patch"
+)
+
+S="${WORKDIR}/${PN}-v${PV}"
+
+src_prepare() {
+ default
+
+ local py_to_mangle=(
+ librz/core/cmd_descs/cmd_descs_generate.py
+ sys/clang-format.py
+ test/fuzz/scripts/fuzz_rz_asm.py
+ test/scripts/gdbserver.py
+ )
+
+ python_fix_shebang "${py_to_mangle[@]}"
+
+ if use test; then
+ cp -r "${WORKDIR}/rizin-testbins-${BINS_COMMIT}" "${S}/test/bins" || die
+ cp -r "${WORKDIR}/rizin-testbins-${BINS_COMMIT}" "${S}" || die
+ fi
+}
+
+src_configure() {
+ local emesonargs=(
+ -Dcli=enabled
+ -Duse_sys_capstone=enabled
+ -Duse_sys_magic=enabled
+ -Duse_sys_libzip=enabled
+ -Duse_sys_zlib=enabled
+ -Duse_sys_lz4=enabled
+ -Duse_sys_xxhash=enabled
+ -Duse_sys_openssl=enabled
+ -Duse_sys_tree_sitter=enabled
+
+ $(meson_use test enable_tests)
+ $(meson_use test enable_rz_test)
+ )
+ meson_src_configure
+}
+
+src_test() {
+ # We can select running either unit or integration tests, or all of
+ # them by not passing --suite. According to upstream, integration
+ # tests are more fragile and unit tests are sufficient for testing
+ # packaging, so only run those.
+ meson_src_test --suite unit
+}