diff --git a/dev-libs/keystone/Manifest b/dev-libs/keystone/Manifest new file mode 100644 index 000000000..e2b37e04d --- /dev/null +++ b/dev-libs/keystone/Manifest @@ -0,0 +1 @@ +DIST keystone-0.9.2.tar.gz 4433222 BLAKE2B 5654ae6a66ccf6832fbdbb8c1083a2318e413bb833a0fadc4e1374f0de601e3dad9f354b1dec92d9a944621923458e432510299c1b55579ac9bb6b6e90a818de SHA512 5d4dd30410410bc7848e75a2e31e8ecef6241ad25e21963aa7a07bbea21d95b75e235c80573129014102684c9647710ace3c0776a8401844d7e4b45cab7bd04b diff --git a/dev-libs/keystone/keystone-0.9.2.ebuild b/dev-libs/keystone/keystone-0.9.2.ebuild new file mode 100644 index 000000000..ddd53c959 --- /dev/null +++ b/dev-libs/keystone/keystone-0.9.2.ebuild @@ -0,0 +1,91 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +DISTUTILS_OPTIONAL=1 +PYTHON_COMPAT=( python3_{7..9} ) + +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 ~arm64 x86" +fi + +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[@]/%/?} + +IUSE="python ${ALL_LLVM_TARGETS[*]}" + +LLVM_MAX_SLOT=12 + +# /dev/null || die + distutils-r1_${1} "$@" + popd >/dev/null || die + fi +} + +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="${LLVM_TARGETS// /;}" + -DLLVM_HOST_TRIPLE="${CHOST}" + ) + + 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/metadata.xml b/dev-libs/keystone/metadata.xml new file mode 100644 index 000000000..0e605aea5 --- /dev/null +++ b/dev-libs/keystone/metadata.xml @@ -0,0 +1,8 @@ + + + + + + keystone-engine/keystone + + diff --git a/profiles/pentoo/base/package.accept_keywords/dev-libs b/profiles/pentoo/base/package.accept_keywords/dev-libs index 2dc4492c2..2c55acc0f 100644 --- a/profiles/pentoo/base/package.accept_keywords/dev-libs +++ b/profiles/pentoo/base/package.accept_keywords/dev-libs @@ -40,7 +40,6 @@ dev-libs/protobuf amd64 dev-libs/libdwarf ### Gentoo ############ -~dev-libs/keystone-0.9.1 #usbguard =dev-libs/pegtl-2.8* =dev-libs/capstone-4.0*