capstone: sync with Gentoo

This commit is contained in:
blshkv 2019-11-02 09:02:35 +08:00
parent 06f2a25572
commit 7dc2dc27da
No known key found for this signature in database
GPG key ID: 273E3E90D1A6294F
6 changed files with 65 additions and 26 deletions

View file

@ -6,6 +6,7 @@ EAPI=7
MY_PV="${PV//_/-}"
MY_P=capstone-"${MY_PV}"
DISTUTILS_OPTIONAL=1
PYTHON_COMPAT=( python2_7 python3_{4,5,6} )
inherit eutils multilib distutils-r1
@ -15,7 +16,7 @@ SRC_URI="https://github.com/aquynh/capstone/archive/${MY_PV}.tar.gz -> ${MY_P}.t
LICENSE="BSD"
SLOT="0"
KEYWORDS="~amd64 ~arm ~x86"
#TODO: add java and ocaml bindings, make python optional
#TODO: add java, ocaml, PowerShell, VB6, C#, Go, Ruby, NodeJS, C++ & Vala
IUSE="+python cython"
RDEPEND="python? ( ${PYTHON_DEPS} )

View file

@ -1,25 +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 ~x86"
IUSE="python"
PDEPEND="python? ( >=dev-libs/capstone-bindings-${PV} )"
RDEPEND=""
DEPEND="${RDEPEND}"
#TODO: add java and ocaml bindings
src_prepare() {
eapply ${FILESDIR}/capstone-cmake.patch
cmake-utils_src_prepare
}

View file

@ -0,0 +1,33 @@
# 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
}

View file

@ -0,0 +1,20 @@
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)

View file

@ -0,0 +1,10 @@
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_%: