This commit is contained in:
blshkv 2020-06-16 10:01:44 +08:00
parent f0d6911974
commit bbcefb6fba
No known key found for this signature in database
GPG key ID: 32BDCED870788F04
9 changed files with 108 additions and 6 deletions

View file

@ -1,9 +1,10 @@
# Copyright 1999-2019 Gentoo Authors
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
PYTHON_COMPAT=( python3_{5,6} )
DISTUTILS_USE_SETUPTOOLS=rdepend
PYTHON_COMPAT=( python3_{6,7,8} )
inherit distutils-r1
@ -22,7 +23,7 @@ else
# see more:
# * https://github.com/gentoo/gentoo/pull/11828
# * https://bugs.gentoo.org/652440
#KEYWORDS="~amd64 ~arm64 ~mips ~x86"
KEYWORDS="~amd64 ~arm64 ~mips ~x86"
fi
LICENSE="BSD"
@ -33,5 +34,4 @@ RDEPEND="${PYTHON_DEPS}
!dev-libs/capstone-bindings
dev-libs/keystone[python,${PYTHON_USEDEP}]
dev-python/filebytes[${PYTHON_USEDEP}]"
DEPEND="${RDEPEND}"

View file

@ -0,0 +1 @@
DIST keystone-0.9.1.tar.gz 4326151 BLAKE2B 2d41388f4beeff3c424386c77cb75eeca613c66f80e807035f709822f241ef74f64085260678772580cb82bcceda83b4b3c31b92393f8d70f24d54f77f7ba224 SHA512 3bd9c3793d5862a0a8628b52da381625e62445f661dbd5ed715723e7d9db01ce3f9586e5ca0a5cc71e8ceb6c912050f5c28e3ccd540e72c8abcfd2f0d1bbae17

View file

@ -0,0 +1,88 @@
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=6
DISTUTILS_OPTIONAL=1
CMAKE_MIN_VERSION=3.8.7
PYTHON_COMPAT=( python3_{6,7,8} )
inherit cmake-utils distutils-r1 llvm
DESCRIPTION="assembly/assembler framework + bindings"
HOMEPAGE="http://www.keystone-engine.org/"
if [[ ${PV} == 9999* ]]; then
EGIT_REPO_URI="https://github.com/keystone-engine/keystone.git"
inherit git-r3
KEYWORDS=""
else
SRC_URI="https://github.com/keystone-engine/keystone/archive/${PV/_rc/-rc}.tar.gz -> ${P/-rc/_rc}.tar.gz"
KEYWORDS="~amd64 ~arm ~x86"
fi
LICENSE="GPL-2"
SLOT="0"
# Keep in sync with llvm/CMakeLists.txt, subset of sys-devel/llvm
ALL_LLVM_TARGETS=( AArch64 AMDGPU ARM BPF Hexagon Lanai Mips MSP430
NVPTX PowerPC RISCV Sparc SystemZ WebAssembly X86 XCore )
ALL_LLVM_TARGETS=( "${ALL_LLVM_TARGETS[@]/#/llvm_targets_}" )
LLVM_TARGET_USEDEPS=${ALL_LLVM_TARGETS[@]/%/?}
IUSE="python ${ALL_LLVM_TARGETS[*]}"
RDEPEND="
>=sys-devel/llvm-3.8:=[${LLVM_TARGET_USEDEPS// /,}]
${PYTHON_DEPS}
"
DEPEND="${RDEPEND}"
REQUIRED_USE="
${PYTHON_REQUIRED_USE}
|| ( ${ALL_LLVM_TARGETS[*]} )
"
S=${WORKDIR}/${P/_rc/-rc}
CMAKE_BUILD_TYPE=RelWithDebInfo
llvm_check_deps() {
has_version "sys-devel/llvm:${LLVM_SLOT}[${LLVM_TARGET_USEDEPS// /,}]"
}
wrap_python() {
if use python; then
pushd bindings/python >/dev/null || die
distutils-r1_${EBUILD_PHASE_FUNC} "$@"
popd >/dev/null || die
fi
}
src_prepare() {
default
cmake-utils_src_prepare
wrap_python
}
src_configure() {
local libdir="$(get_libdir)"
local mycmakeargs=(
-DLLVM_LIBDIR_SUFFIX=${libdir#lib}
-DBUILD_SHARED_LIBS=ON
-DLLVM_TARGETS_TO_BUILD="${LLVM_TARGETS// /;}"
-DLLVM_HOST_TRIPLE="${CHOST}"
)
cmake-utils_src_configure
wrap_python
}
src_compile() {
cmake-utils_src_compile
wrap_python
}
src_install() {
cmake-utils_src_install
wrap_python
}

View file

@ -8,4 +8,7 @@ QEMU_USER_TARGETS="arm aarch64 i386 x86_64"
UNICORN_TARGETS="arm aarch64 x86"
#keystone target
LLVM_TARGETS="X86"
VIDEO_CARDS="nvidia amdgpu nouveau fbdev glint intel i965 iris mach64 mga nv radeon radeonsi radeonhd savage sis tdfx vga via vmware voodoo apm chips cirrus cyrix epson i128 i740 imstt nsc rendition s3 s3virge siliconmotion"

View file

@ -10,4 +10,7 @@ QEMU_USER_TARGETS="arm i386"
UNICORN_TARGETS="arm aarch64 x86"
#keystone target
LLVM_TARGETS="X86"
VIDEO_CARDS="amdgpu nouveau fbdev glint intel i965 iris mach64 mga nv radeon radeonsi radeonhd savage sis tdfx vga via vmware voodoo apm chips cirrus cyrix epson i128 i740 imstt nsc rendition s3 s3virge siliconmotion"

View file

@ -1,6 +1,9 @@
#Pentoo packages
dev-python/cmake-converter
#required by app-exploits/ropper
dev-python/filebytes
~dev-python/pyside2-5.14.1
~dev-python/shiboken2-5.14.1

View file

@ -1,6 +1,7 @@
### Pentoo ###
sys-devel/gdb-dashboard
sys-devel/gcc-arm-none-eabi
sys-devel/gef
sys-devel/pwndbg
### Gentoo ###

View file

@ -28,3 +28,6 @@ dev-libs/boehm-gc threads
#sys-apps/fwupd
dev-libs/libjcat gpg pkcs7
#required by sys-devel/gef
dev-libs/keystone python

View file

@ -3,7 +3,7 @@
EAPI=7
PYTHON_COMPAT=( python3_6 )
PYTHON_COMPAT=( python3_{6,7,8} )
inherit eutils python-single-r1
@ -23,7 +23,7 @@ else
# see more:
# * https://github.com/gentoo/gentoo/pull/11828
# * https://bugs.gentoo.org/652440
#KEYWORDS="~amd64 ~x86"
KEYWORDS="~amd64 ~x86"
fi
LICENSE="MIT"