diff options
Diffstat (limited to 'dev-util/cppcheck')
-rw-r--r-- | dev-util/cppcheck/Manifest | 5 | ||||
-rw-r--r-- | dev-util/cppcheck/cppcheck-1.81.ebuild | 107 | ||||
-rw-r--r-- | dev-util/cppcheck/cppcheck-9999.ebuild | 107 | ||||
-rw-r--r-- | dev-util/cppcheck/files/cppcheck-1.75-tinyxml2.patch | 55 | ||||
-rw-r--r-- | dev-util/cppcheck/metadata.xml | 14 |
5 files changed, 288 insertions, 0 deletions
diff --git a/dev-util/cppcheck/Manifest b/dev-util/cppcheck/Manifest new file mode 100644 index 000000000000..37285e8779c0 --- /dev/null +++ b/dev-util/cppcheck/Manifest @@ -0,0 +1,5 @@ +AUX cppcheck-1.75-tinyxml2.patch 2294 BLAKE2B 78763d10fdddb3d7f0cdaca9271007e97cd981ce1a5a39a91c928def6611cc379b411f9f8380d8f3b4b23554277cfc5a9c6e0797a80378d6e956ee2668dcbc5a SHA512 5eebe4e85649a5e9e0fd312dbaf4284a68327125322f1c6b905ec93b1d445978dd532c4c8c18ad0478f29a50c77761fed1d0ecb2dca3148c0c7c747d391e7f07 +DIST cppcheck-1.81.tar.bz2 1514741 BLAKE2B 2f23dfe4bdb26e203411f0bf9bc569303a4d59f96911b32a8a5f9cc9a6a7fa75e5d87c328cb0bf8cc46bd8f38747a4663c33243b8385355cc5630e1fcf6c891f SHA512 22e7b63c35e71b2784065faca06aec8c286e3173f182ac10995073cc3d61fd0bfaf353c51ad9207d3bd2c6134ab1a3990a37668709505b657c2816d561f8af92 +EBUILD cppcheck-1.81.ebuild 2199 BLAKE2B fdea3ee8878f094db25a6cab68d4b9698aae4c9b898630e3d05e606a111704db383d112c4f58b55fbc6d5c980b3f2eb2ee7655651021834cfec8b06bdcda73a0 SHA512 889b589a4fa15a5f558e80dbb15005959ed6aade00737a3af16e40d12f79f04d25b3eb6c4a4333b7784a224a087cdf904914a85b148cee4bcba8d9bcc9c1fb02 +EBUILD cppcheck-9999.ebuild 2181 BLAKE2B a1c647fda42b74ea213f10113dc1a3b788009fb578c41f36cf287f4ec962046b35ec40822e4255af487f10aaf99b37766be7b13158bbdd5db48e652990c81ff2 SHA512 1ca33c9a1cc82de5dec24baf64ce40b58d9a980e4d45bf5bc5c75b7cf7d1a3d277072fbc8d8e7c6ecf238146c0dc628043c790dfb62c0318d26cafda084f8aaf +MISC metadata.xml 397 BLAKE2B 4ed8f4270fb9d5cccf84c6eaa6feed2ea1bd662f50b85bd39afa0c715e535be35dd67efa462477d43e5b2c118838b11b9b613638d330be7999d4dc3d59193c42 SHA512 63aebce854e81f3fb0584e47f75b416f33a6ff8cae55652d952c89b546ef28312ad44ab01113e9bedaf1b1181137930d066344c11773bb263baff7f27b7a313e diff --git a/dev-util/cppcheck/cppcheck-1.81.ebuild b/dev-util/cppcheck/cppcheck-1.81.ebuild new file mode 100644 index 000000000000..ce60d5ec062a --- /dev/null +++ b/dev-util/cppcheck/cppcheck-1.81.ebuild @@ -0,0 +1,107 @@ +# Copyright 1999-2018 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +PYTHON_COMPAT=( python{2_7,3_4,3_5,3_6} ) + +inherit distutils-r1 flag-o-matic qmake-utils toolchain-funcs + +DESCRIPTION="static analyzer of C/C++ code" +HOMEPAGE="http://cppcheck.sourceforge.net" +SRC_URI="mirror://sourceforge/${PN}/${P}.tar.bz2" + +LICENSE="GPL-3" +SLOT="0" +KEYWORDS="amd64 ~arm ~arm64 hppa sparc x86" +IUSE="htmlreport pcre qt5" + +RDEPEND=" + dev-libs/tinyxml2:= + htmlreport? ( dev-python/pygments[${PYTHON_USEDEP}] ) + pcre? ( dev-libs/libpcre ) + qt5? ( + dev-qt/qtcore:5 + dev-qt/qtgui:5 + dev-qt/qtprintsupport:5 + ) +" +DEPEND="${RDEPEND} + app-text/docbook-xsl-stylesheets + dev-libs/libxslt + virtual/pkgconfig +" + +PATCHES=( "${FILESDIR}"/${PN}-1.75-tinyxml2.patch ) + +src_prepare() { + default + append-cxxflags -std=c++0x + + # Drop bundled libs, patch Makefile generator and re-run it + rm -r externals/tinyxml || die + tc-export CXX + emake dmake + ./dmake || die +} + +src_configure() { + if use pcre ; then + sed -e '/HAVE_RULES=/s:=no:=yes:' \ + -i Makefile + fi +} + +src_compile() { + export LIBS="$(pkg-config --libs tinyxml2)" + emake ${PN} man \ + CFGDIR="${EROOT}usr/share/${PN}/cfg" \ + DB2MAN="${EROOT}usr/share/sgml/docbook/xsl-stylesheets/manpages/docbook.xsl" + + if use qt5 ; then + pushd gui + eqmake5 + emake + popd + fi + if use htmlreport ; then + pushd htmlreport + distutils-r1_src_compile + popd + fi +} + +src_test() { + # safe final version + mv -v ${PN}{,.final} + mv -v lib/library.o{,.final} + mv -v cli/cppcheckexecutor.o{,.final} + #trigger recompile with CFGDIR inside ${S} + emake check CFGDIR="${S}/cfg" + # restore + mv -v ${PN}{.final,} + mv -v lib/library.o{.final,} + mv -v cli/cppcheckexecutor.o{.final,} +} + +src_install() { + # it's not autotools-based, so "${ED}" here, not "${D}", bug 531760 + emake install DESTDIR="${ED}" + + insinto "/usr/share/${PN}/cfg" + doins cfg/*.cfg + if use qt5 ; then + dobin gui/${PN}-gui + dodoc gui/{projectfile.txt,gui.${PN}} + fi + if use htmlreport ; then + pushd htmlreport + distutils-r1_src_install + popd + find "${D}" -name "*.egg-info" -delete + else + rm "${ED}/usr/bin/cppcheck-htmlreport" || die + fi + doman ${PN}.1 + dodoc -r triage +} diff --git a/dev-util/cppcheck/cppcheck-9999.ebuild b/dev-util/cppcheck/cppcheck-9999.ebuild new file mode 100644 index 000000000000..2ef2f6f37cad --- /dev/null +++ b/dev-util/cppcheck/cppcheck-9999.ebuild @@ -0,0 +1,107 @@ +# Copyright 1999-2018 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +PYTHON_COMPAT=( python{2_7,3_4,3_5,3_6} ) + +inherit distutils-r1 flag-o-matic qmake-utils toolchain-funcs git-r3 + +DESCRIPTION="static analyzer of C/C++ code" +HOMEPAGE="http://cppcheck.sourceforge.net" +EGIT_REPO_URI="https://github.com/danmar/cppcheck.git" + +LICENSE="GPL-3" +SLOT="0" +KEYWORDS="" +IUSE="htmlreport pcre qt5" + +RDEPEND=" + >=dev-libs/tinyxml2-2 + htmlreport? ( dev-python/pygments[${PYTHON_USEDEP}] ) + pcre? ( dev-libs/libpcre ) + qt5? ( + dev-qt/qtcore:5 + dev-qt/qtgui:5 + dev-qt/qtprintsupport:5 + ) +" +DEPEND="${RDEPEND} + app-text/docbook-xsl-stylesheets + dev-libs/libxslt + virtual/pkgconfig +" + +PATCHES=( "${FILESDIR}"/${PN}-1.75-tinyxml2.patch ) + +src_prepare() { + default + append-cxxflags -std=c++0x + + # Drop bundled libs, patch Makefile generator and re-run it + rm -r externals/tinyxml || die + tc-export CXX + emake dmake + ./dmake || die +} + +src_configure() { + if use pcre ; then + sed -e '/HAVE_RULES=/s:=no:=yes:' \ + -i Makefile + fi +} + +src_compile() { + export LIBS="$(pkg-config --libs tinyxml2)" + emake ${PN} man \ + CFGDIR="${EROOT}usr/share/${PN}/cfg" \ + DB2MAN="${EROOT}usr/share/sgml/docbook/xsl-stylesheets/manpages/docbook.xsl" + + if use qt5 ; then + pushd gui + eqmake5 + emake + popd + fi + if use htmlreport ; then + pushd htmlreport + distutils-r1_src_compile + popd + fi +} + +src_test() { + # safe final version + mv -v ${PN}{,.final} + mv -v lib/library.o{,.final} + mv -v cli/cppcheckexecutor.o{,.final} + #trigger recompile with CFGDIR inside ${S} + emake check CFGDIR="${S}/cfg" + # restore + mv -v ${PN}{.final,} + mv -v lib/library.o{.final,} + mv -v cli/cppcheckexecutor.o{.final,} +} + +src_install() { + # it's not autotools-based, so "${ED}" here, not "${D}", bug 531760 + emake install DESTDIR="${ED}" + + insinto "/usr/share/${PN}/cfg" + doins cfg/*.cfg + if use qt5 ; then + dobin gui/${PN}-gui + dodoc gui/{projectfile.txt,gui.${PN}} + fi + if use htmlreport ; then + pushd htmlreport + distutils-r1_src_install + popd + find "${D}" -name "*.egg-info" -delete + else + rm "${ED}/usr/bin/cppcheck-htmlreport" || die + fi + doman ${PN}.1 + dodoc -r triage +} diff --git a/dev-util/cppcheck/files/cppcheck-1.75-tinyxml2.patch b/dev-util/cppcheck/files/cppcheck-1.75-tinyxml2.patch new file mode 100644 index 000000000000..9d8558466595 --- /dev/null +++ b/dev-util/cppcheck/files/cppcheck-1.75-tinyxml2.patch @@ -0,0 +1,55 @@ +--- cppcheck-9999/gui/gui.pro ++++ cppcheck-9999/gui/gui.pro +@@ -19,6 +19,7 @@ + DEFINES += CPPCHECKLIB_IMPORT + } + LIBS += -L$$PWD/../externals ++LIBS += `pkg-config --libs tinyxml2` + + DESTDIR = . + RCC_DIR = temp +--- cppcheck-9999/tools/dmake.cpp ++++ cppcheck-9999/tools/dmake.cpp +@@ -123,7 +123,6 @@ + + std::vector<std::string> extfiles; + extfiles.push_back("externals/simplecpp/simplecpp.cpp"); +- extfiles.push_back("externals/tinyxml/tinyxml2.cpp"); + + std::vector<std::string> clifiles; + getCppFiles(clifiles, "cli/", false); +@@ -172,7 +171,6 @@ + std::ofstream fout1("test/testfiles.pri"); + if (fout1.is_open()) { + fout1 << "# no manual edits - this file is autogenerated by dmake\n\n"; +- fout1 << "INCLUDEPATH += ../externals/tinyxml\n"; + fout1 << "\n\nSOURCES += "; + for (unsigned int i = 0; i < testfiles.size(); ++i) { + const std::string filename(testfiles[i].substr(5)); +@@ -337,9 +335,9 @@ + << "endif\n\n"; + + makeConditionalVariable(fout, "PREFIX", "/usr"); +- makeConditionalVariable(fout, "INCLUDE_FOR_LIB", "-Ilib -Iexternals/simplecpp -Iexternals/tinyxml"); +- makeConditionalVariable(fout, "INCLUDE_FOR_CLI", "-Ilib -Iexternals/simplecpp -Iexternals/tinyxml"); +- makeConditionalVariable(fout, "INCLUDE_FOR_TEST", "-Ilib -Icli -Iexternals/simplecpp -Iexternals/tinyxml"); ++ makeConditionalVariable(fout, "INCLUDE_FOR_LIB", "-Ilib -Iexternals/simplecpp"); ++ makeConditionalVariable(fout, "INCLUDE_FOR_CLI", "-Ilib -Iexternals/simplecpp"); ++ makeConditionalVariable(fout, "INCLUDE_FOR_TEST", "-Ilib -Icli -Iexternals/simplecpp"); + + fout << "BIN=$(DESTDIR)$(PREFIX)/bin\n\n"; + fout << "# For 'make man': sudo apt-get install xsltproc docbook-xsl docbook-xml on Linux\n"; +--- cppcheck-9999/externals/externals.pri ++++ cppcheck-9999/externals/externals.pri +@@ -1,8 +1,5 @@ +-INCLUDEPATH += $${PWD}/simplecpp \
+- $${PWD}/tinyxml
++INCLUDEPATH += $${PWD}/simplecpp
+
+-HEADERS += $${PWD}/simplecpp/simplecpp.h \
+- $${PWD}/tinyxml/tinyxml2.h
++HEADERS += $${PWD}/simplecpp/simplecpp.h
+
+-SOURCES += $${PWD}/simplecpp/simplecpp.cpp \
+- $${PWD}/tinyxml/tinyxml2.cpp
++SOURCES += $${PWD}/simplecpp/simplecpp.cpp
diff --git a/dev-util/cppcheck/metadata.xml b/dev-util/cppcheck/metadata.xml new file mode 100644 index 000000000000..3bf4b78228a1 --- /dev/null +++ b/dev-util/cppcheck/metadata.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="person"> + <email>xmw@gentoo.org</email> + <name>Michael Weber</name> + </maintainer> + <use> + <flag name="htmlreport">install cppcheck-htmlreport</flag> + </use> + <upstream> + <remote-id type="sourceforge">cppcheck</remote-id> + </upstream> +</pkgmetadata> |