summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMario Haustein <mario.haustein@hrz.tu-chemnitz.de>2023-04-25 21:27:34 +0200
committerSam James <sam@gentoo.org>2023-04-25 22:26:51 +0100
commit2a52d587ee6b149e97f67decb9cd64bec7598870 (patch)
treec79f5eb5b6c41c8ba91976c3ab30f57a40a599dc /dev-libs
parentdev-libs/keystone: use DISTUTILS_USE_PEP517 (diff)
downloadgentoo-2a52d587ee6b149e97f67decb9cd64bec7598870.tar.gz
gentoo-2a52d587ee6b149e97f67decb9cd64bec7598870.tar.bz2
gentoo-2a52d587ee6b149e97f67decb9cd64bec7598870.zip
dev-libs/keystone: remove unnecessary dependency to sys-devel/llvm
LLVM is bundled to the keystone. Closes: https://bugs.gentoo.org/905008 Signed-off-by: Mario Haustein <mario.haustein@hrz.tu-chemnitz.de> Closes: https://github.com/gentoo/gentoo/pull/30755 Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'dev-libs')
-rw-r--r--dev-libs/keystone/keystone-0.9.2-r2.ebuild98
-rw-r--r--dev-libs/keystone/keystone-9999.ebuild13
2 files changed, 102 insertions, 9 deletions
diff --git a/dev-libs/keystone/keystone-0.9.2-r2.ebuild b/dev-libs/keystone/keystone-0.9.2-r2.ebuild
new file mode 100644
index 000000000000..7298fa032259
--- /dev/null
+++ b/dev-libs/keystone/keystone-0.9.2-r2.ebuild
@@ -0,0 +1,98 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DISTUTILS_EXT=1
+DISTUTILS_OPTIONAL=1
+DISTUTILS_USE_PEP517=setuptools
+PYTHON_COMPAT=( python3_{9..11} )
+
+inherit cmake distutils-r1 llvm
+
+DESCRIPTION="assembly/assembler framework + bindings"
+HOMEPAGE="https://www.keystone-engine.org/"
+
+if [[ ${PV} == 9999* ]]; then
+ EGIT_REPO_URI="https://github.com/keystone-engine/keystone.git"
+ inherit git-r3
+else
+ SRC_URI="https://github.com/keystone-engine/keystone/archive/${PV/_rc/-rc}.tar.gz -> ${P}.tar.gz"
+ KEYWORDS="amd64 ~arm ~arm64 ~ppc ~ppc64 x86"
+fi
+S="${WORKDIR}"/${P/_rc/-rc}
+
+LICENSE="GPL-2"
+SLOT="0"
+
+# Keep in sync with llvm/CMakeLists.txt
+KEYSTONE_TARGETS="AArch64 ARM Hexagon Mips PowerPC Sparc SystemZ X86"
+
+IUSE="debug python"
+
+RDEPEND="
+ python? ( ${PYTHON_DEPS} )
+"
+DEPEND="${RDEPEND}"
+BDEPEND="
+ python?
+ (
+ ${DISTUTILS_DEPS}
+ ${PYTHON_DEPS}
+ )
+"
+
+RESTRICT=test # only regression tests
+
+REQUIRED_USE="
+ python? ( ${PYTHON_REQUIRED_USE} )
+"
+
+# Upstream doesn't flag patch releases (bug 858395)
+QA_PKGCONFIG_VERSION="$(ver_cut 1-2)"
+
+wrap_python() {
+ if use python; then
+ pushd bindings/python >/dev/null || die
+ distutils-r1_${1} "$@"
+ popd >/dev/null || die
+ fi
+}
+
+pkg_setup() {
+ python_setup
+}
+
+src_prepare() {
+ default
+
+ sed -i '/NOT uppercase_CMAKE_BUILD_TYPE MATCHES/ s/DEBUG/GENTOO|DEBUG/' \
+ llvm/CMakeLists.txt || die
+ cmake_src_prepare
+ wrap_python ${FUNCNAME}
+}
+
+src_configure() {
+ local libdir="$(get_libdir)"
+ local mycmakeargs=(
+ -DCMAKE_CONFIGURATION_TYPES="Gentoo"
+ -DLLVM_LIBDIR_SUFFIX=${libdir#lib}
+ -DBUILD_SHARED_LIBS=ON
+ -DLLVM_TARGETS_TO_BUILD="${KEYSTONE_TARGETS// /;}"
+ -DLLVM_HOST_TRIPLE="${CHOST}"
+ -DPYTHON_EXECUTABLE="${PYTHON}"
+ )
+
+ cmake_src_configure
+ wrap_python ${FUNCNAME}
+}
+
+src_compile() {
+ cmake_src_compile
+ wrap_python ${FUNCNAME}
+}
+
+src_install() {
+ cmake_src_install
+ wrap_python ${FUNCNAME}
+}
diff --git a/dev-libs/keystone/keystone-9999.ebuild b/dev-libs/keystone/keystone-9999.ebuild
index 0187a48fc4cd..aec73814fd16 100644
--- a/dev-libs/keystone/keystone-9999.ebuild
+++ b/dev-libs/keystone/keystone-9999.ebuild
@@ -3,7 +3,6 @@
EAPI=8
-LLVM_MAX_SLOT=14
DISTUTILS_EXT=1
DISTUTILS_OPTIONAL=1
DISTUTILS_USE_PEP517=setuptools
@@ -26,15 +25,12 @@ S="${WORKDIR}"/${P/_rc/-rc}
LICENSE="GPL-2"
SLOT="0"
-# Keep in sync with llvm/CMakeLists.txt, subset of sys-devel/llvm
-ALL_LLVM_TARGETS=( AArch64 ARM Hexagon Mips PowerPC Sparc SystemZ X86 )
-ALL_LLVM_TARGETS=( "${ALL_LLVM_TARGETS[@]/#/llvm_targets_}" )
-LLVM_TARGET_USEDEPS=${ALL_LLVM_TARGETS[@]/%/?}
+# Keep in sync with llvm/CMakeLists.txt
+KEYSTONE_TARGETS="AArch64 ARM Hexagon Mips PowerPC Sparc SystemZ X86"
-IUSE="debug python ${ALL_LLVM_TARGETS[*]}"
+IUSE="debug python"
RDEPEND="
- <sys-devel/llvm-$((${LLVM_MAX_SLOT} + 1)):=[${LLVM_TARGET_USEDEPS// /,}]
python? ( ${PYTHON_DEPS} )
"
DEPEND="${RDEPEND}"
@@ -49,7 +45,6 @@ BDEPEND="
RESTRICT=test # only regression tests
REQUIRED_USE="
- || ( ${ALL_LLVM_TARGETS[*]} )
python? ( ${PYTHON_REQUIRED_USE} )
"
@@ -83,7 +78,7 @@ src_configure() {
-DCMAKE_CONFIGURATION_TYPES="Gentoo"
-DLLVM_LIBDIR_SUFFIX=${libdir#lib}
-DBUILD_SHARED_LIBS=ON
- -DLLVM_TARGETS_TO_BUILD="${LLVM_TARGETS// /;}"
+ -DLLVM_TARGETS_TO_BUILD="${KEYSTONE_TARGETS// /;}"
-DLLVM_HOST_TRIPLE="${CHOST}"
-DPYTHON_EXECUTABLE="${PYTHON}"
)