From 2719f73b6813d11d13a9650cdd2ab8ec6e69385d Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Sat, 9 Jul 2022 15:43:36 +0100 Subject: gentoo resync : 09.07.2022 --- dev-util/rizin/Manifest | 10 +- dev-util/rizin/files/rizin-0.4.0-capstone.patch | 22 +++++ .../files/rizin-0.4.0-never-rebuild-parser.patch | 38 ++++++++ dev-util/rizin/rizin-0.3.4-r1.ebuild | 103 --------------------- dev-util/rizin/rizin-0.3.4.ebuild | 103 --------------------- dev-util/rizin/rizin-0.4.0-r1.ebuild | 95 +++++++++++++++++++ dev-util/rizin/rizin-0.4.0.ebuild | 94 +++++++++++++++++++ 7 files changed, 255 insertions(+), 210 deletions(-) create mode 100644 dev-util/rizin/files/rizin-0.4.0-capstone.patch create mode 100644 dev-util/rizin/files/rizin-0.4.0-never-rebuild-parser.patch delete mode 100644 dev-util/rizin/rizin-0.3.4-r1.ebuild delete mode 100644 dev-util/rizin/rizin-0.3.4.ebuild create mode 100644 dev-util/rizin/rizin-0.4.0-r1.ebuild create mode 100644 dev-util/rizin/rizin-0.4.0.ebuild (limited to 'dev-util/rizin') diff --git a/dev-util/rizin/Manifest b/dev-util/rizin/Manifest index 3c00397fcef4..28df4af7c4e0 100644 --- a/dev-util/rizin/Manifest +++ b/dev-util/rizin/Manifest @@ -1,7 +1,9 @@ AUX rizin-0.3.0-typedb-prefix.patch 5175 BLAKE2B 08fea1ba6297f17d42f518c1739875c0964f6f00c1bcd01cba51a56e6626fe50c6ad2c36bece4db326f7b128d6ea5786970eb454832e32f9d837458f92f2a596 SHA512 241a72a7f1c3ec8ba831ca696faf0cfc09a58207c6d3db7005b09b9016a71ed9238bcb9441a389116083557538a0ff1a6adf55e78e1aa35d67aa206f30774391 AUX rizin-0.3.2-never-rebuild-parser.patch 1493 BLAKE2B fd5a4d306336ccba939e9d96e97d4b653b83407352f9babf9c39bbad28a18b4fc1a3e2f1eb57b25b7f8dad35b3400271cf6a6bf1cec55c74dc00f424da715c91 SHA512 7a105831cbdb99633c43411b7a407ff6970cb8e89cae561886ade96c75579c0484271641e957762189fc68762952a26ca0a2536bd1342802c408041066852b16 -DIST rizin-src-v0.3.4.tar.xz 10411432 BLAKE2B 99745f069e6bd72aec6a6f335f3aa0ccc46ebf186b1dc0aaf32b4f95d2be4bb49e8d3d976a72978c22fce82d896e70bf8403568e100b73898731045ef06a2ad5 SHA512 cda35afe8c031f3207c055ed31d7f76a46b7addd04cead0f5aadf0733b66f4dd953ca16f054b47da7921d4726d6ea1250436012954a9755c1cd524a8fd0d670c -DIST rizin-testbins-aa6a88dcdfaad54335e3935c16ce21a124ff861d.tar.gz 127254454 BLAKE2B e7a4536be7169abd197c2128e103b8d669fbb7532ce265b27da3ce347b1aa58c8a96c95d85cf7700f66a44c041a0575175de3a0e176a0d31c490f7ccfb2f6d6b SHA512 20cf299e5324793f07f8a2fdcfa3d66c3a418f09bfc6a272e35ab31d4a64408bf91532ae431098dede1a2d0ad0b1c02433304c514816d98dc068f6c0528a4099 -EBUILD rizin-0.3.4-r1.ebuild 2949 BLAKE2B a9bc52204a78067073435df92cfafa1e8c41757c6aa78782ee2914e02c859588fcad8eeed5c2d8f75d72e69a418eef40831f80b671069b9b7f407737ae0394eb SHA512 29fe2634d5a6677de17932b0f5dcf1018acb835a92ba9ed6c96e15be740e9534b730045bbbfbabda62b89bfc2d8efcb6a64d78fdf6f1863c39570bcc9f50e042 -EBUILD rizin-0.3.4.ebuild 2945 BLAKE2B 9fa83d7ac4b5fc25886439e34cccf2c378dad4d18ffdd098f2fb02732a13ae4304fad5dffc5f9d92ec898b020900aa53e7d09a8ee93a3b2189d47461b9c01344 SHA512 83d5364a7b2a4f92730e3cebe5e5443ea7086fb8e616dfaf4dff3c4755ef35f1e4a40adce4a0b829110e27799a7ea97799809c1bb396c1ff618a57b769aa0f8a +AUX rizin-0.4.0-capstone.patch 681 BLAKE2B ad680ca6ee4782d0a164048e9884a3154fd817ffea42810dc3e11ebd9b5254da7fa1c1379180ba43eec9d3b1966329ffbc7a807df1beee6bcc9879e7e7b5cb65 SHA512 dca9648697d9b419002d27de4ac562ec519c4ffd2161960c489c90e5c0950beaac7a7e9b86cfa32a34efdf60f11fd953547b9a37fe457fe294b5516e5d07d412 +AUX rizin-0.4.0-never-rebuild-parser.patch 1568 BLAKE2B c77276adb8349188ebc937d84b011650b978ba5bed6c0596258963d395014c5e0733e44930b4c2db6dd88941d99b2aa37acf461d035fc31dcd321571ef0d6392 SHA512 a46311772dc42b90b8e3e49ddb66f6d64873773e254ac943934de0129d5f4a77ccb759d20b519b58418d45c076f136d582f2e70056693c75b2f6aae19eb07551 +DIST rizin-src-v0.4.0.tar.xz 11432232 BLAKE2B 095ca9d317296afca9514a70f208e9aa87fc426e6b7e41163f64d5a1192a4d9ccd8ece9c4f13a24fc973668dece625fa13ad75542695a66c542fe2f0d9e66733 SHA512 9d576bee48e5ceae46b4e309c53e01b82edf89a95046f576e1c38fefa73353d6d1f04e6d444332324387d4e115bc87659a358629f7277a41dfef44c82364547b +DIST rizin-testbins-64a6f26369bf5893ecc20cb8984a5ad506ef8566.tar.gz 172591261 BLAKE2B e78843fd95ac0406f66490b7253206e77787fc65780bc7c6a67d26aa9618a6f85803a88724ad424a7bdeeb20d95ebf9314e582029ac778d7d4de4f207ff54aad SHA512 ada4a3faad94553f0f2802419ba604177bb66d332b1a351effd485d65bd8365abb36d736486bbd0bcbc0da584ad4a2edaa7aa3cb62fa12811282c2e0afecb950 +EBUILD rizin-0.4.0-r1.ebuild 2483 BLAKE2B f776c97d5a1e27a5df6e0426c37daa5c8eb8d8f12234c0fbc2f0a2320fd256a41013b0529059c6b40ffc3a827846dbcbf723cc337b10a138dd975d15f00c9133 SHA512 ee556a24f162fa5288dcf7b26f694d96160f741078fcf1be0ac2e22e5d2931d21146fb717dd9ea70514f8194d65e77d2bb829573b8e38f68ac011f3ca9f6ce2e +EBUILD rizin-0.4.0.ebuild 2450 BLAKE2B 68537bc3cac4d53376e36e455275838be5ea072c78644e0354b70888c19f89c671156f632933970a8ee787f62a532ebcde7a74199d625a996501a0a030185e4f SHA512 20a2da4dd0a4d1ae6d237ac64b751bb88a45ccc44556a434be540334f1ae68d0fb95055ca38eeeffe1959ef2310e24fe6a9dac24b10a3bf3a6d91126261070b0 MISC metadata.xml 348 BLAKE2B eea14d9f2e713f2f272a46bd754e500b28ec3958f0f4295e6fe6e73c9dcfa1e180fa62901bdb591fdb43ec8ead23a63f20416e52605e6ae186532e651e0eb1a3 SHA512 db41ccd0ce1493387c47eb707dd303c556ad784ffab2ffe03509a4ff7b0c1b650b0f0999edb5e4e040f95f1f550e9a11ead273ec74ebedb97e645e40c6ad37d5 diff --git a/dev-util/rizin/files/rizin-0.4.0-capstone.patch b/dev-util/rizin/files/rizin-0.4.0-capstone.patch new file mode 100644 index 000000000000..4132e97095f6 --- /dev/null +++ b/dev-util/rizin/files/rizin-0.4.0-capstone.patch @@ -0,0 +1,22 @@ +From 2b8104bc5e763ed841d6dbffacbeaf02e86b8421 Mon Sep 17 00:00:00 2001 +From: Mario Haustein +Date: Thu, 7 Jul 2022 07:50:10 +0200 +Subject: [PATCH] Fix capstone include directory + +--- + librz/analysis/arch/arm/arm_il64.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/librz/analysis/arch/arm/arm_il64.c b/librz/analysis/arch/arm/arm_il64.c +index 2e9da10aece..6b552596c9e 100644 +--- a/librz/analysis/arch/arm/arm_il64.c ++++ b/librz/analysis/arch/arm/arm_il64.c +@@ -2,7 +2,7 @@ + // SPDX-License-Identifier: LGPL-3.0-only + + #include +-#include ++#include + + #include "arm_cs.h" + diff --git a/dev-util/rizin/files/rizin-0.4.0-never-rebuild-parser.patch b/dev-util/rizin/files/rizin-0.4.0-never-rebuild-parser.patch new file mode 100644 index 000000000000..0e6e95c09318 --- /dev/null +++ b/dev-util/rizin/files/rizin-0.4.0-never-rebuild-parser.patch @@ -0,0 +1,38 @@ +commit 7af437dbedaaa478b579d19133b6711923b037d8 +Author: John Helmert III +Date: Mon Jul 4 12:44:43 2022 -0500 + + subprojects/rizin-shell-parser/src: Never rebuild parser.c + + This requires dev-libs/tree-sitter[ts-cli] and net-libs/nodejs, both + of which would be heavy new dependencies. However, these are only + needed to rebuild the already-existing tree-sitter parser, which + doesn't do much for us (if anything) since it already exists. In this + case, it's better to just reduce fragility by unconditionally + disabling this. + + Newly forward-ported from the 0.3.2 version. + + Bug: https://bugs.gentoo.org/830068 + Signed-off-by: John Helmert III + +diff --git a/subprojects/rizin-shell-parser/src/meson.build b/subprojects/rizin-shell-parser/src/meson.build +index ae31896a98..14324daba0 100644 +--- a/subprojects/rizin-shell-parser/src/meson.build ++++ b/subprojects/rizin-shell-parser/src/meson.build +@@ -1,14 +1,4 @@ +-tree_sitter_bin = find_program('tree-sitter', required: false) +-node_bin = find_program('node', required: false) +-if tree_sitter_bin.found() and node_bin.found() and tree_sitter_dep.type_name() != 'internal' +- parser_c = custom_target('parser_src_c', +- command: [tree_sitter_wrap_py, tree_sitter_bin, '@OUTDIR@/..', '@INPUT@'], +- input: [grammar_js], +- output: 'parser.c', +- ) +-else +- parser_c = files('parser.c') +-endif ++parser_c = files('parser.c') + + shell_parser_files = [files('scanner.c'), parser_c] + shell_parser_inc = [include_directories('tree_sitter')] diff --git a/dev-util/rizin/rizin-0.3.4-r1.ebuild b/dev-util/rizin/rizin-0.3.4-r1.ebuild deleted file mode 100644 index cc3e0fb5efbd..000000000000 --- a/dev-util/rizin/rizin-0.3.4-r1.ebuild +++ /dev/null @@ -1,103 +0,0 @@ -# Copyright 1999-2022 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -PYTHON_COMPAT=( python3_{8..10} ) - -# This is the commit that the CI for the release commit used -BINS_COMMIT="aa6a88dcdfaad54335e3935c16ce21a124ff861d" - -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="fetch !test? ( test )" - -RDEPEND=" - sys-apps/file - app-arch/lz4: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" - "${FILESDIR}/${PN}-0.3.2-never-rebuild-parser.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 -} diff --git a/dev-util/rizin/rizin-0.3.4.ebuild b/dev-util/rizin/rizin-0.3.4.ebuild deleted file mode 100644 index 27d41f85b946..000000000000 --- a/dev-util/rizin/rizin-0.3.4.ebuild +++ /dev/null @@ -1,103 +0,0 @@ -# Copyright 1999-2022 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -PYTHON_COMPAT=( python3_{8..10} ) - -# This is the commit that the CI for the release commit used -BINS_COMMIT="aa6a88dcdfaad54335e3935c16ce21a124ff861d" - -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="fetch !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.3.0-typedb-prefix.patch" - "${FILESDIR}/${PN}-0.3.2-never-rebuild-parser.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 -} diff --git a/dev-util/rizin/rizin-0.4.0-r1.ebuild b/dev-util/rizin/rizin-0.4.0-r1.ebuild new file mode 100644 index 000000000000..b298dce57be7 --- /dev/null +++ b/dev-util/rizin/rizin-0.4.0-r1.ebuild @@ -0,0 +1,95 @@ +# Copyright 1999-2022 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="64a6f26369bf5893ecc20cb8984a5ad506ef8566" + +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="fetch !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}/${P}-capstone.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() { + # 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 +} diff --git a/dev-util/rizin/rizin-0.4.0.ebuild b/dev-util/rizin/rizin-0.4.0.ebuild new file mode 100644 index 000000000000..5f19fe3d4b47 --- /dev/null +++ b/dev-util/rizin/rizin-0.4.0.ebuild @@ -0,0 +1,94 @@ +# Copyright 1999-2022 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="64a6f26369bf5893ecc20cb8984a5ad506ef8566" + +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="fetch !test? ( test )" + +RDEPEND=" + sys-apps/file + app-arch/lz4: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" +) + +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() { + # 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 +} -- cgit v1.2.3