[ITA] cppcheck-1.66-1

Yaakov Selkowitz yselkowitz@cygwin.com
Mon Sep 22 04:04:00 GMT 2014


On 2014-09-21 14:28, David Stacey wrote:
> I would like to adopt cppcheck, which was orphaned by Chris Sutcliffe
> last week [1]. The following notes may be of use when reviewing this
> package:
>
> I have enabled custom rules for cppcheck, which gives the user the scope
> to create custom checks. This introduces a dependency on libpcre1.
>
> I have built the Qt GUI for cppcheck, which is available as a
> sub-package. cppcheck-gui is available in openSUSE [2] and ArchLinux [3].

The gui code is built without proper optimization or debuginfo.  This 
can be fixed in gui/gui.pro:

-CONFIG += warn_on debug
+CONFIG += warn_on

> cppcheck-gui contains a number of language translations, which are
> included. However, the way that the GUI locates these translations is a
> little bizarre. The user is expected to call 'cppcheck-gui
> --data-dir=/path/to/translations' before using cppcheck-gui for the
> first time. This would be an ideal candidate for a post-install step,
> except that it has to be done by each user (not just the user performing
> the install), and an X server needs to be running (even though no window
> is opened). So for both of these reasons I consider that a post-install
> step is not the way forward.
>
> Instead, I have patched the GUI to always look for the translation files
> in a set directory. This seems sensible, as you should just have one set
> of translation files that are shared between all users. This works, but
> the GUI gives a harmless warning the first time it is invoked. This is
> probably a bug in the cppcheck-gui code, as the native Windows version
> does the same. Otherwise, the GUI works well.

Not a blocker, but I suspect you're going to get "bug" reports due to 
that first-run warning message, so it would be good if you could 
eventually figure that out.

> The cppcheck build scripts from openSUSE [4] and ArchLinux [5] don't
> offer much inspiration - neither ship with the translation files at all,
> which will just give an error when the user tries to switch languages.
> So I would be very interested if anyone could find a more elegant
> solution to this problem.

IMO this should suffice.  Another alternative might be to add the 
translations to the resource file (gui/gui.qrc) and change the code to 
look there for the translations.

One other thing: as a graphical program it should have a desktop menu 
entry, which can be accomplished by appending the following to your 
src_install():

     newicon ${S}/gui/icon.png cppcheck.png
     make_desktop_entry cppcheck-gui "Cppcheck" cppcheck "Development"

and adding usr/share/applications/ and usr/share/pixmaps/ to 
cppcheck_gui_CONTENTS.


Yaakov



More information about the Cygwin-apps mailing list