1 |
commit: 9a345b0cdd668ad0678f49a306665354b6c3143c |
2 |
Author: Michael Weber <xmw <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Aug 4 13:08:54 2016 +0000 |
4 |
Commit: Michael Weber <xmw <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Aug 4 13:09:10 2016 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9a345b0c |
7 |
|
8 |
dev-util/cppcheck: add live version (bug 590428). |
9 |
|
10 |
Package-Manager: portage-2.2.28 |
11 |
|
12 |
dev-util/cppcheck/cppcheck-9999.ebuild | 105 +++++++++++++++++++++ |
13 |
.../cppcheck/files/cppcheck-9999-tinyxml2.patch | 55 +++++++++++ |
14 |
2 files changed, 160 insertions(+) |
15 |
|
16 |
diff --git a/dev-util/cppcheck/cppcheck-9999.ebuild b/dev-util/cppcheck/cppcheck-9999.ebuild |
17 |
new file mode 100644 |
18 |
index 0000000..937cc7f |
19 |
--- /dev/null |
20 |
+++ b/dev-util/cppcheck/cppcheck-9999.ebuild |
21 |
@@ -0,0 +1,105 @@ |
22 |
+# Copyright 1999-2016 Gentoo Foundation |
23 |
+# Distributed under the terms of the GNU General Public License v2 |
24 |
+# $Id$ |
25 |
+ |
26 |
+EAPI=5 |
27 |
+ |
28 |
+PYTHON_COMPAT=( python{2_7,3_3,3_4,3_5} ) |
29 |
+ |
30 |
+inherit distutils-r1 eutils qt4-r2 toolchain-funcs flag-o-matic git-r3 |
31 |
+ |
32 |
+DESCRIPTION="static analyzer of C/C++ code" |
33 |
+HOMEPAGE="http://cppcheck.sourceforge.net" |
34 |
+EGIT_REPO_URI="git://github.com/danmar/cppcheck.git" |
35 |
+ |
36 |
+LICENSE="GPL-3" |
37 |
+SLOT="0" |
38 |
+KEYWORDS="" |
39 |
+IUSE="htmlreport pcre qt4" |
40 |
+ |
41 |
+RDEPEND="htmlreport? ( dev-python/pygments[${PYTHON_USEDEP}] ) |
42 |
+ >=dev-libs/tinyxml2-2 |
43 |
+ qt4? ( dev-qt/qtgui:4 ) |
44 |
+ pcre? ( dev-libs/libpcre )" |
45 |
+DEPEND="${RDEPEND} |
46 |
+ app-text/docbook-xsl-stylesheets |
47 |
+ dev-libs/libxslt |
48 |
+ virtual/pkgconfig" |
49 |
+ |
50 |
+src_prepare() { |
51 |
+ append-cxxflags -std=c++0x |
52 |
+ |
53 |
+ # Drop bundled libs, patch Makefile generator and re-run it |
54 |
+ rm -r externals/tinyxml || die |
55 |
+ epatch "${FILESDIR}"/${PN}-9999-tinyxml2.patch |
56 |
+ tc-export CXX |
57 |
+ emake dmake |
58 |
+ ./dmake || die |
59 |
+ |
60 |
+ epatch_user |
61 |
+} |
62 |
+ |
63 |
+src_configure() { |
64 |
+ if use pcre ; then |
65 |
+ sed -e '/HAVE_RULES=/s:=no:=yes:' \ |
66 |
+ -i Makefile |
67 |
+ fi |
68 |
+ if use qt4 ; then |
69 |
+ pushd gui |
70 |
+ qt4-r2_src_configure |
71 |
+ popd |
72 |
+ fi |
73 |
+} |
74 |
+ |
75 |
+src_compile() { |
76 |
+ export LIBS="$(pkg-config --libs tinyxml2)" |
77 |
+ emake ${PN} man \ |
78 |
+ CFGDIR="${EROOT}usr/share/${PN}/cfg" \ |
79 |
+ DB2MAN="${EROOT}usr/share/sgml/docbook/xsl-stylesheets/manpages/docbook.xsl" |
80 |
+ |
81 |
+ if use qt4 ; then |
82 |
+ pushd gui |
83 |
+ qt4-r2_src_compile |
84 |
+ popd |
85 |
+ fi |
86 |
+ if use htmlreport ; then |
87 |
+ pushd htmlreport |
88 |
+ distutils-r1_src_compile |
89 |
+ popd |
90 |
+ fi |
91 |
+} |
92 |
+ |
93 |
+src_test() { |
94 |
+ # safe final version |
95 |
+ mv -v ${PN}{,.final} |
96 |
+ mv -v lib/library.o{,.final} |
97 |
+ mv -v cli/cppcheckexecutor.o{,.final} |
98 |
+ #trigger recompile with CFGDIR inside ${S} |
99 |
+ emake check CFGDIR="${S}/cfg" |
100 |
+ # restore |
101 |
+ mv -v ${PN}{.final,} |
102 |
+ mv -v lib/library.o{.final,} |
103 |
+ mv -v cli/cppcheckexecutor.o{.final,} |
104 |
+} |
105 |
+ |
106 |
+src_install() { |
107 |
+ # it's not autotools-based, so "${ED}" here, not "${D}", bug 531760 |
108 |
+ emake install DESTDIR="${ED}" |
109 |
+ |
110 |
+ insinto "/usr/share/${PN}/cfg" |
111 |
+ doins cfg/*.cfg |
112 |
+ if use qt4 ; then |
113 |
+ dobin gui/${PN}-gui |
114 |
+ dodoc gui/{projectfile.txt,gui.${PN}} |
115 |
+ fi |
116 |
+ if use htmlreport ; then |
117 |
+ pushd htmlreport |
118 |
+ distutils-r1_src_install |
119 |
+ popd |
120 |
+ find "${D}" -name "*.egg-info" -delete |
121 |
+ else |
122 |
+ rm "${ED}/usr/bin/cppcheck-htmlreport" || die |
123 |
+ fi |
124 |
+ doman ${PN}.1 |
125 |
+ dodoc -r triage |
126 |
+} |
127 |
|
128 |
diff --git a/dev-util/cppcheck/files/cppcheck-9999-tinyxml2.patch b/dev-util/cppcheck/files/cppcheck-9999-tinyxml2.patch |
129 |
new file mode 100644 |
130 |
index 0000000..9d85584 |
131 |
--- /dev/null |
132 |
+++ b/dev-util/cppcheck/files/cppcheck-9999-tinyxml2.patch |
133 |
@@ -0,0 +1,55 @@ |
134 |
+--- cppcheck-9999/gui/gui.pro |
135 |
++++ cppcheck-9999/gui/gui.pro |
136 |
+@@ -19,6 +19,7 @@ |
137 |
+ DEFINES += CPPCHECKLIB_IMPORT |
138 |
+ } |
139 |
+ LIBS += -L$$PWD/../externals |
140 |
++LIBS += `pkg-config --libs tinyxml2` |
141 |
+ |
142 |
+ DESTDIR = . |
143 |
+ RCC_DIR = temp |
144 |
+--- cppcheck-9999/tools/dmake.cpp |
145 |
++++ cppcheck-9999/tools/dmake.cpp |
146 |
+@@ -123,7 +123,6 @@ |
147 |
+ |
148 |
+ std::vector<std::string> extfiles; |
149 |
+ extfiles.push_back("externals/simplecpp/simplecpp.cpp"); |
150 |
+- extfiles.push_back("externals/tinyxml/tinyxml2.cpp"); |
151 |
+ |
152 |
+ std::vector<std::string> clifiles; |
153 |
+ getCppFiles(clifiles, "cli/", false); |
154 |
+@@ -172,7 +171,6 @@ |
155 |
+ std::ofstream fout1("test/testfiles.pri"); |
156 |
+ if (fout1.is_open()) { |
157 |
+ fout1 << "# no manual edits - this file is autogenerated by dmake\n\n"; |
158 |
+- fout1 << "INCLUDEPATH += ../externals/tinyxml\n"; |
159 |
+ fout1 << "\n\nSOURCES += "; |
160 |
+ for (unsigned int i = 0; i < testfiles.size(); ++i) { |
161 |
+ const std::string filename(testfiles[i].substr(5)); |
162 |
+@@ -337,9 +335,9 @@ |
163 |
+ << "endif\n\n"; |
164 |
+ |
165 |
+ makeConditionalVariable(fout, "PREFIX", "/usr"); |
166 |
+- makeConditionalVariable(fout, "INCLUDE_FOR_LIB", "-Ilib -Iexternals/simplecpp -Iexternals/tinyxml"); |
167 |
+- makeConditionalVariable(fout, "INCLUDE_FOR_CLI", "-Ilib -Iexternals/simplecpp -Iexternals/tinyxml"); |
168 |
+- makeConditionalVariable(fout, "INCLUDE_FOR_TEST", "-Ilib -Icli -Iexternals/simplecpp -Iexternals/tinyxml"); |
169 |
++ makeConditionalVariable(fout, "INCLUDE_FOR_LIB", "-Ilib -Iexternals/simplecpp"); |
170 |
++ makeConditionalVariable(fout, "INCLUDE_FOR_CLI", "-Ilib -Iexternals/simplecpp"); |
171 |
++ makeConditionalVariable(fout, "INCLUDE_FOR_TEST", "-Ilib -Icli -Iexternals/simplecpp"); |
172 |
+ |
173 |
+ fout << "BIN=$(DESTDIR)$(PREFIX)/bin\n\n"; |
174 |
+ fout << "# For 'make man': sudo apt-get install xsltproc docbook-xsl docbook-xml on Linux\n"; |
175 |
+--- cppcheck-9999/externals/externals.pri |
176 |
++++ cppcheck-9999/externals/externals.pri |
177 |
+@@ -1,8 +1,5 @@ |
178 |
+-INCLUDEPATH += $${PWD}/simplecpp \ |
179 |
+- $${PWD}/tinyxml |
180 |
++INCLUDEPATH += $${PWD}/simplecpp |
181 |
+ |
182 |
+-HEADERS += $${PWD}/simplecpp/simplecpp.h \ |
183 |
+- $${PWD}/tinyxml/tinyxml2.h |
184 |
++HEADERS += $${PWD}/simplecpp/simplecpp.h |
185 |
+ |
186 |
+-SOURCES += $${PWD}/simplecpp/simplecpp.cpp \ |
187 |
+- $${PWD}/tinyxml/tinyxml2.cpp |
188 |
++SOURCES += $${PWD}/simplecpp/simplecpp.cpp |