1 |
commit: 9498391cdfe099fb51b68d5a0f68ef8be7476fb7 |
2 |
Author: Stephen Arnold <nerdboy <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu May 30 23:05:07 2019 +0000 |
4 |
Commit: Steve Arnold <nerdboy <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu May 30 23:05:07 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9498391c |
7 |
|
8 |
dev-util/cccc: rev-bump for eapi migration and QA cleanup |
9 |
|
10 |
* use EAPI 6, filter lto flags, clean up QA issues |
11 |
(restore fixed version from the trash) |
12 |
|
13 |
Bug: https://bugs.gentoo.org/651446 |
14 |
Package-Manager: Portage-2.3.64, Repoman-2.3.12 |
15 |
Signed-off-by: Steve Arnold <nerdboy <AT> gentoo.org> |
16 |
|
17 |
dev-util/cccc/Manifest | 1 + |
18 |
dev-util/cccc/cccc-3.1.5-r1.ebuild | 70 ++++++++++++++++++++++++++++ |
19 |
dev-util/cccc/files/cccc-MFC-dialect.opt | 21 +++++++++ |
20 |
dev-util/cccc/files/cccc-c_dialect.patch | 79 ++++++++++++++++++++++++++++++++ |
21 |
dev-util/cccc/metadata.xml | 19 ++++++++ |
22 |
5 files changed, 190 insertions(+) |
23 |
|
24 |
diff --git a/dev-util/cccc/Manifest b/dev-util/cccc/Manifest |
25 |
new file mode 100644 |
26 |
index 00000000000..887fa77c8cf |
27 |
--- /dev/null |
28 |
+++ b/dev-util/cccc/Manifest |
29 |
@@ -0,0 +1 @@ |
30 |
+DIST cccc-3.1.5.tar.gz 662760 BLAKE2B 57817ef9a44f002c017245d7dd3b1ef97fec59b59bce465d5e5e1cc12409b5602cfd8bf7ee938e526af9bcc11398639900d26848aa4f8c7f623669159de17117 SHA512 61544669a75ff7bd99c6ff5bb1e6ec163f2a09f4538493fe60e8f9f95eab7ba19ad6d39b6717ae010a223b8efe48c497a4feb8ead218e350ee2ab91b9c52c969 |
31 |
|
32 |
diff --git a/dev-util/cccc/cccc-3.1.5-r1.ebuild b/dev-util/cccc/cccc-3.1.5-r1.ebuild |
33 |
new file mode 100644 |
34 |
index 00000000000..a26523720d4 |
35 |
--- /dev/null |
36 |
+++ b/dev-util/cccc/cccc-3.1.5-r1.ebuild |
37 |
@@ -0,0 +1,70 @@ |
38 |
+# Copyright 1999-2019 Gentoo Authors |
39 |
+# Distributed under the terms of the GNU General Public License v2 |
40 |
+ |
41 |
+EAPI=6 |
42 |
+ |
43 |
+inherit eutils toolchain-funcs flag-o-matic |
44 |
+ |
45 |
+DESCRIPTION="Source metrics (line counts, complexity, etc) for Java and C++" |
46 |
+HOMEPAGE="http://sarnold.github.io/cccc/" |
47 |
+if [[ ${PV} = 9999* ]]; then |
48 |
+ EGIT_REPO_URI="https://github.com/sarnold/cccc.git" |
49 |
+ EGIT_BRANCH="master" |
50 |
+ inherit git-r3 |
51 |
+else |
52 |
+ SRC_URI="https://github.com/sarnold/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz" |
53 |
+fi |
54 |
+ |
55 |
+LICENSE="GPL-2" |
56 |
+SLOT="0" |
57 |
+KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~x86 ~amd64-linux ~x86-linux ~ppc-macos" |
58 |
+IUSE="apidoc debug doc mfc" |
59 |
+ |
60 |
+RDEPEND="" |
61 |
+DEPEND="${RDEPEND} |
62 |
+ apidoc? ( app-doc/doxygen[dot] ) |
63 |
+ " |
64 |
+ |
65 |
+src_prepare() { |
66 |
+ is-flagq -flto* && filter-flags -flto* -fuse-linker-plugin |
67 |
+ use mfc && eapply "${FILESDIR}"/${PN}-c_dialect.patch |
68 |
+ default |
69 |
+ |
70 |
+} |
71 |
+ |
72 |
+src_compile() { |
73 |
+ tc-export CC CXX LD AS AR NM RANLIB STRIP OBJCOPY |
74 |
+ if use debug ; then |
75 |
+ DEBUG="true" emake CCC=$(tc-getCXX) CC=$(tc-getCC) cccc |
76 |
+ else |
77 |
+ emake CCC=$(tc-getCXX) CC=$(tc-getCC) cccc |
78 |
+ fi |
79 |
+ |
80 |
+ use apidoc && emake CCC=$(tc-getCXX) metrics docs |
81 |
+} |
82 |
+ |
83 |
+src_test() { |
84 |
+ emake CCC=$(tc-getCXX) test |
85 |
+} |
86 |
+ |
87 |
+src_install() { |
88 |
+ dobin cccc/cccc |
89 |
+ |
90 |
+ dodoc README.md |
91 |
+ |
92 |
+ if use mfc ; then |
93 |
+ insinto /usr/share/doc/${PF} |
94 |
+ doins "${FILESDIR}"/cccc-MFC-dialect.opt |
95 |
+ fi |
96 |
+ |
97 |
+ if use doc ; then |
98 |
+ insinto /usr/share/doc/${PF}/html |
99 |
+ doins cccc/*.html || die "html docs failed" |
100 |
+ if use apidoc ; then |
101 |
+ insinto /usr/share/doc/${PF}/html/api |
102 |
+ doins -r doxygen/html/* || die "dox failed" |
103 |
+ insinto /usr/share/doc/${PF}/html/metrics |
104 |
+ doins ccccout/* || die "metrics failed" |
105 |
+ fi |
106 |
+ fi |
107 |
+} |
108 |
|
109 |
diff --git a/dev-util/cccc/files/cccc-MFC-dialect.opt b/dev-util/cccc/files/cccc-MFC-dialect.opt |
110 |
new file mode 100644 |
111 |
index 00000000000..4c4acb32e1f |
112 |
--- /dev/null |
113 |
+++ b/dev-util/cccc/files/cccc-MFC-dialect.opt |
114 |
@@ -0,0 +1,21 @@ |
115 |
+;;Pro*C embedded SQL |
116 |
+;; looks like |
117 |
+;; EXEC SQL UPDATE ARM43_OD_PRODUIT_SERV |
118 |
+;; SET ARM43ID_TPS_FIN = NULL WHERE |
119 |
+ARM43ID_TPS_FIN = 0; |
120 |
+ |
121 |
+CCCC_FileExt@.pc@c++.ansi@ |
122 |
+ |
123 |
+CCCC_Dialect@c++.pc@EXEC@skip_stmt@ |
124 |
+ |
125 |
+;;MFC |
126 |
+CCCC_Dialect@c++.mfc@ON_WM_PAINT@skip_line@ |
127 |
+CCCC_Dialect@c++.mfc@DECLARE_MESSAGE_MAP@skip_line@ |
128 |
+CCCC_Dialect@c++.mfc@DECLARE_DISPATCH_MAP@skip_line@ |
129 |
+ |
130 |
+CCCC_Dialect@c++.stl@__STL_BEGIN_NAMESPACE@ignore@ |
131 |
+CCCC_Dialect@c++.stl@__STL_END_NAMESPACE@ignore@ |
132 |
+ |
133 |
+CCCC_Dialect@c++.mfc@BEGIN_EVENT_MAP@start_skipping@ |
134 |
+CCCC_Dialect@c++.mfc@END_EVENT_MAP@stop_skipping@ |
135 |
+ |
136 |
|
137 |
diff --git a/dev-util/cccc/files/cccc-c_dialect.patch b/dev-util/cccc/files/cccc-c_dialect.patch |
138 |
new file mode 100644 |
139 |
index 00000000000..c8951aef13c |
140 |
--- /dev/null |
141 |
+++ b/dev-util/cccc/files/cccc-c_dialect.patch |
142 |
@@ -0,0 +1,79 @@ |
143 |
+diff --git a/cccc/cccc.g b/cccc/cccc.g |
144 |
+index bdb6805..fd7b504 100644 |
145 |
+--- a/cccc/cccc.g |
146 |
++++ b/cccc/cccc.g |
147 |
+@@ -84,6 +84,30 @@ inline void endOfLine(CLexer &lexer) |
148 |
+ #token MAC_NL "\r" << endOfLine(*this); >> |
149 |
+ #token UNIX_NL "\n" << endOfLine(*this); >> |
150 |
+ |
151 |
++/* augment dialect policies -- M.H added */ |
152 |
++#lexclass SKIP_STMT |
153 |
++#token SKCOLON ";" << skip();mode(START); >> |
154 |
++#token SKANYTHING "~[; \t\n]" << skip();more();>> |
155 |
++#token SKNL "\n" << skip();endOfLine(*this);>> |
156 |
++#token SKBLANK "[ \t]+" << skip(); >> |
157 |
++#lexclass START |
158 |
++ |
159 |
++#lexclass SKIP_BLOCK |
160 |
++#token SK_ANY "[a-zA-Z0-9_]*" |
161 |
++<< |
162 |
++std::string treatment = |
163 |
++ CCCC_Options::dialectKeywordPolicy(parse_language,lextext()); |
164 |
++ |
165 |
++if ( treatment != "stop_skipping" ) |
166 |
++{ |
167 |
++ skip(); |
168 |
++} |
169 |
++else |
170 |
++{ |
171 |
++ mode(COMMENT_LINE);skip(); |
172 |
++} |
173 |
++>> |
174 |
++#lexclass START |
175 |
+ |
176 |
+ /* preprocessor constructs - comments, #defines etc */ |
177 |
+ |
178 |
+@@ -343,17 +367,29 @@ inline void endOfLine(CLexer &lexer) |
179 |
+ if( treatment == "ignore" ) |
180 |
+ { |
181 |
+ skip(); |
182 |
++ //std::cout << toktext << std::endl <<" :ignore" << std::endl; |
183 |
+ } |
184 |
+ // Ultimately, the next two cases will need to be handled |
185 |
+ // using a #lexclass or something similar, for the moment |
186 |
+ // we just try to skip the tokens themselves. |
187 |
+ else if ( treatment == "start_skipping" ) |
188 |
+ { |
189 |
+- skip(); |
190 |
++ mode(SKIP_BLOCK);skip(); |
191 |
+ } |
192 |
+ else if ( treatment == "stop_skipping" ) |
193 |
+ { |
194 |
+- skip(); |
195 |
++ skip(); mode(COMMENT_LINE); |
196 |
++ //gobble end of line M.H. |
197 |
++ } |
198 |
++ else if ( treatment == "skip_line" )//M.H added |
199 |
++ { |
200 |
++ mode(COMMENT_LINE);skip(); |
201 |
++ //std::cout << "skip_line" << std::endl; |
202 |
++ } |
203 |
++ else if ( treatment == "skip_stmt" )//M.H added |
204 |
++ { |
205 |
++ mode(SKIP_STMT);skip(); |
206 |
++ //std::cout << "skip_stmt" << std::endl; |
207 |
+ } |
208 |
+ >> |
209 |
+ |
210 |
+@@ -426,8 +462,10 @@ void init(const string& filename, const string& language) |
211 |
+ pu=ParseUtility::currentInstance(); |
212 |
+ ps=ParseStore::currentInstance(); |
213 |
+ |
214 |
+- ANTLRParser::init(); |
215 |
+ parse_language=language; |
216 |
++ ANTLRParser::init(); |
217 |
++ //parse_language=language; |
218 |
++ //move above, M.H.1st otherwise time init not to language |
219 |
+ } |
220 |
+ |
221 |
+ >> |
222 |
|
223 |
diff --git a/dev-util/cccc/metadata.xml b/dev-util/cccc/metadata.xml |
224 |
new file mode 100644 |
225 |
index 00000000000..ecde1cfd0a0 |
226 |
--- /dev/null |
227 |
+++ b/dev-util/cccc/metadata.xml |
228 |
@@ -0,0 +1,19 @@ |
229 |
+<?xml version="1.0" encoding="UTF-8"?> |
230 |
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> |
231 |
+<pkgmetadata> |
232 |
+ <maintainer type="person"> |
233 |
+ <email>nerdboy@g.o</email> |
234 |
+ </maintainer> |
235 |
+ <longdescription lang="en"> |
236 |
+ cccc provides source code metrics (line counts, complexity, |
237 |
+ object-oriented, and structural metrics) for Java and C++ |
238 |
+ </longdescription> |
239 |
+ <upstream> |
240 |
+ <remote-id type="github">sarnold/cccc</remote-id> |
241 |
+ <bugs-to>https://github.com/sarnold/cccc/issues</bugs-to> |
242 |
+ </upstream> |
243 |
+ <use> |
244 |
+ <flag name="apidoc">Build software docs with doxygen/graphviz and metrics with cccc</flag> |
245 |
+ <flag name="mfc">Add patch for MFC dialect options</flag> |
246 |
+ </use> |
247 |
+</pkgmetadata> |