summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMario Haustein <mario.haustein@hrz.tu-chemnitz.de>2023-01-31 00:03:56 +0100
committerViorel Munteanu <ceamac@gentoo.org>2023-02-17 19:25:11 +0200
commit72e21ed97ef7f7e5a9a2e71e3ea326dc7f91a406 (patch)
tree6e67871b0ba55406f1a2a992f738ad2a087fe818 /dev-libs/capstone
parentapp-pda/libimobiledevice: fix Python bindings (diff)
downloadgentoo-72e21ed97ef7f7e5a9a2e71e3ea326dc7f91a406.tar.gz
gentoo-72e21ed97ef7f7e5a9a2e71e3ea326dc7f91a406.tar.bz2
gentoo-72e21ed97ef7f7e5a9a2e71e3ea326dc7f91a406.zip
dev-libs/capstone: don't install static libraries unconditionally
Closes: https://bugs.gentoo.org/890941 Signed-off-by: Mario Haustein <mario.haustein@hrz.tu-chemnitz.de> Closes: https://github.com/gentoo/gentoo/pull/29350 Signed-off-by: Viorel Munteanu <ceamac@gentoo.org>
Diffstat (limited to 'dev-libs/capstone')
-rw-r--r--dev-libs/capstone/capstone-5.0_rc2-r3.ebuild95
-rw-r--r--dev-libs/capstone/capstone-9999.ebuild11
2 files changed, 103 insertions, 3 deletions
diff --git a/dev-libs/capstone/capstone-5.0_rc2-r3.ebuild b/dev-libs/capstone/capstone-5.0_rc2-r3.ebuild
new file mode 100644
index 000000000000..52e6eaa6617a
--- /dev/null
+++ b/dev-libs/capstone/capstone-5.0_rc2-r3.ebuild
@@ -0,0 +1,95 @@
+# 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} )
+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
+ SRC_URI="https://github.com/capstone-engine/capstone/archive/${PV/_rc/-rc}.tar.gz -> ${P}.tar.gz"
+ S=${WORKDIR}/${P/_rc/-rc}
+ KEYWORDS="~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} )"
+
+distutils_enable_tests setup.py
+
+PATCHES=(
+ "${FILESDIR}"/${P}-pkgconfig.patch
+ "${FILESDIR}"/${P}-oob-mem-access.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
+}
diff --git a/dev-libs/capstone/capstone-9999.ebuild b/dev-libs/capstone/capstone-9999.ebuild
index 259fa40dbb50..ef624cde1cad 100644
--- a/dev-libs/capstone/capstone-9999.ebuild
+++ b/dev-libs/capstone/capstone-9999.ebuild
@@ -5,6 +5,7 @@ EAPI=8
DISTUTILS_OPTIONAL=1
PYTHON_COMPAT=( python3_{9..11} )
+DISTUTILS_USE_PEP517=setuptools
inherit cmake distutils-r1 toolchain-funcs
@@ -17,23 +18,23 @@ if [[ ${PV} == 9999 ]]; then
EGIT_REPO_BRANCH="next"
else
SRC_URI="https://github.com/capstone-engine/capstone/archive/${PV/_rc/-rc}.tar.gz -> ${P}.tar.gz"
+ S=${WORKDIR}/${P/_rc/-rc}
KEYWORDS="~amd64 ~arm ~arm64 ~loong ~riscv ~x86"
fi
LICENSE="BSD"
SLOT="0/5" # libcapstone.so.5
-IUSE="python test"
+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} )"
distutils_enable_tests setup.py
-S=${WORKDIR}/${P/_rc/-rc}
-
if [[ ${PV} == *_rc* ]]; then
# Upstream doesn't flag release candidates (bug 858350)
QA_PKGCONFIG_VERSION=""
@@ -82,4 +83,8 @@ src_install() {
cmake_src_install
wrap_python ${FUNCNAME}
+
+ if ! use static-libs ; then
+ find "${ED}" -name '*.a' -delete || die
+ fi
}