public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: dev-libs/capstone/files/, dev-libs/capstone/
@ 2017-03-25 16:09 Sergei Trofimovich
  0 siblings, 0 replies; 5+ messages in thread
From: Sergei Trofimovich @ 2017-03-25 16:09 UTC (permalink / raw
  To: gentoo-commits

commit:     83209f33a128ec7f48adbfad813cfbc13a2fd444
Author:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
AuthorDate: Sat Mar 25 16:07:40 2017 +0000
Commit:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
CommitDate: Sat Mar 25 16:07:40 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=83209f33

dev-libs/capstone: bump up to 3.0.5-rc2, fix CVE-2017-6952, bug #612912

I don't believe 3.0.4 is affected:

- it's a vulnerability in windows kernel driver. Not something you can easily build in gentoo today as it requires MSVS to build a driver
- the windows code was added in capstone-3.0.5-rc1. It's not present in 3.0.4 in gentoo at all

But not to forget about the vulnerability on next bump
I'm bumping up to vilnerable release candidate and applying
the upstream patch to fix CVE-2017-6952.

Reported-by: Agostino Sarubbo
Bug: https://bugs.gentoo.org/612912
Package-Manager: Portage-2.3.5, Repoman-2.3.2

 dev-libs/capstone/Manifest                         |  1 +
 dev-libs/capstone/capstone-3.0.5_rc2.ebuild        | 44 ++++++++++++++++++++++
 .../files/capstone-3.0.5_rc2-CVE-2017-6952.patch   | 41 ++++++++++++++++++++
 .../capstone/files/capstone-3.0.5_rc2-FLAGS.patch  | 16 ++++++++
 4 files changed, 102 insertions(+)

diff --git a/dev-libs/capstone/Manifest b/dev-libs/capstone/Manifest
index 239b44faf89..3f35304c88d 100644
--- a/dev-libs/capstone/Manifest
+++ b/dev-libs/capstone/Manifest
@@ -1 +1,2 @@
 DIST capstone-3.0.4.tar.gz 2800818 SHA256 5d6dadf5864c56f8de66c66088fa68e849d0bff6577865a4f81b6f23112b14f2 SHA512 a5c29e7c559b5391d6a4ec9a7f766699ea6d321aa2f1fc57fdcec893107fa3ef2f5f6323629971c1129f1ca087df4f3ad03d0a8234d2eae368c8ccfec04dbf4d WHIRLPOOL 24aa002e215ee2a74c06a9be40218c78258a853028c74e1cdf95a5e2ea484471cf084cc8f5cc9db1aaefc16cf80a0b37480d4af60ca9119730334cbe2a02b906
+DIST capstone-3.0.5_rc2.tar.gz 2829338 SHA256 587c092454ad59137686529f3c008c265cc6d427a85d5d2e8f6a902b72d215b3 SHA512 31bafdb0b3183d0c054a4244cc135db9a3c3dc5cb2e2af706bfede0d53cca8cba81d74b74ef9a4adbfd6c79cc408864dd80b8203791e17bd6c98bb69ea4f6894 WHIRLPOOL 11a84f178cae68507d2686a81ca6cbc84b6402cb02e7278c03ec598887a0aa02d28a9ecbf388e09c8c3ae8d8ecf323dd4eaa211f79969089c4c7d6fbbe022349

diff --git a/dev-libs/capstone/capstone-3.0.5_rc2.ebuild b/dev-libs/capstone/capstone-3.0.5_rc2.ebuild
new file mode 100644
index 00000000000..80fb03207d6
--- /dev/null
+++ b/dev-libs/capstone/capstone-3.0.5_rc2.ebuild
@@ -0,0 +1,44 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit toolchain-funcs
+
+DESCRIPTION="disassembly/disassembler framework + bindings"
+HOMEPAGE="http://www.capstone-engine.org/"
+SRC_URI="https://github.com/aquynh/${PN}/archive/${PV/_rc/-rc}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0/3" # libcapstone.so.3
+KEYWORDS="~amd64 ~arm ~x86"
+
+RDEPEND=""
+DEPEND="${RDEPEND}"
+
+PATCHES=(
+	"${FILESDIR}"/${P}-CVE-2017-6952.patch
+	"${FILESDIR}"/${P}-FLAGS.patch
+)
+
+S=${WORKDIR}/${P/_rc/-rc}
+
+src_configure() {
+	{
+		cat <<-EOF
+		# Gentoo overrides:
+		#   verbose build
+		V = 1
+		#   toolchain
+		AR = $(tc-getAR)
+		CC = $(tc-getCC)
+		RANLIB = $(tc-getRANLIB)
+		#  toolchain flags
+		CFLAGS = ${CFLAGS}
+		LDFLAGS = ${LDFLAGS}
+		#  libs
+		LIBDIRARCH = $(get_libdir)
+		EOF
+	} >> config.mk || die
+
+}

diff --git a/dev-libs/capstone/files/capstone-3.0.5_rc2-CVE-2017-6952.patch b/dev-libs/capstone/files/capstone-3.0.5_rc2-CVE-2017-6952.patch
new file mode 100644
index 00000000000..ba16126f741
--- /dev/null
+++ b/dev-libs/capstone/files/capstone-3.0.5_rc2-CVE-2017-6952.patch
@@ -0,0 +1,41 @@
+commit 6fe86eef621b9849f51a5e1e5d73258a93440403
+Author: Quang Nguyễn <quangnh89@users.noreply.github.com>
+Date:   Mon Mar 13 22:34:48 2017 +0700
+
+    provide a validity check to prevent against Integer overflow conditions (#870)
+    
+    * provide a validity check to prevent against Integer overflow conditions
+    
+    * fix some style issues.
+
+diff --git a/windows/winkernel_mm.c b/windows/winkernel_mm.c
+index c127da3a..ecdc1ca2 100644
+--- a/windows/winkernel_mm.c
++++ b/windows/winkernel_mm.c
+@@ -3,6 +3,7 @@
+ 
+ #include "winkernel_mm.h"
+ #include <ntddk.h>
++#include <Ntintsafe.h>
+ 
+ // A pool tag for memory allocation
+ static const ULONG CS_WINKERNEL_POOL_TAG = 'kwsC';
+@@ -33,8 +34,16 @@ void * CAPSTONE_API cs_winkernel_malloc(size_t size)
+ 
+ 	// FP; a use of NonPagedPool is required for Windows 7 support
+ #pragma prefast(suppress : 30030)		// Allocating executable POOL_TYPE memory
+-	CS_WINKERNEL_MEMBLOCK *block = (CS_WINKERNEL_MEMBLOCK *)ExAllocatePoolWithTag(
+-			NonPagedPool, size + sizeof(CS_WINKERNEL_MEMBLOCK), CS_WINKERNEL_POOL_TAG);
++	size_t number_of_bytes = 0;
++	CS_WINKERNEL_MEMBLOCK *block = NULL;
++	// A specially crafted size value can trigger the overflow.
++	// If the sum in a value that overflows or underflows the capacity of the type,
++	// the function returns NULL.
++	if (!NT_SUCCESS(RtlSizeTAdd(size, sizeof(CS_WINKERNEL_MEMBLOCK), &number_of_bytes))) {
++		return NULL;
++	}
++	block = (CS_WINKERNEL_MEMBLOCK *)ExAllocatePoolWithTag(
++			NonPagedPool, number_of_bytes, CS_WINKERNEL_POOL_TAG);
+ 	if (!block) {
+ 		return NULL;
+ 	}

diff --git a/dev-libs/capstone/files/capstone-3.0.5_rc2-FLAGS.patch b/dev-libs/capstone/files/capstone-3.0.5_rc2-FLAGS.patch
new file mode 100644
index 00000000000..4be2ed4ba0e
--- /dev/null
+++ b/dev-libs/capstone/files/capstone-3.0.5_rc2-FLAGS.patch
@@ -0,0 +1,16 @@
+Add support for user overridden CFLAGS and LDFLAGS
+diff --git a/cstool/Makefile b/cstool/Makefile
+index 450ac1b..3cf2a81 100644
+--- a/cstool/Makefile
++++ b/cstool/Makefile
+@@ -3,2 +3,3 @@
+ include ../functions.mk
++include ../config.mk
+ 
+@@ -8,4 +9,4 @@ LIBNAME = capstone
+ 
+-CFLAGS = -I../include
+-LDFLAGS = -O3 -Wall -L.. -l$(LIBNAME)
++CFLAGS += -I../include
++LDFLAGS += -Wall -L.. -l$(LIBNAME)
+ 


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-libs/capstone/files/, dev-libs/capstone/
@ 2020-07-04 17:52 Sergei Trofimovich
  0 siblings, 0 replies; 5+ messages in thread
From: Sergei Trofimovich @ 2020-07-04 17:52 UTC (permalink / raw
  To: gentoo-commits

commit:     878bbb63fd18d2aaaa7496bba1fda39948773820
Author:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
AuthorDate: Sat Jul  4 17:51:53 2020 +0000
Commit:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
CommitDate: Sat Jul  4 17:52:06 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=878bbb63

dev-libs/capstone: install into --libdir=

Reported-by: Agostino Sarubbo
Closes: https://bugs.gentoo.org/730722
Package-Manager: Portage-2.3.103, Repoman-2.3.23
Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org>

 dev-libs/capstone/capstone-4.0.2-r2.ebuild         | 74 ++++++++++++++++++++++
 .../capstone/files/capstone-4.0.2-libsuffix.patch  | 12 ++++
 2 files changed, 86 insertions(+)

diff --git a/dev-libs/capstone/capstone-4.0.2-r2.ebuild b/dev-libs/capstone/capstone-4.0.2-r2.ebuild
new file mode 100644
index 00000000000..99f181cb326
--- /dev/null
+++ b/dev-libs/capstone/capstone-4.0.2-r2.ebuild
@@ -0,0 +1,74 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+DISTUTILS_OPTIONAL=1
+PYTHON_COMPAT=( python{3_6,3_7} )
+
+inherit cmake-utils distutils-r1 toolchain-funcs
+
+DESCRIPTION="disassembly/disassembler framework + bindings"
+HOMEPAGE="http://www.capstone-engine.org/"
+SRC_URI="https://github.com/aquynh/${PN}/archive/${PV/_rc/-rc}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0/4" # libcapstone.so.4
+KEYWORDS="~amd64 ~arm ~arm64 ~x86"
+
+RESTRICT="!test? ( test )"
+
+IUSE="python static-libs test"
+RDEPEND="python? ( ${PYTHON_DEPS} )"
+DEPEND="${RDEPEND}
+	python? ( dev-python/setuptools[${PYTHON_USEDEP}] )
+"
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+S=${WORKDIR}/${P/_rc/-rc}
+
+PATCHES=(
+	"${FILESDIR}"/${P}-libsuffix.patch
+)
+
+wrap_python() {
+	if use python; then
+		pushd bindings/python >/dev/null || die
+		distutils-r1_${1} "$@"
+		popd >/dev/null
+	fi
+}
+
+src_prepare() {
+	cmake-utils_src_prepare
+
+	wrap_python ${FUNCNAME}
+}
+
+src_configure() {
+	local mycmakeargs=(
+		-DCAPSTONE_BUILD_TESTS="$(usex test)"
+		-DCAPSTONE_BUILD_STATIC="$(usex static-libs)"
+	)
+	cmake-utils_src_configure
+
+	wrap_python ${FUNCNAME}
+}
+
+src_compile() {
+	cmake-utils_src_compile
+
+	wrap_python ${FUNCNAME}
+}
+
+src_test() {
+	cmake-utils_src_test
+
+	wrap_python ${FUNCNAME}
+}
+
+src_install() {
+	cmake-utils_src_install
+
+	wrap_python ${FUNCNAME}
+}

diff --git a/dev-libs/capstone/files/capstone-4.0.2-libsuffix.patch b/dev-libs/capstone/files/capstone-4.0.2-libsuffix.patch
new file mode 100644
index 00000000000..69479ce407d
--- /dev/null
+++ b/dev-libs/capstone/files/capstone-4.0.2-libsuffix.patch
@@ -0,0 +1,12 @@
+cmake does not provide 'LIBSUFFIX' variables, but provides 'LIB_SUFFIX'.
+https://bugs.gentoo.org/730722
+--- a/capstone.pc.in
++++ b/capstone.pc.in
+@@ -1,6 +1,6 @@
+ prefix=@CMAKE_INSTALL_PREFIX@
+ exec_prefix=${prefix}
+-libdir=${prefix}/lib@LIBSUFFIX@
++libdir=${prefix}/lib@LIB_SUFFIX@
+ includedir=${prefix}/include/capstone
+ 
+ Name: capstone


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-libs/capstone/files/, dev-libs/capstone/
@ 2022-05-11  2:11 Sam James
  0 siblings, 0 replies; 5+ messages in thread
From: Sam James @ 2022-05-11  2:11 UTC (permalink / raw
  To: gentoo-commits

commit:     3f161266557c6d49226102e8df0725789639f993
Author:     Mario Haustein <mario.haustein <AT> hrz <DOT> tu-chemnitz <DOT> de>
AuthorDate: Sat Apr 30 17:02:06 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed May 11 02:11:00 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3f161266

dev-libs/capstone: fix version statement in pkg-config file

Bug: https://bugs.gentoo.org/841716
Package-Manager: Portage-3.0.30, Repoman-3.0.3
Signed-off-by: Mario Haustein <mario.haustein <AT> hrz.tu-chemnitz.de>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../{capstone-5.0_rc2.ebuild => capstone-5.0_rc2-r1.ebuild} |  4 ++++
 dev-libs/capstone/files/capstone-5.0_rc2-pkgconfig.patch    | 13 +++++++++++++
 2 files changed, 17 insertions(+)

diff --git a/dev-libs/capstone/capstone-5.0_rc2.ebuild b/dev-libs/capstone/capstone-5.0_rc2-r1.ebuild
similarity index 96%
rename from dev-libs/capstone/capstone-5.0_rc2.ebuild
rename to dev-libs/capstone/capstone-5.0_rc2-r1.ebuild
index f54ab3111868..6127c611b7d2 100644
--- a/dev-libs/capstone/capstone-5.0_rc2.ebuild
+++ b/dev-libs/capstone/capstone-5.0_rc2-r1.ebuild
@@ -27,6 +27,10 @@ distutils_enable_tests setup.py
 
 S=${WORKDIR}/${P/_rc/-rc}
 
+PATCHES=(
+	"${FILESDIR}"/${P}-pkgconfig.patch
+)
+
 wrap_python() {
 	local phase=$1
 	shift

diff --git a/dev-libs/capstone/files/capstone-5.0_rc2-pkgconfig.patch b/dev-libs/capstone/files/capstone-5.0_rc2-pkgconfig.patch
new file mode 100644
index 000000000000..015220a138e8
--- /dev/null
+++ b/dev-libs/capstone/files/capstone-5.0_rc2-pkgconfig.patch
@@ -0,0 +1,13 @@
+diff --git a/capstone.pc.in b/capstone.pc.in
+index 1b559eac..1ffcd354 100644
+--- a/capstone.pc.in
++++ b/capstone.pc.in
+@@ -5,7 +5,7 @@ includedir=${prefix}/include
+ 
+ Name: capstone
+ Description: Capstone disassembly engine
+-Version: @VERSION_MAJOR@.@VERSION_MINOR@.@VERSION_PATCH@
++Version: @PROJECT_VERSION_MAJOR@.@PROJECT_VERSION_MINOR@.@PROJECT_VERSION_PATCH@
+ URL: http://www.capstone-engine.org
+ archive=${libdir}/libcapstone.a
+ Libs: -L${libdir} -lcapstone


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-libs/capstone/files/, dev-libs/capstone/
@ 2024-06-02  0:41 Sam James
  0 siblings, 0 replies; 5+ messages in thread
From: Sam James @ 2024-06-02  0:41 UTC (permalink / raw
  To: gentoo-commits

commit:     336a046ddd7db724ecd593b5d1e9ee9cdb01b4b4
Author:     Mario Haustein <mario.haustein <AT> hrz <DOT> tu-chemnitz <DOT> de>
AuthorDate: Sun Apr 28 15:12:57 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Jun  2 00:40:49 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=336a046d

dev-libs/capstone: drop 4.0.2-r2

Signed-off-by: Mario Haustein <mario.haustein <AT> hrz.tu-chemnitz.de>
Closes: https://github.com/gentoo/gentoo/pull/36470
Signed-off-by: Sam James <sam <AT> gentoo.org>

 dev-libs/capstone/Manifest                         |  1 -
 dev-libs/capstone/capstone-4.0.2-r2.ebuild         | 84 ----------------------
 .../capstone/files/capstone-4.0.2-libsuffix.patch  | 12 ----
 3 files changed, 97 deletions(-)

diff --git a/dev-libs/capstone/Manifest b/dev-libs/capstone/Manifest
index 3c41eeac7749..0262b03d1652 100644
--- a/dev-libs/capstone/Manifest
+++ b/dev-libs/capstone/Manifest
@@ -1,2 +1 @@
-DIST capstone-4.0.2.tar.gz 3439542 BLAKE2B 435729a8fef2dce6495635352101b3befe563c8404efdbb0dccabecbe2bded332221665bacdbcd9043dda72b652b6f29c0e1a548cefb8c64d5b6b9dc174ed3d9 SHA512 7f93534517307b737422a8825b66b2a1f3e1cca2049465d60ab12595940154aaf843ba40ed348fce58de58b990c19a0caef289060eb72898cb008a88c470970e
 DIST capstone-5.0.1.tar.gz 7654195 BLAKE2B 83f6681d4c9c748df00daf59f7b33637ab72eee661261c22acae40a6db2def70bb6b5339d731244fdbae6f1e1b0b5b22bb6f60c1390a1bebceb97b3f810aedb0 SHA512 350aba77ce2d96b5c25764913591ba80e4497177ae0a8b2c820c6755ee8310848fbfc54e7ccac27fafc2dbc6778118ad92c53d1b5cb601d4fa146dec7d7e11e5

diff --git a/dev-libs/capstone/capstone-4.0.2-r2.ebuild b/dev-libs/capstone/capstone-4.0.2-r2.ebuild
deleted file mode 100644
index 579ef58d9929..000000000000
--- a/dev-libs/capstone/capstone-4.0.2-r2.ebuild
+++ /dev/null
@@ -1,84 +0,0 @@
-# Copyright 1999-2023 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-DISTUTILS_OPTIONAL=1
-PYTHON_COMPAT=( python3_{9..11} )
-
-inherit cmake distutils-r1 toolchain-funcs
-
-DESCRIPTION="disassembly/disassembler framework + bindings"
-HOMEPAGE="https://www.capstone-engine.org/"
-SRC_URI="https://github.com/capstone-engine/capstone/archive/${PV/_rc/-rc}.tar.gz -> ${P}.tar.gz"
-
-LICENSE="BSD"
-SLOT="0/4" # libcapstone.so.4
-KEYWORDS="amd64 ~arm ~arm64 ~riscv x86"
-
-# A few disassembly outputs need an update
-RESTRICT="test"
-
-IUSE="python static-libs test"
-RDEPEND="python? ( ${PYTHON_DEPS} )"
-DEPEND="${RDEPEND}
-	python? ( dev-python/setuptools[${PYTHON_USEDEP}] )
-"
-REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
-
-#TODO: needs upstream fixes
-#distutils_enable_tests setup.py
-
-S=${WORKDIR}/${P/_rc/-rc}
-
-PATCHES=(
-	"${FILESDIR}"/${P}-libsuffix.patch
-)
-
-wrap_python() {
-	local phase=$1
-	shift
-
-	if use python; then
-		pushd bindings/python >/dev/null || die
-		echo distutils-r1_${phase} "$@"
-		pwd
-		distutils-r1_${phase} "$@"
-		popd >/dev/null
-	fi
-}
-
-src_prepare() {
-	tc-export RANLIB
-	cmake_src_prepare
-
-	wrap_python ${FUNCNAME}
-}
-
-src_configure() {
-	local mycmakeargs=(
-		-DCAPSTONE_BUILD_TESTS="$(usex test)"
-		-DCAPSTONE_BUILD_STATIC="$(usex static-libs)"
-	)
-	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}
-}

diff --git a/dev-libs/capstone/files/capstone-4.0.2-libsuffix.patch b/dev-libs/capstone/files/capstone-4.0.2-libsuffix.patch
deleted file mode 100644
index 056140be13df..000000000000
--- a/dev-libs/capstone/files/capstone-4.0.2-libsuffix.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-cmake does not provide 'LIBSUFFIX' variables, but provides 'LIB_SUFFIX'.
-https://bugs.gentoo.org/730722
---- a/capstone.pc.in
-+++ b/capstone.pc.in
-@@ -1,6 +1,6 @@
- prefix=@CMAKE_INSTALL_PREFIX@
- exec_prefix=${prefix}
--libdir=${prefix}/lib@LIBSUFFIX@
-+libdir=${prefix}/@CMAKE_INSTALL_LIBDIR@
- includedir=${prefix}/include/capstone
- 
- Name: capstone


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-libs/capstone/files/, dev-libs/capstone/
@ 2024-08-28  6:39 Joonas Niilola
  0 siblings, 0 replies; 5+ messages in thread
From: Joonas Niilola @ 2024-08-28  6:39 UTC (permalink / raw
  To: gentoo-commits

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 <mario.haustein@hrz.tu-chemnitz.de>
+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
+ 


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-08-28  6:39 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-28  6:39 [gentoo-commits] repo/gentoo:master commit in: dev-libs/capstone/files/, dev-libs/capstone/ Joonas Niilola
  -- strict thread matches above, loose matches on Subject: below --
2024-06-02  0:41 Sam James
2022-05-11  2:11 Sam James
2020-07-04 17:52 Sergei Trofimovich
2017-03-25 16:09 Sergei Trofimovich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox