Gentoo Archives: gentoo-commits

From: Jason Donenfeld <zx2c4@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-devel/sparse/files/, sys-devel/sparse/
Date: Wed, 14 Feb 2018 16:15:03
Message-Id: 1518611823.ae3c38350efab149e32d974d8642891f69f375a3.zx2c4@gentoo
1 commit: ae3c38350efab149e32d974d8642891f69f375a3
2 Author: Jason A. Donenfeld <zx2c4 <AT> gentoo <DOT> org>
3 AuthorDate: Wed Feb 14 12:32:43 2018 +0000
4 Commit: Jason Donenfeld <zx2c4 <AT> gentoo <DOT> org>
5 CommitDate: Wed Feb 14 12:37:03 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ae3c3835
7
8 sys-devel/sparse: modernize
9
10 Package-Manager: Portage-2.3.24, Repoman-2.3.6
11
12 sys-devel/sparse/Manifest | 4 +-
13 sys-devel/sparse/files/sparse-0.4.3-gentoo.patch | 49 ----------------
14 .../files/sparse-0.5.1-cmdline-include.patch | 66 ++++++++++++++++++++++
15 sys-devel/sparse/metadata.xml | 4 ++
16 sys-devel/sparse/sparse-0.4.3.ebuild | 64 ---------------------
17 sys-devel/sparse/sparse-0.4.4.ebuild | 46 ---------------
18 .../{sparse-0.5.0.ebuild => sparse-0.5.1.ebuild} | 22 ++++----
19 sys-devel/sparse/sparse-9999.ebuild | 22 ++++----
20 8 files changed, 93 insertions(+), 184 deletions(-)
21
22 diff --git a/sys-devel/sparse/Manifest b/sys-devel/sparse/Manifest
23 index e0c8eb16025..089768e1271 100644
24 --- a/sys-devel/sparse/Manifest
25 +++ b/sys-devel/sparse/Manifest
26 @@ -1,3 +1 @@
27 -DIST sparse-0.4.3.tar.bz2 172431 BLAKE2B 06864e372e676a5f0426612774f1df2d224e8e6a12b8f7edf7056225b19725e876196c12e4c92a9a2b64eb410c8a840f777b4df2ffb9945079f4903562fb0633 SHA512 ff3dbd3e28b1a95dc9d6abf9a4ffdfaa0f470047b8232bd50930839432ae66a2249adb861c880e8eef1a906b007fd7d1c1ef8683c48c763eb523aedc9e1df631
28 -DIST sparse-0.4.4.tar.bz2 174074 BLAKE2B d57c5ec6f837ef1fa8992b5ec21f467583888d9ac3b7699a73e6b8fa80046253cdc554a4c685c2d98474a18fee6fca26fa004d3afa74b18c8f58b05a2900d589 SHA512 5cd5e660ea863170e86f1abaa040434c43a5cc7e92560f1bcbcce9ce906ae7355c066168bfc1dcc551e41e4c0f864122be288ed69eb1c4cda8b7c0825b5b647f
29 -DIST sparse-0.5.0.tar.xz 187576 BLAKE2B c525ce2a11143cd2dbeaff3e8cb1eb66b1792a678946ce001f76ac9882cd54cce4d4c5ff740c12e0e54ca91a6a2dc57bc7682ff8653333014fcc382e662ba596 SHA512 0cb70a74034c4bc4d5340ab7d19288a438f4b6d0c4c63ac95d1f4cc3c5fdfe1370a27a607605a6f0c85ea6f371141c55abfdb4438d9e87b2d544fff5674f7ce4
30 +DIST sparse-0.5.1.tar.gz 278241 BLAKE2B 6004631c97e2a126d1e239aa1d8fcc540a92b3f63a6a2615f2f63b79a001495e8b27ffa7377c57b43227f3b50288be24cb4657c7801806f7c6d1d11b0f8c8ee9 SHA512 04a26e2b44d99e7402b5e8a8f61ecbd62adbc9c481a0c3c8e0ab2f9599d99f50679ce3f3d0c1ccfd6204c6ec5d9fa272f9fc4c4d21173897ebd592d14c6ee852
31
32 diff --git a/sys-devel/sparse/files/sparse-0.4.3-gentoo.patch b/sys-devel/sparse/files/sparse-0.4.3-gentoo.patch
33 deleted file mode 100644
34 index 6f46687d78b..00000000000
35 --- a/sys-devel/sparse/files/sparse-0.4.3-gentoo.patch
36 +++ /dev/null
37 @@ -1,49 +0,0 @@
38 -diff --git a/Makefile b/Makefile
39 -index 74905df..1f2b2b6 100644
40 ---- a/Makefile
41 -+++ b/Makefile
42 -@@ -4,7 +4,7 @@ OS = linux
43 -
44 -
45 - CC = gcc
46 --CFLAGS = -O2 -finline-functions -fno-strict-aliasing -g
47 -+CFLAGS ?= -O2 -finline-functions -fno-strict-aliasing -g
48 - CFLAGS += -Wall -Wwrite-strings
49 - LDFLAGS += -g
50 - AR = ar
51 -@@ -21,7 +21,8 @@ HAVE_GCC_DEP:=$(shell touch .gcc-test.c && \
52 - echo 'yes'; rm -f .gcc-test.d .gcc-test.o .gcc-test.c)
53 - HAVE_GTK2:=$(shell pkg-config --exists gtk+-2.0 2>/dev/null && echo 'yes')
54 -
55 --CFLAGS += -DGCC_BASE=\"$(shell $(CC) --print-file-name=)\"
56 -+GCC_BASE = $(shell $(CC) --print-file-name=)
57 -+CFLAGS += -DGCC_BASE=\"$(GCC_BASE)\"
58 -
59 - ifeq ($(HAVE_GCC_DEP),yes)
60 - CFLAGS += -Wp,-MD,$(@D)/.$(@F).d
61 -@@ -113,7 +114,9 @@ SED_PC_CMD = 's|@version@|$(VERSION)|g; \
62 -
63 - all: $(PROGRAMS) sparse.pc
64 -
65 --install: $(INST_PROGRAMS) $(LIBS) $(LIB_H) sparse.pc
66 -+all-installable: $(INST_PROGRAMS) $(LIBS) $(LIB_H) sparse.pc
67 -+
68 -+install: all-installable
69 - $(Q)install -d $(DESTDIR)$(BINDIR)
70 - $(Q)install -d $(DESTDIR)$(LIBDIR)
71 - $(Q)install -d $(DESTDIR)$(MAN1DIR)
72 -diff --git a/parse.h b/parse.h
73 -index 6b21e23..b26bd03 100644
74 ---- a/parse.h
75 -+++ b/parse.h
76 -@@ -35,10 +35,6 @@ struct statement {
77 - struct /* declaration */ {
78 - struct symbol_list *declaration;
79 - };
80 -- struct /* label_arg */ {
81 -- struct symbol *label;
82 -- struct statement *label_statement;
83 -- };
84 - struct {
85 - struct expression *expression;
86 - struct expression *context;
87
88 diff --git a/sys-devel/sparse/files/sparse-0.5.1-cmdline-include.patch b/sys-devel/sparse/files/sparse-0.5.1-cmdline-include.patch
89 new file mode 100644
90 index 00000000000..5ea763001a0
91 --- /dev/null
92 +++ b/sys-devel/sparse/files/sparse-0.5.1-cmdline-include.patch
93 @@ -0,0 +1,66 @@
94 +diff --git a/validation/include-eval.c b/validation/include-eval.c
95 +new file mode 100644
96 +index 000000000..bf9bf63fe
97 +--- /dev/null
98 ++++ b/validation/include-eval.c
99 +@@ -0,0 +1,7 @@
100 ++/* nothing */
101 ++
102 ++/*
103 ++ * check-name: include-eval.c
104 ++ * check-command: sparse -include ./include-eval.inc $file
105 ++ * check-known-to-fail
106 ++ */
107 +diff --git a/validation/include-eval.inc b/validation/include-eval.inc
108 +new file mode 100644
109 +index 000000000..e2561ca41
110 +--- /dev/null
111 ++++ b/validation/include-eval.inc
112 +@@ -0,0 +1,12 @@
113 ++typedef unsigned long long_t;
114 ++
115 ++inline
116 ++static unsigned int ok(void)
117 ++{
118 ++ return sizeof(long_t);
119 ++}
120 ++
121 ++static unsigned int ko(void)
122 ++{
123 ++ return sizeof(long_t);
124 ++}
125 +diff --git a/lib.c b/lib.c
126 +index 4602cf85d..b255fec14 100644
127 +--- a/lib.c
128 ++++ b/lib.c
129 +@@ -1351,6 +1351,20 @@ struct symbol_list *sparse_initialize(int argc, char **argv, struct string_list
130 + */
131 + protect_token_alloc();
132 + }
133 ++ /*
134 ++ * Evaluate the complete symbol list
135 ++ * Note: This is not needed for normal cases.
136 ++ * These symbols should only be predefined defines and
137 ++ * declaratons which will be evaluated later, when needed.
138 ++ * This is also the case when a file is directly included via
139 ++ * '-include <file>' on the command line *AND* the file only
140 ++ * contains defines, declarations and inline definitions.
141 ++ * However, in the rare cases where the given file should
142 ++ * contain some definitions, these will never be evaluated
143 ++ * and thus won't be able to be linearized correctly.
144 ++ * Hence the evaluate_symbol_list() here under.
145 ++ */
146 ++ evaluate_symbol_list(list);
147 + return list;
148 + }
149 +
150 +diff --git a/validation/include-eval.c b/validation/include-eval.c
151 +index bf9bf63fe..1a91dab84 100644
152 +--- a/validation/include-eval.c
153 ++++ b/validation/include-eval.c
154 +@@ -3,5 +3,4 @@
155 + /*
156 + * check-name: include-eval.c
157 + * check-command: sparse -include ./include-eval.inc $file
158 +- * check-known-to-fail
159 + */
160
161 diff --git a/sys-devel/sparse/metadata.xml b/sys-devel/sparse/metadata.xml
162 index 58fef00ea44..ee8e0692a0c 100644
163 --- a/sys-devel/sparse/metadata.xml
164 +++ b/sys-devel/sparse/metadata.xml
165 @@ -1,6 +1,10 @@
166 <?xml version="1.0" encoding="UTF-8"?>
167 <!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
168 <pkgmetadata>
169 + <maintainer type="person">
170 + <email>zx2c4@g.o</email>
171 + <name>Jason A. Donenfeld</name>
172 + </maintainer>
173 <maintainer type="project">
174 <email>toolchain@g.o</email>
175 <name>Gentoo Toolchain Project</name>
176
177 diff --git a/sys-devel/sparse/sparse-0.4.3.ebuild b/sys-devel/sparse/sparse-0.4.3.ebuild
178 deleted file mode 100644
179 index c351211de29..00000000000
180 --- a/sys-devel/sparse/sparse-0.4.3.ebuild
181 +++ /dev/null
182 @@ -1,64 +0,0 @@
183 -# Copyright 1999-2015 Gentoo Foundation
184 -# Distributed under the terms of the GNU General Public License v2
185 -
186 -EAPI="2"
187 -
188 -inherit eutils multilib flag-o-matic toolchain-funcs
189 -if [[ ${PV} == "9999" ]] ; then
190 - EGIT_REPO_URI="git://git.kernel.org/pub/scm/devel/sparse/sparse.git"
191 - inherit git
192 -fi
193 -
194 -DESCRIPTION="C semantic parser"
195 -HOMEPAGE="https://sparse.wiki.kernel.org/index.php/Main_Page"
196 -
197 -if [[ ${PV} == "9999" ]] ; then
198 - SRC_URI=""
199 - #KEYWORDS=""
200 -else
201 - SRC_URI="mirror://kernel/software/devel/sparse/dist/${P}.tar.bz2"
202 - KEYWORDS="amd64 arm hppa ia64 ppc ppc64 s390 sh sparc x86"
203 -fi
204 -
205 -LICENSE="OSL-1.1"
206 -SLOT="0"
207 -IUSE="gtk xml test"
208 -
209 -RDEPEND="gtk? ( x11-libs/gtk+:2 )
210 - xml? ( dev-libs/libxml2 )"
211 -DEPEND="${RDEPEND}
212 - gtk? ( virtual/pkgconfig )
213 - xml? ( virtual/pkgconfig )"
214 -
215 -src_prepare() {
216 - # https://cgit.gentoo.org/proj/sparse.git
217 - epatch "${FILESDIR}"/${P}-gentoo.patch
218 -}
219 -
220 -mymake() {
221 - usex() { use $1 && echo ${2:-yes} || echo ${3:-no} ; }
222 -
223 - emake \
224 - V=1 \
225 - CC="$(tc-getCC)" \
226 - GCC_BASE="$(gcc-config -L | cut -d : -f1)" \
227 - HAVE_LIBXML=$(usex xml) \
228 - HAVE_GTK2=$(usex gtk) \
229 - PREFIX=/usr \
230 - LIBDIR="/usr/$(get_libdir)" \
231 - DESTDIR="${D}" \
232 - "$@" \
233 - || die
234 -}
235 -
236 -src_compile() {
237 - append-flags -fno-strict-aliasing
238 -
239 - mymake \
240 - $(use test && echo all) all-installable
241 -}
242 -
243 -src_install() {
244 - mymake install
245 - dodoc FAQ README
246 -}
247
248 diff --git a/sys-devel/sparse/sparse-0.4.4.ebuild b/sys-devel/sparse/sparse-0.4.4.ebuild
249 deleted file mode 100644
250 index 51173588d3c..00000000000
251 --- a/sys-devel/sparse/sparse-0.4.4.ebuild
252 +++ /dev/null
253 @@ -1,46 +0,0 @@
254 -# Copyright 1999-2013 Gentoo Foundation
255 -# Distributed under the terms of the GNU General Public License v2
256 -
257 -EAPI="4"
258 -
259 -inherit eutils multilib toolchain-funcs
260 -if [[ ${PV} == "9999" ]] ; then
261 - EGIT_REPO_URI="git://git.kernel.org/pub/scm/devel/sparse/sparse.git"
262 - inherit git-2
263 -fi
264 -
265 -DESCRIPTION="C semantic parser"
266 -HOMEPAGE="https://sparse.wiki.kernel.org/index.php/Main_Page"
267 -
268 -if [[ ${PV} == "9999" ]] ; then
269 - SRC_URI=""
270 - #KEYWORDS=""
271 -else
272 - SRC_URI="mirror://kernel/software/devel/sparse/dist/${P}.tar.bz2"
273 - KEYWORDS="~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
274 -fi
275 -
276 -LICENSE="OSL-1.1"
277 -SLOT="0"
278 -IUSE="gtk test xml"
279 -
280 -RDEPEND="gtk? ( x11-libs/gtk+:2 )
281 - xml? ( dev-libs/libxml2 )"
282 -DEPEND="${RDEPEND}
283 - gtk? ( virtual/pkgconfig )
284 - xml? ( virtual/pkgconfig )"
285 -
286 -src_prepare() {
287 - tc-export AR CC PKG_CONFIG
288 - sed -i \
289 - -e '/^PREFIX=/s:=.*:=/usr:' \
290 - -e "/^LIBDIR=/s:/lib:/$(get_libdir):" \
291 - -e '/^CFLAGS =/{s:=:+= $(CPPFLAGS):;s:-O2 -finline-functions::}' \
292 - -e "s:pkg-config:${PKG_CONFIG}:" \
293 - Makefile || die
294 - export MAKEOPTS+=" V=1 AR=${AR} CC=${CC} HAVE_GTK2=$(usex gtk) HAVE_LIBXML=$(usex xml)"
295 -}
296 -
297 -src_compile() {
298 - emake $(usex test all all-installable)
299 -}
300
301 diff --git a/sys-devel/sparse/sparse-0.5.0.ebuild b/sys-devel/sparse/sparse-0.5.1.ebuild
302 similarity index 67%
303 rename from sys-devel/sparse/sparse-0.5.0.ebuild
304 rename to sys-devel/sparse/sparse-0.5.1.ebuild
305 index 8771de72828..aad07d85db7 100644
306 --- a/sys-devel/sparse/sparse-0.5.0.ebuild
307 +++ b/sys-devel/sparse/sparse-0.5.1.ebuild
308 @@ -1,26 +1,23 @@
309 -# Copyright 1999-2014 Gentoo Foundation
310 +# Copyright 1999-2018 Gentoo Foundation
311 # Distributed under the terms of the GNU General Public License v2
312
313 -EAPI="4"
314 +EAPI=6
315
316 inherit eutils multilib toolchain-funcs
317 -if [[ ${PV} == "9999" ]] ; then
318 - EGIT_REPO_URI="git://git.kernel.org/pub/scm/devel/sparse/sparse.git"
319 - inherit git-2
320 -fi
321
322 DESCRIPTION="C semantic parser"
323 HOMEPAGE="https://sparse.wiki.kernel.org/index.php/Main_Page"
324
325 if [[ ${PV} == "9999" ]] ; then
326 - SRC_URI=""
327 - #KEYWORDS=""
328 + inherit git-r3
329 + EGIT_REPO_URI="https://git.kernel.org/pub/scm/devel/${PN}/${PN}.git"
330 + KEYWORDS=""
331 else
332 - SRC_URI="mirror://kernel/software/devel/sparse/dist/${P}.tar.xz"
333 + SRC_URI="https://git.kernel.org/pub/scm/devel/${PN}/${PN}.git/snapshot/${P}.tar.gz"
334 KEYWORDS="~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
335 fi
336
337 -LICENSE="OSL-1.1"
338 +LICENSE="MIT"
339 SLOT="0"
340 IUSE="gtk llvm test xml"
341
342 @@ -31,15 +28,18 @@ DEPEND="${RDEPEND}
343 gtk? ( virtual/pkgconfig )
344 xml? ( virtual/pkgconfig )"
345
346 +PATCHES=( "${FILESDIR}/${PN}-0.5.1-cmdline-include.patch" )
347 +
348 src_prepare() {
349 tc-export AR CC PKG_CONFIG
350 sed -i \
351 -e '/^PREFIX=/s:=.*:=/usr:' \
352 -e "/^LIBDIR=/s:/lib:/$(get_libdir):" \
353 - -e '/^CFLAGS =/{s:=:+= $(CPPFLAGS):;s:-O2 -finline-functions::}' \
354 + -e '/^COMMON_CFLAGS =/{s:=:= $(CPPFLAGS):;s:-O2 -finline-functions -fno-strict-aliasing -g:-fno-strict-aliasing:}' \
355 -e "s:pkg-config:${PKG_CONFIG}:" \
356 Makefile || die
357 export MAKEOPTS+=" V=1 AR=${AR} CC=${CC} HAVE_GTK2=$(usex gtk) HAVE_LLVM=$(usex llvm) HAVE_LIBXML=$(usex xml)"
358 + default
359 }
360
361 src_compile() {
362
363 diff --git a/sys-devel/sparse/sparse-9999.ebuild b/sys-devel/sparse/sparse-9999.ebuild
364 index 8771de72828..aad07d85db7 100644
365 --- a/sys-devel/sparse/sparse-9999.ebuild
366 +++ b/sys-devel/sparse/sparse-9999.ebuild
367 @@ -1,26 +1,23 @@
368 -# Copyright 1999-2014 Gentoo Foundation
369 +# Copyright 1999-2018 Gentoo Foundation
370 # Distributed under the terms of the GNU General Public License v2
371
372 -EAPI="4"
373 +EAPI=6
374
375 inherit eutils multilib toolchain-funcs
376 -if [[ ${PV} == "9999" ]] ; then
377 - EGIT_REPO_URI="git://git.kernel.org/pub/scm/devel/sparse/sparse.git"
378 - inherit git-2
379 -fi
380
381 DESCRIPTION="C semantic parser"
382 HOMEPAGE="https://sparse.wiki.kernel.org/index.php/Main_Page"
383
384 if [[ ${PV} == "9999" ]] ; then
385 - SRC_URI=""
386 - #KEYWORDS=""
387 + inherit git-r3
388 + EGIT_REPO_URI="https://git.kernel.org/pub/scm/devel/${PN}/${PN}.git"
389 + KEYWORDS=""
390 else
391 - SRC_URI="mirror://kernel/software/devel/sparse/dist/${P}.tar.xz"
392 + SRC_URI="https://git.kernel.org/pub/scm/devel/${PN}/${PN}.git/snapshot/${P}.tar.gz"
393 KEYWORDS="~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
394 fi
395
396 -LICENSE="OSL-1.1"
397 +LICENSE="MIT"
398 SLOT="0"
399 IUSE="gtk llvm test xml"
400
401 @@ -31,15 +28,18 @@ DEPEND="${RDEPEND}
402 gtk? ( virtual/pkgconfig )
403 xml? ( virtual/pkgconfig )"
404
405 +PATCHES=( "${FILESDIR}/${PN}-0.5.1-cmdline-include.patch" )
406 +
407 src_prepare() {
408 tc-export AR CC PKG_CONFIG
409 sed -i \
410 -e '/^PREFIX=/s:=.*:=/usr:' \
411 -e "/^LIBDIR=/s:/lib:/$(get_libdir):" \
412 - -e '/^CFLAGS =/{s:=:+= $(CPPFLAGS):;s:-O2 -finline-functions::}' \
413 + -e '/^COMMON_CFLAGS =/{s:=:= $(CPPFLAGS):;s:-O2 -finline-functions -fno-strict-aliasing -g:-fno-strict-aliasing:}' \
414 -e "s:pkg-config:${PKG_CONFIG}:" \
415 Makefile || die
416 export MAKEOPTS+=" V=1 AR=${AR} CC=${CC} HAVE_GTK2=$(usex gtk) HAVE_LLVM=$(usex llvm) HAVE_LIBXML=$(usex xml)"
417 + default
418 }
419
420 src_compile() {