diff --git a/srcpkgs/cppcheck-gui b/srcpkgs/cppcheck-gui new file mode 120000 index 00000000000..09ec9f56663 --- /dev/null +++ b/srcpkgs/cppcheck-gui @@ -0,0 +1 @@ +cppcheck \ No newline at end of file diff --git a/srcpkgs/cppcheck/patches/translations-location.patch b/srcpkgs/cppcheck/patches/translations-location.patch new file mode 100644 index 00000000000..f255cb93f2c --- /dev/null +++ b/srcpkgs/cppcheck/patches/translations-location.patch @@ -0,0 +1,19 @@ +--- a/gui/translationhandler.cpp ++++ b/gui/translationhandler.cpp +@@ -116,15 +116,7 @@ + if (datadir.isEmpty()) + datadir = appPath; + +- QString translationFile; +- if (QFile::exists(datadir + "/lang/" + mTranslations[index].mFilename + ".qm")) +- translationFile = datadir + "/lang/" + mTranslations[index].mFilename + ".qm"; +- +- else if (QFile::exists(datadir + "/" + mTranslations[index].mFilename + ".qm")) +- translationFile = datadir + "/" + mTranslations[index].mFilename + ".qm"; +- +- else +- translationFile = appPath + "/" + mTranslations[index].mFilename + ".qm"; ++ QString translationFile("/usr/share/cppcheck/cfg/lang/" + mTranslations[index].mFilename + ".qm"); + + if (!mTranslator->load(translationFile) && !failure) { + //If it failed, lets check if the default file exists diff --git a/srcpkgs/cppcheck/template b/srcpkgs/cppcheck/template index 0192573f409..bfe4879337e 100644 --- a/srcpkgs/cppcheck/template +++ b/srcpkgs/cppcheck/template @@ -1,18 +1,17 @@ # Template file for 'cppcheck' pkgname=cppcheck -version=2.10.1 +version=2.10.2 revision=1 -build_style=gnu-makefile -make_build_args=" - FILESDIR=/usr/share/cppcheck - MATCHCOMPILER=yes - HAVE_RULES=yes - DB2MAN=/usr/share/xsl/docbook/manpages/docbook.xsl" -make_install_args="${make_build_args}" -make_build_target="cppcheck man" -python_version="3" -hostmakedepends="libxslt docbook-xsl python3 which" -makedepends="pcre-devel" +build_style=cmake +configure_args=" + -DBUILD_GUI=ON + -DFILESDIR=/usr/share/cppcheck + -DHAVE_RULES=ON + -DUSE_BUNDLED_TINYXML2=OFF + -DUSE_MATCHCOMPILER=ON" +hostmakedepends="libxslt docbook-xsl python3 qt5-tools-devel" +makedepends="pcre-devel tinyxml2-devel qt5-devel qt5-tools-devel qt5-plugin-mysql + qt5-plugin-odbc qt5-plugin-pgsql qt5-plugin-sqlite qt5-plugin-tds" depends="python3" short_desc="Static analysis of C/C++ code" maintainer="Duncaen " @@ -20,11 +19,35 @@ license="GPL-3.0-or-later" homepage="http://cppcheck.sourceforge.net" changelog="https://sourceforge.net/p/cppcheck/news/" distfiles="https://github.com/danmar/cppcheck/archive/${version}.tar.gz" -checksum=0a1aa45d00132ecee0c9af467e085efbda448094a89d90137249b080863466d2 +checksum=915785d01fa6f5571e9d450102056466222b554525ce3ad67c61b75508a7a451 export CXXFLAGS="-DNDEBUG" -export LDFLAGS="-pthread" + +if [ -n "$XBPS_CHECK_PKGS" ]; then + configure_args+=" -DBUILD_TESTS=ON" +fi + +post_extract() { + if [ "$CROSS_BUILD" ]; then + vsed -e '/run-dmake/d' -i test/CMakeLists.txt + fi +} post_install() { + make DB2MAN=/usr/share/xsl/docbook/manpages/docbook.xsl man vman cppcheck.1 + + vmkdir usr/share/cppcheck/cfg/lang + mv "${DESTDIR}/usr/bin/cppcheck_"*.qm "${DESTDIR}/usr/share/cppcheck/cfg/lang/" +} + +cppcheck-gui_package() { + depends="${sourcepkg}>=${version}_${revision}" + short_desc+=" - Qt5 GUI" + pkg_install() { + vmove usr/bin/cppcheck-gui + vmove usr/share/cppcheck/cfg/lang + vmove usr/share/applications + vmove usr/share/icons + } }