mirror of
https://github.com/pentoo/pentoo-overlay
synced 2026-01-03 06:14:23 +01:00
capstone: migrate to Gentoo, https://github.com/pentoo/pentoo-overlay/issues/520
This commit is contained in:
parent
c0e9ad0030
commit
0c7c842a28
21 changed files with 22 additions and 160 deletions
|
|
@ -18,4 +18,5 @@ KEYWORDS="~amd64 ~x86"
|
|||
|
||||
DEPEND="${PYTHON_DEPS}"
|
||||
RDEPEND="${DEPEND}
|
||||
dev-libs/capstone-bindings[python,${PYTHON_USEDEP}]"
|
||||
dev-libs/capstone[python,${PYTHON_USEDEP}]
|
||||
!dev-libs/capstone-bindings"
|
||||
|
|
@ -20,7 +20,8 @@ KEYWORDS="~amd64 ~x86"
|
|||
RDEPEND=">=dev-python/paramiko-1.15.2[${PYTHON_USEDEP}]
|
||||
>=dev-python/mako-1.0.0[${PYTHON_USEDEP}]
|
||||
>=dev-python/pyelftools-0.2.4[${PYTHON_USEDEP}]
|
||||
dev-libs/capstone-bindings[python,${PYTHON_USEDEP}]
|
||||
dev-libs/capstone[python,${PYTHON_USEDEP}]
|
||||
!dev-libs/capstone-bindings
|
||||
>=app-exploits/ROPgadget-5.3[${PYTHON_USEDEP}]
|
||||
>=dev-python/pyserial-2.7[${PYTHON_USEDEP}]
|
||||
>=dev-python/requests-2.0[${PYTHON_USEDEP}]
|
||||
|
|
@ -18,7 +18,8 @@ IUSE=""
|
|||
|
||||
DEPEND=""
|
||||
RDEPEND="${DEPEND}
|
||||
dev-libs/capstone-bindings[python,${PYTHON_USEDEP}]
|
||||
dev-libs/capstone[python,${PYTHON_USEDEP}]
|
||||
!dev-libs/capstone-bindings
|
||||
app-crypt/osslsigncode
|
||||
dev-python/pefile"
|
||||
|
||||
|
|
|
|||
|
|
@ -23,7 +23,8 @@ IUSE="graph squashfs ubifs yaffs"
|
|||
|
||||
RDEPEND="${PYTHON_DEPS}
|
||||
$(python_gen_cond_dep 'dev-python/backports-lzma[${PYTHON_USEDEP}]' python2_7)
|
||||
dev-libs/capstone-bindings[python,${PYTHON_USEDEP}]
|
||||
dev-libs/capstone[python,${PYTHON_USEDEP}]
|
||||
!dev-libs/capstone-bindings
|
||||
graph? ( dev-python/pyqtgraph[opengl,${PYTHON_USEDEP}] )
|
||||
sys-apps/file[${PYTHON_USEDEP}]
|
||||
squashfs? (
|
||||
|
|
@ -1 +0,0 @@
|
|||
DIST capstone-4.0.1.tar.gz 3434276 BLAKE2B 585e0ee19b76d96116c67b021bbe19fd01d8db600b565094ff71a01d8a87b1123a8c5e2f944f1551c411565d5a25dfbfbb3138ca220b1281044a31004002399e SHA512 43c52024065b41b45eff9423341db3f3d5163fa7aa01b360faa30437786740c8f2c34c36faa04dced5308e09d8bd78df3bad0ab9c06f98612169edb176f83c36
|
||||
|
|
@ -1,57 +0,0 @@
|
|||
# Copyright 1999-2019 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=7
|
||||
|
||||
MY_PV="${PV//_/-}"
|
||||
MY_P=capstone-"${MY_PV}"
|
||||
|
||||
DISTUTILS_OPTIONAL=1
|
||||
PYTHON_COMPAT=( python2_7 python3_{4,5,6,7} )
|
||||
|
||||
inherit eutils multilib distutils-r1
|
||||
|
||||
DESCRIPTION="A lightweight multi-platform, multi-architecture disassembly framework"
|
||||
HOMEPAGE="http://www.capstone-engine.org/"
|
||||
SRC_URI="https://github.com/aquynh/capstone/archive/${MY_PV}.tar.gz -> ${MY_P}.tar.gz"
|
||||
|
||||
LICENSE="BSD"
|
||||
SLOT="0"
|
||||
KEYWORDS="~amd64 ~arm ~x86"
|
||||
#TODO: add java, ocaml, PowerShell, VB6, C#, Go, Ruby, NodeJS, C++ & Vala
|
||||
IUSE="+python cython"
|
||||
|
||||
RDEPEND="python? ( ${PYTHON_DEPS} )
|
||||
cython? ( dev-python/cython )"
|
||||
DEPEND="${RDEPEND}
|
||||
dev-libs/capstone
|
||||
dev-python/setuptools[${PYTHON_USEDEP}]"
|
||||
|
||||
S="${WORKDIR}/${MY_P}/bindings/python"
|
||||
|
||||
pkg_setup() {
|
||||
python_setup
|
||||
}
|
||||
|
||||
src_prepare() {
|
||||
#our hack to adjust cython setup
|
||||
if use cython; then
|
||||
einfo "cython flag is enabled"
|
||||
cp setup_cython.py setup.py || die
|
||||
sed -e "s|'xcore_const']|'xcore_const', 'tms320c64x', 'tms320c64x_const']|" -i setup.py || die "sed failed"
|
||||
# sed -e 's|install:|install_default:|' -i Makefile || die "sed failed"
|
||||
# sed -e 's|install_cython:|install:|' -i Makefile || die "sed failed"
|
||||
#this section is from Makefile
|
||||
cp capstone/__init__.py pyx/__init__.py || die
|
||||
for i in arm{,_const} arm64{,_const} mips{,_const} ppc{,_const} x86{,_const} sparc{,_const} systemz sysz_const xcore{,_const} tms320c64x{,_const}; do
|
||||
cp capstone/${i}.py pyx/${i}.pyx || die
|
||||
done
|
||||
fi
|
||||
|
||||
default
|
||||
}
|
||||
|
||||
src_install() {
|
||||
distutils-r1_src_install
|
||||
python_optimize "${D}$(python_get_sitedir)/capstone/"
|
||||
}
|
||||
|
|
@ -1 +0,0 @@
|
|||
DIST capstone-4.0.1.tar.gz 3434276 BLAKE2B 585e0ee19b76d96116c67b021bbe19fd01d8db600b565094ff71a01d8a87b1123a8c5e2f944f1551c411565d5a25dfbfbb3138ca220b1281044a31004002399e SHA512 43c52024065b41b45eff9423341db3f3d5163fa7aa01b360faa30437786740c8f2c34c36faa04dced5308e09d8bd78df3bad0ab9c06f98612169edb176f83c36
|
||||
|
|
@ -1,34 +0,0 @@
|
|||
# Copyright 1999-2019 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=7
|
||||
|
||||
inherit cmake-utils
|
||||
|
||||
DESCRIPTION="disassembly/disassembler framework + bindings"
|
||||
HOMEPAGE="http://www.capstone-engine.org/"
|
||||
SRC_URI="https://github.com/aquynh/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
|
||||
|
||||
LICENSE="BSD"
|
||||
SLOT="0/4" # libcapstone.so.4
|
||||
KEYWORDS="~amd64 ~arm ~arm64 ~x86"
|
||||
#keep python flag for compatibility with Gentoo
|
||||
IUSE="python test"
|
||||
|
||||
PDEPEND=">=dev-libs/capstone-bindings-${PV}[python?]"
|
||||
RDEPEND=""
|
||||
DEPEND="${RDEPEND}"
|
||||
|
||||
PATCHES=(
|
||||
"${FILESDIR}"/${PN}-4.0-cmake.patch
|
||||
"${FILESDIR}"/${PN}-4.0-FLAGS.patch
|
||||
"${FILESDIR}"/${PN}-4.0-no-fuzz-tests.patch
|
||||
)
|
||||
|
||||
src_configure() {
|
||||
if ! use test; then
|
||||
# Don't build tests if not requested: bug #663006
|
||||
sed -i tests/Makefile -e 's@all: $(BINARY)@all:@' || die
|
||||
fi
|
||||
cmake-utils_src_configure
|
||||
}
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
Drop -O3 and allow user to specify their optimizations.
|
||||
|
||||
--- a/cstool/Makefile
|
||||
+++ b/cstool/Makefile
|
||||
@@ -1,13 +1,14 @@
|
||||
# Makefile for Cstool of Capstone Disassembly Engine
|
||||
|
||||
include ../functions.mk
|
||||
+include ../config.mk
|
||||
|
||||
.PHONY: clean all
|
||||
|
||||
LIBNAME = capstone
|
||||
|
||||
CFLAGS += -I../include -I.
|
||||
-LDFLAGS += -O3 -Wall -L.. -l$(LIBNAME)
|
||||
+LDFLAGS += -Wall -L.. -l$(LIBNAME)
|
||||
|
||||
TARGET = cstool
|
||||
SOURCES := $(wildcard *.c)
|
||||
|
|
@ -1,27 +0,0 @@
|
|||
--- a/CMakeLists.txt.orig 2019-01-10 21:45:56.000000000 +0800
|
||||
+++ b/CMakeLists.txt 2019-02-19 21:56:11.651398683 +0800
|
||||
@@ -576,15 +576,9 @@
|
||||
source_group("Include\\EVM" FILES ${HEADERS_EVM})
|
||||
|
||||
### test library 64bit routine:
|
||||
-get_property(LIB64 GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS)
|
||||
+include("GNUInstallDirs")
|
||||
|
||||
-if (NOT APPLE AND "${LIB64}" STREQUAL "TRUE")
|
||||
- set(LIBSUFFIX 64)
|
||||
-else()
|
||||
- set(LIBSUFFIX "")
|
||||
-endif()
|
||||
-
|
||||
-set(INSTALL_LIB_DIR lib${LIBSUFFIX} CACHE PATH "Installation directory for libraries")
|
||||
+set(INSTALL_LIB_DIR ${CMAKE_INSTALL_LIBDIR} CACHE PATH "Installation directory for libraries")
|
||||
mark_as_advanced(INSTALL_LIB_DIR)
|
||||
|
||||
## installation
|
||||
@@ -611,5 +605,5 @@
|
||||
target_link_libraries(cstool ${default-target})
|
||||
|
||||
install(TARGETS cstool DESTINATION bin)
|
||||
-install(FILES ${CMAKE_BINARY_DIR}/capstone.pc DESTINATION lib/pkgconfig)
|
||||
+install(FILES ${CMAKE_BINARY_DIR}/capstone.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
|
||||
endif ()
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
https://github.com/aquynh/capstone/issues/1310
|
||||
|
||||
fuzz tests are missing
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -463,3 +463,3 @@ TESTS += test_systemz.static test_x86.static test_xcore.static test_m680x.static
|
||||
TESTS += test_skipdata test_skipdata.static test_iter.static test_evm.static
|
||||
-check: $(TESTS) fuzztest fuzzallcorp
|
||||
+check: $(TESTS) fuzztest # fuzzallcorp
|
||||
test_%:
|
||||
|
|
@ -16,6 +16,7 @@ SLOT="0"
|
|||
KEYWORDS="~amd64 ~x86"
|
||||
IUSE="test"
|
||||
|
||||
RDEPEND="dev-libs/capstone-bindings[python,${PYTHON_USEDEP}]"
|
||||
RDEPEND="dev-libs/capstone[python,${PYTHON_USEDEP}]
|
||||
!dev-libs/capstone-bindings"
|
||||
DEPEND="${RDEPEND}
|
||||
dev-python/setuptools[${PYTHON_USEDEP}]"
|
||||
|
|
@ -24,7 +24,8 @@ fi
|
|||
LICENSE="GPL-3"
|
||||
SLOT="0"
|
||||
|
||||
DEPEND="dev-libs/capstone-bindings[python,${PYTHON_USEDEP}]
|
||||
DEPEND="dev-libs/capstone[python,${PYTHON_USEDEP}]
|
||||
!dev-libs/capstone-bindings
|
||||
dev-libs/keystone
|
||||
dev-python/pyelftools[${PYTHON_USEDEP}]
|
||||
dev-python/future[${PYTHON_USEDEP}]
|
||||
|
|
@ -39,7 +39,8 @@ RDEPEND="${PYTHON_DEPS}
|
|||
>=dev-python/libarchive-c-2.1[${PYTHON_USEDEP}]
|
||||
>=dev-python/python-magic-0.4.8[${PYTHON_USEDEP}]
|
||||
dev-python/pefile[${PYTHON_USEDEP}]
|
||||
dev-libs/capstone-bindings[python,${PYTHON_USEDEP}]
|
||||
dev-libs/capstone[python,${PYTHON_USEDEP}]
|
||||
!dev-libs/capstone-bindings
|
||||
dev-python/hyperframe[${PYTHON_USEDEP}]
|
||||
dev-python/hyper-h2[${PYTHON_USEDEP}]
|
||||
net-analyzer/scapy[${PYTHON_USEDEP}]
|
||||
|
|
@ -108,3 +108,5 @@ sys-boot/grub-static
|
|||
|
||||
#https://github.com/pentoo/pentoo-overlay/issues/484
|
||||
net-misc/seafile-server
|
||||
|
||||
dev-libs/capstone-bindings
|
||||
|
|
|
|||
|
|
@ -31,7 +31,8 @@ SLOT="0"
|
|||
IUSE="doc"
|
||||
|
||||
RDEPEND="
|
||||
dev-libs/capstone-bindings[python,${PYTHON_USEDEP}]
|
||||
dev-libs/capstone[python,${PYTHON_USEDEP}]
|
||||
!dev-libs/capstone-bindings
|
||||
dev-libs/keystone[python,${PYTHON_USEDEP}]
|
||||
dev-python/pylint[${PYTHON_USEDEP}]
|
||||
dev-util/unicorn[python,unicorn_targets_x86(+),${PYTHON_USEDEP}]
|
||||
|
|
|
|||
|
|
@ -33,7 +33,8 @@ SLOT="0"
|
|||
CDEPEND="${PYTHON_DEPS}"
|
||||
RDEPEND="${CDEPEND}
|
||||
app-exploits/ROPgadget
|
||||
dev-libs/capstone-bindings[python,${PYTHON_USEDEP}]
|
||||
dev-libs/capstone[python,${PYTHON_USEDEP}]
|
||||
!dev-libs/capstone-bindings
|
||||
dev-python/future[${PYTHON_USEDEP}]
|
||||
dev-python/six[${PYTHON_USEDEP}]
|
||||
dev-python/psutil[${PYTHON_USEDEP}]
|
||||
|
|
|
|||
|
|
@ -27,7 +27,8 @@ LICENSE="BSD"
|
|||
SLOT="0"
|
||||
|
||||
RDEPEND="${PYTHON_DEPS}
|
||||
dev-libs/capstone-bindings[python,${PYTHON_USEDEP}]
|
||||
dev-libs/capstone[python,${PYTHON_USEDEP}]
|
||||
!dev-libs/capstone-bindings
|
||||
dev-libs/keystone[python,${PYTHON_USEDEP}]
|
||||
dev-python/filebytes[${PYTHON_USEDEP}]"
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue