Gentoo Archives: gentoo-commits

From: Sergei Trofimovich <slyfox@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-libs/capstone/, dev-libs/capstone/files/
Date: Wed, 19 Dec 2018 07:22:26
Message-Id: 1545204124.e477d6aca1b5848044ed2f72fe6d78e7f5b966cd.slyfox@gentoo
1 commit: e477d6aca1b5848044ed2f72fe6d78e7f5b966cd
2 Author: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
3 AuthorDate: Wed Dec 19 00:37:36 2018 +0000
4 Commit: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
5 CommitDate: Wed Dec 19 07:22:04 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e477d6ac
7
8 dev-libs/capstone: bump up to 4.0
9
10 Package-Manager: Portage-2.3.52, Repoman-2.3.12
11 Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org>
12
13 dev-libs/capstone/Manifest | 1 +
14 dev-libs/capstone/capstone-4.0.ebuild | 85 ++++++++++++++++++++++
15 dev-libs/capstone/files/capstone-4.0-FLAGS.patch | 20 +++++
16 .../files/capstone-4.0-double-DESTDIR.patch | 12 +++
17 .../files/capstone-4.0-no-fuzz-tests.patch | 10 +++
18 5 files changed, 128 insertions(+)
19
20 diff --git a/dev-libs/capstone/Manifest b/dev-libs/capstone/Manifest
21 index 4832b61e74a..f3ffa497b09 100644
22 --- a/dev-libs/capstone/Manifest
23 +++ b/dev-libs/capstone/Manifest
24 @@ -1 +1,2 @@
25 DIST capstone-3.0.5_rc2.tar.gz 2829338 BLAKE2B dd35fc6c31ec008f78840410ea0d20de56ea8f01c3af1d28488beaceee7fa06ce03c8cd0f56d834eb738d23f528d240693586122b9c1e353365f7348fb6f8362 SHA512 31bafdb0b3183d0c054a4244cc135db9a3c3dc5cb2e2af706bfede0d53cca8cba81d74b74ef9a4adbfd6c79cc408864dd80b8203791e17bd6c98bb69ea4f6894
26 +DIST capstone-4.0.tar.gz 3411532 BLAKE2B 3e60a946e81f6d6ea88c314ad066e1855e2401cd9e8e61a67d48071b0fe4b705b2276b0d2b52d0979f472895a69cbe7609f6a2c60b79be668730f41ea98bf92e SHA512 5a10c67e88b246ad905364c62c56b4741df242c22f1b62bdea171e4d1d43e484f42f30b33e17324be6cff4c6fb10365528a9c3f4b2a5339ad24b0564fdd40bdb
27
28 diff --git a/dev-libs/capstone/capstone-4.0.ebuild b/dev-libs/capstone/capstone-4.0.ebuild
29 new file mode 100644
30 index 00000000000..78213838489
31 --- /dev/null
32 +++ b/dev-libs/capstone/capstone-4.0.ebuild
33 @@ -0,0 +1,85 @@
34 +# Copyright 1999-2018 Gentoo Authors
35 +# Distributed under the terms of the GNU General Public License v2
36 +
37 +EAPI=7
38 +
39 +DISTUTILS_OPTIONAL=1
40 +PYTHON_COMPAT=( python{2_7,3_4,3_5,3_6} )
41 +
42 +inherit distutils-r1 toolchain-funcs
43 +
44 +DESCRIPTION="disassembly/disassembler framework + bindings"
45 +HOMEPAGE="http://www.capstone-engine.org/"
46 +SRC_URI="https://github.com/aquynh/${PN}/archive/${PV/_rc/-rc}.tar.gz -> ${P}.tar.gz"
47 +
48 +LICENSE="BSD"
49 +SLOT="0/4" # libcapstone.so.4
50 +KEYWORDS="~amd64 ~arm ~arm64 ~x86"
51 +
52 +IUSE="python"
53 +RDEPEND="python? ( ${PYTHON_DEPS} )"
54 +DEPEND="${RDEPEND}
55 + python? ( dev-python/setuptools[${PYTHON_USEDEP}] )
56 +"
57 +REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
58 +
59 +PATCHES=(
60 + "${FILESDIR}"/${P}-FLAGS.patch
61 + "${FILESDIR}"/${P}-no-fuzz-tests.patch
62 + "${FILESDIR}"/${P}-double-DESTDIR.patch
63 +)
64 +
65 +S=${WORKDIR}/${P/_rc/-rc}
66 +
67 +wrap_python() {
68 + if use python; then
69 + pushd bindings/python >/dev/null || die
70 + distutils-r1_${1} "$@"
71 + popd >/dev/null
72 + fi
73 +}
74 +
75 +src_prepare() {
76 + default
77 +
78 + wrap_python ${FUNCNAME}
79 +}
80 +
81 +src_configure() {
82 + {
83 + cat <<-EOF
84 + # Gentoo overrides:
85 + # verbose build
86 + V = 1
87 + # toolchain
88 + AR = $(tc-getAR)
89 + CC = $(tc-getCC)
90 + RANLIB = $(tc-getRANLIB)
91 + # toolchain flags
92 + CFLAGS = ${CFLAGS}
93 + LDFLAGS = ${LDFLAGS}
94 + # libs
95 + LIBDIRARCH = $(get_libdir)
96 + EOF
97 + } >> config.mk || die
98 +
99 + wrap_python ${FUNCNAME}
100 +}
101 +
102 +src_compile() {
103 + default
104 +
105 + wrap_python ${FUNCNAME}
106 +}
107 +
108 +src_test() {
109 + default
110 +
111 + wrap_python ${FUNCNAME}
112 +}
113 +
114 +src_install() {
115 + default
116 +
117 + wrap_python ${FUNCNAME}
118 +}
119
120 diff --git a/dev-libs/capstone/files/capstone-4.0-FLAGS.patch b/dev-libs/capstone/files/capstone-4.0-FLAGS.patch
121 new file mode 100644
122 index 00000000000..66e855c0c34
123 --- /dev/null
124 +++ b/dev-libs/capstone/files/capstone-4.0-FLAGS.patch
125 @@ -0,0 +1,20 @@
126 +Drop -O3 and allow user to specify their optimizations.
127 +
128 +--- a/cstool/Makefile
129 ++++ b/cstool/Makefile
130 +@@ -1,13 +1,14 @@
131 + # Makefile for Cstool of Capstone Disassembly Engine
132 +
133 + include ../functions.mk
134 ++include ../config.mk
135 +
136 + .PHONY: clean all
137 +
138 + LIBNAME = capstone
139 +
140 + CFLAGS += -I../include -I.
141 +-LDFLAGS += -O3 -Wall -L.. -l$(LIBNAME)
142 ++LDFLAGS += -Wall -L.. -l$(LIBNAME)
143 +
144 + TARGET = cstool
145 + SOURCES := $(wildcard *.c)
146
147 diff --git a/dev-libs/capstone/files/capstone-4.0-double-DESTDIR.patch b/dev-libs/capstone/files/capstone-4.0-double-DESTDIR.patch
148 new file mode 100644
149 index 00000000000..46aca725e40
150 --- /dev/null
151 +++ b/dev-libs/capstone/files/capstone-4.0-double-DESTDIR.patch
152 @@ -0,0 +1,12 @@
153 +https://github.com/aquynh/capstone/issues/1311
154 +
155 +Avoid double DESTDIR in install.
156 +--- a/Makefile
157 ++++ b/Makefile
158 +@@ -75,4 +75,4 @@ LIBDIRARCH ?= lib
159 + #LIBDIRARCH ?= lib64
160 +-LIBDIR = $(DESTDIR)$(PREFIX)/$(LIBDIRARCH)
161 +-BINDIR = $(DESTDIR)$(PREFIX)/bin
162 ++LIBDIR = $(PREFIX)/$(LIBDIRARCH)
163 ++BINDIR = $(PREFIX)/bin
164 +
165
166 diff --git a/dev-libs/capstone/files/capstone-4.0-no-fuzz-tests.patch b/dev-libs/capstone/files/capstone-4.0-no-fuzz-tests.patch
167 new file mode 100644
168 index 00000000000..ae412e9b233
169 --- /dev/null
170 +++ b/dev-libs/capstone/files/capstone-4.0-no-fuzz-tests.patch
171 @@ -0,0 +1,10 @@
172 +https://github.com/aquynh/capstone/issues/1310
173 +
174 +fuzz tests are missing
175 +--- a/Makefile
176 ++++ b/Makefile
177 +@@ -463,3 +463,3 @@ TESTS += test_systemz.static test_x86.static test_xcore.static test_m680x.static
178 + TESTS += test_skipdata test_skipdata.static test_iter.static test_evm.static
179 +-check: $(TESTS) fuzztest fuzzallcorp
180 ++check: $(TESTS) fuzztest # fuzzallcorp
181 + test_%: