commit:     daf5df5b140381d9de19e9763d638ac1798421c2
Author:     John Helmert III <ajak <AT> gentoo <DOT> org>
AuthorDate: Sat Nov 20 17:22:26 2021 +0000
Commit:     John Helmert III <ajak <AT> gentoo <DOT> org>
CommitDate: Sat Nov 20 17:26:11 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=daf5df5b

dev-util/rizin: add 0.3.1

Signed-off-by: John Helmert III <ajak <AT> gentoo.org>

 dev-util/rizin/Manifest           |   1 +
 dev-util/rizin/rizin-0.3.1.ebuild | 102 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 103 insertions(+)

diff --git a/dev-util/rizin/Manifest b/dev-util/rizin/Manifest
index 2820a9c4eb55..a20c8d129ca6 100644
--- a/dev-util/rizin/Manifest
+++ b/dev-util/rizin/Manifest
@@ -1 +1,2 @@
 DIST rizin-src-v0.3.0.tar.xz 64097204 BLAKE2B 
308037ce60ec6523f337580221ea265c912ff92032fc5e1c2ab37430eae5a16cc2e8efa74447a79735c7814a35d3b08e5fc2f548612a1553c5edc2f314d22df5
 SHA512 
68f71e612bd4df90c79ebd4cb26c3e09bb370ccd9e51f574f2687f940b3934d9bf417108f3f7e678cabc6ddba7402e0420aab569c24316e07b2b56ed33153ed3
+DIST rizin-src-v0.3.1.tar.xz 64089580 BLAKE2B 
04f7e3cfa20a787f47af90c78405f295b346cc0c7d81164ff01bc6a69df526f3f9112ab4cb62092297ae2dda1fa738a2e7feff35e0f1b7f3e7467a8c6e4d1a1e
 SHA512 
743f8f2c9ddb045f39147de9ad971d47f1a26bfcc233f41c12c64ade5e31c992104cf3f93c44c5035142b554779e895224b68f839cd87a59aaf344b4ec88d5fe

diff --git a/dev-util/rizin/rizin-0.3.1.ebuild 
b/dev-util/rizin/rizin-0.3.1.ebuild
new file mode 100644
index 000000000000..d21a2116b588
--- /dev/null
+++ b/dev-util/rizin/rizin-0.3.1.ebuild
@@ -0,0 +1,102 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=(python3_{8,9,10})
+
+# This is the commit that the CI for the release commit used
+BINS_COMMIT="74b6e4511112b1a6abc571091efc32ec2a7d98a6"
+
+inherit meson python-any-r1
+
+DESCRIPTION="reverse engineering framework for binary analysis"
+HOMEPAGE="https://rizin.re/";
+
+SRC_URI="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"
+IUSE="test"
+
+# Need to audit licenses of the binaries used for testing
+RESTRICT="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.3.0-typedb-prefix.patch"
+)
+
+S="${WORKDIR}/${PN}-v${PV}"
+
+src_prepare() {
+       default
+
+       local py_to_mangle=(
+               librz/core/cmd_descs/cmd_descs_generate.py
+               
subprojects/lz4-1.9.3/contrib/meson/meson/GetLz4LibraryVersion.py
+               subprojects/lz4-1.9.3/contrib/meson/meson/InstallSymlink.py
+               subprojects/lz4-1.9.3/tests/test-lz4-list.py
+               subprojects/lz4-1.9.3/tests/test-lz4-speed.py
+               subprojects/lz4-1.9.3/tests/test-lz4-versions.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() {
+       # Rizin uses data files that it expects to be installed on the
+       # system. To hack around this, we create a tree of what it expects
+       # in ${T}, and patch the tests to support a prefix from the
+       # environment. https://github.com/rizinorg/rizin/issues/1789
+       mkdir -p "${T}/usr/share/${PN}/${PV}" || die
+       ln -sf "${BUILD_DIR}/librz/analysis/d" 
"${T}/usr/share/${PN}/${PV}/types" || die
+       ln -sf "${BUILD_DIR}/librz/syscall/d" 
"${T}/usr/share/${PN}/${PV}/syscall" || die
+       ln -sf "${BUILD_DIR}/librz/asm/d" "${T}/usr/share/${PN}/${PV}/opcodes" 
|| die
+       # https://github.com/rizinorg/rizin/issues/1797
+       ln -sf "${BUILD_DIR}/librz/flag/d" "${T}/usr/share/${PN}/${PV}/flag" || 
die
+       export RZ_PREFIX="${T}/usr"
+
+       meson_src_test
+}

Reply via email to