commit:     2a5bf20701100099e99c7b0c7791686b384069b3
Author:     Mario Haustein <mario.haustein <AT> hrz <DOT> tu-chemnitz <DOT> de>
AuthorDate: Thu Aug 22 05:07:45 2024 +0000
Commit:     Joonas Niilola <juippis <AT> gentoo <DOT> org>
CommitDate: Wed Aug 28 06:35:07 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2a5bf207

dev-libs/capstone: add 5.0.3

Signed-off-by: Mario Haustein <mario.haustein <AT> hrz.tu-chemnitz.de>
Closes: https://github.com/gentoo/gentoo/pull/37949
Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org>

 dev-libs/capstone/Manifest                         |   1 +
 dev-libs/capstone/capstone-5.0.3.ebuild            | 100 +++++++++++++++++++++
 dev-libs/capstone/files/capstone-5.0.2-tests.patch |  17 ++++
 3 files changed, 118 insertions(+)

diff --git a/dev-libs/capstone/Manifest b/dev-libs/capstone/Manifest
index 0262b03d1652..1084fc4eb661 100644
--- a/dev-libs/capstone/Manifest
+++ b/dev-libs/capstone/Manifest
@@ -1 +1,2 @@
 DIST capstone-5.0.1.tar.gz 7654195 BLAKE2B 
83f6681d4c9c748df00daf59f7b33637ab72eee661261c22acae40a6db2def70bb6b5339d731244fdbae6f1e1b0b5b22bb6f60c1390a1bebceb97b3f810aedb0
 SHA512 
350aba77ce2d96b5c25764913591ba80e4497177ae0a8b2c820c6755ee8310848fbfc54e7ccac27fafc2dbc6778118ad92c53d1b5cb601d4fa146dec7d7e11e5
+DIST capstone-5.0.3.tar.gz 7650875 BLAKE2B 
3750964a95cbaba685dfb5cf511f12d18f2c157fb622a15c4615734987b8a49ffacf021457f36302606ccf9055e45a7fc56af000b8f09df467922896b431537c
 SHA512 
2fd3194dd37065e6091d208c7670b12c0ca6872931eef794bd6b2dd624601c843e8ee6c5714eae0372e394e91a9bc1e4de7dfea6b1087542dd461226569101de

diff --git a/dev-libs/capstone/capstone-5.0.3.ebuild 
b/dev-libs/capstone/capstone-5.0.3.ebuild
new file mode 100644
index 000000000000..010a1343b07a
--- /dev/null
+++ b/dev-libs/capstone/capstone-5.0.3.ebuild
@@ -0,0 +1,100 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{10..13} )
+DISTUTILS_EXT=1
+DISTUTILS_OPTIONAL=1
+DISTUTILS_USE_PEP517=setuptools
+
+inherit cmake distutils-r1 toolchain-funcs
+
+DESCRIPTION="disassembly/disassembler framework + bindings"
+HOMEPAGE="https://www.capstone-engine.org/";
+
+if [[ ${PV} == 9999 ]]; then
+       inherit git-r3
+       EGIT_REPO_URI="https://github.com/capstone-engine/capstone.git";
+       EGIT_REPO_BRANCH="next"
+else
+       MY_PV="${PV/_rc/-rc}"
+       
SRC_URI="https://github.com/capstone-engine/capstone/archive/${MY_PV}.tar.gz -> 
${P}.tar.gz"
+       S="${WORKDIR}/${PN}-${MY_PV}"
+       KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~loong ~ppc ~ppc64 ~riscv ~x86"
+fi
+
+LICENSE="BSD"
+SLOT="0/5" # libcapstone.so.5
+
+IUSE="python static-libs test"
+RDEPEND="python? ( ${PYTHON_DEPS} )"
+DEPEND="${RDEPEND}
+       python? ( dev-python/setuptools[${PYTHON_USEDEP}] )
+"
+BDEPEND="${DISTUTILS_DEPS}"
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+RESTRICT="!test? ( test )"
+
+PATCHES=(
+       "${FILESDIR}/${PN}-5.0.2-tests.patch"
+)
+
+if [[ ${PV} == *_rc* ]]; then
+       # Upstream doesn't flag release candidates (bug 858350)
+       QA_PKGCONFIG_VERSION=""
+fi
+
+wrap_python() {
+       local phase=$1
+       shift
+
+       if use python; then
+               pushd bindings/python >/dev/null || die
+               distutils-r1_${phase} "$@"
+               popd >/dev/null || die
+       fi
+}
+
+src_prepare() {
+       tc-export RANLIB
+       cmake_src_prepare
+
+       wrap_python ${FUNCNAME}
+}
+
+src_configure() {
+       local mycmakeargs=(
+               -DCAPSTONE_BUILD_TESTS="$(usex test)"
+       )
+       cmake_src_configure
+
+       wrap_python ${FUNCNAME}
+}
+
+src_compile() {
+       cmake_src_compile
+
+       wrap_python ${FUNCNAME}
+}
+
+src_test() {
+       cmake_src_test
+
+       wrap_python ${FUNCNAME}
+}
+
+src_install() {
+       cmake_src_install
+
+       wrap_python ${FUNCNAME}
+
+       if ! use static-libs ; then
+               find "${ED}" -name '*.a' -delete || die
+       fi
+}
+
+python_test() {
+       emake check
+}

diff --git a/dev-libs/capstone/files/capstone-5.0.2-tests.patch 
b/dev-libs/capstone/files/capstone-5.0.2-tests.patch
new file mode 100644
index 000000000000..37ec431fb70b
--- /dev/null
+++ b/dev-libs/capstone/files/capstone-5.0.2-tests.patch
@@ -0,0 +1,17 @@
+From b77714b446e93a0ab997b125ef1fb3ad9bc4bb9b Mon Sep 17 00:00:00 2001
+From: Mario Haustein <[email protected]>
+Date: Wed, 14 Aug 2024 23:28:45 +0200
+Subject: [PATCH] Fix 'make check' for python tests
+Upstream: https://github.com/capstone-engine/capstone/pull/2439
+
+--- a/bindings/python/Makefile
++++ b/bindings/python/Makefile
+@@ -41,7 +41,7 @@ TESTS += test_lite.py test_iter.py test_customized_mnem.py 
test_alpha.py
+ check:
+       @for t in $(TESTS); do \
+               echo Check $$t ... ; \
+-              ./$$t > /dev/null; \
++              ./tests/$$t > /dev/null; \
+               if [ $$? -eq 0 ]; then echo OK; else echo FAILED; exit 1; fi \
+       done
+ 

Reply via email to