summaryrefslogtreecommitdiffstats
path: root/development/cppcheck
diff options
context:
space:
mode:
author B. Watson2022-04-06 17:07:05 +0200
committer B. Watson2022-04-06 17:07:05 +0200
commit830a31bbbbd8b42ef562fe225f8620e906887806 (patch)
treef311f45897ef56f97364d6f863c250277a48bc80 /development/cppcheck
parentb83041c697fb18d2be12e3b2c363cc00b7cf6505 (diff)
downloadslackbuilds-830a31bbbbd8b42ef562fe225f8620e906887806.tar.gz
development/cppcheck: Add doinst, fix translations.
Signed-off-by: B. Watson <yalhcru@gmail.com>
Diffstat (limited to 'development/cppcheck')
-rw-r--r--development/cppcheck/cppcheck.SlackBuild21
-rw-r--r--development/cppcheck/doinst.sh9
-rw-r--r--development/cppcheck/fix-default-settings.diff30
-rw-r--r--development/cppcheck/install-translations-in-filesdir-lang.diff16
4 files changed, 68 insertions, 8 deletions
diff --git a/development/cppcheck/cppcheck.SlackBuild b/development/cppcheck/cppcheck.SlackBuild
index 4d38185149..8f973c165c 100644
--- a/development/cppcheck/cppcheck.SlackBuild
+++ b/development/cppcheck/cppcheck.SlackBuild
@@ -22,11 +22,15 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+# 20220405 bkw: Modified by SlackBuilds.org, BUILD=2:
+# - add doinst.sh, because we have icons and a .desktop.
+# - install translations (*.qm) in usr/share/Cppcheck/lang/, not /usr/bin.
+
cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=cppcheck
VERSION=${VERSION:-2.6}
-BUILD=${BUILD:-1}
+BUILD=${BUILD:-2}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
@@ -74,9 +78,14 @@ cd $PRGNAM-$VERSION
chown -R root:root .
find -L . \
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
- -o -perm 511 \) -exec chmod 755 {} \; -o \
+ -o -perm 511 \) -exec chmod 755 {} \+ -o \
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
- -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
+ -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \+
+
+# 20220406 bkw: these patches from Debian install the translations
+# to the correct /usr/share directory instead of in /usr/bin.
+patch -p1 < $CWD/fix-default-settings.diff
+patch -p1 < $CWD/install-translations-in-filesdir-lang.diff
mkdir -p build
cd build
@@ -97,11 +106,6 @@ cd ..
rm -f $PKG/{,usr/}lib${LIBDIRSUFFIX}/*.la
-find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
- | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
-
-find $PKG -name perllocal.pod -o -name ".packlist" -o -name "*.bs" | xargs rm -f || true
-
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a \
AUTHORS COPYING readme.{md,txt} \
@@ -110,6 +114,7 @@ cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
+cat $CWD/doinst.sh > $PKG/install/doinst.sh
cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE
diff --git a/development/cppcheck/doinst.sh b/development/cppcheck/doinst.sh
new file mode 100644
index 0000000000..3e5691a052
--- /dev/null
+++ b/development/cppcheck/doinst.sh
@@ -0,0 +1,9 @@
+if [ -x /usr/bin/update-desktop-database ]; then
+ /usr/bin/update-desktop-database -q usr/share/applications >/dev/null 2>&1
+fi
+
+if [ -e usr/share/icons/hicolor/icon-theme.cache ]; then
+ if [ -x /usr/bin/gtk-update-icon-cache ]; then
+ /usr/bin/gtk-update-icon-cache usr/share/icons/hicolor >/dev/null 2>&1
+ fi
+fi
diff --git a/development/cppcheck/fix-default-settings.diff b/development/cppcheck/fix-default-settings.diff
new file mode 100644
index 0000000000..1fa730b543
--- /dev/null
+++ b/development/cppcheck/fix-default-settings.diff
@@ -0,0 +1,30 @@
+Description: Set configuration directory and python version
+Author: Joachim Reichel <reichel@debian.org>
+
+Index: cppcheck/gui/main.cpp
+===================================================================
+--- cppcheck.orig/gui/main.cpp
++++ cppcheck/gui/main.cpp
+@@ -55,6 +55,12 @@ int main(int argc, char *argv[])
+
+ QSettings* settings = new QSettings("Cppcheck", "Cppcheck-GUI", &app);
+
++ // Set some default settings
++ if( settings->value("DATADIR", QString()).toString().isEmpty())
++ settings->setValue("DATADIR", FILESDIR);
++ if( settings->value(SETTINGS_PYTHON_PATH, QString()).toString().isEmpty())
++ settings->setValue(SETTINGS_PYTHON_PATH, QString("/usr/bin/python3"));
++
+ // Set data dir..
+ foreach (const QString arg, app.arguments()) {
+ if (arg.startsWith("--data-dir=")) {
+Index: cppcheck/htmlreport/cppcheck-htmlreport
+===================================================================
+--- cppcheck.orig/htmlreport/cppcheck-htmlreport
++++ cppcheck/htmlreport/cppcheck-htmlreport
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+
+ from __future__ import unicode_literals
+
diff --git a/development/cppcheck/install-translations-in-filesdir-lang.diff b/development/cppcheck/install-translations-in-filesdir-lang.diff
new file mode 100644
index 0000000000..63c7f0d5e8
--- /dev/null
+++ b/development/cppcheck/install-translations-in-filesdir-lang.diff
@@ -0,0 +1,16 @@
+Description: Install the translations in $FILESDIR/lang instead of /usr/bin
+Author: Joachim Reichel <reichel@debian.org>
+
+Index: cppcheck/gui/CMakeLists.txt
+===================================================================
+--- cppcheck.orig/gui/CMakeLists.txt
++++ cppcheck/gui/CMakeLists.txt
+@@ -51,7 +51,7 @@ if (BUILD_GUI)
+ endif()
+
+ install(TARGETS cppcheck-gui RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_BINDIR} COMPONENT applications)
+- install(FILES ${qms} DESTINATION ${CMAKE_INSTALL_FULL_BINDIR} COMPONENT applications)
++ install(FILES ${qms} DESTINATION ${FILESDIR}/lang COMPONENT applications)
+
+ install(FILES cppcheck-gui.desktop DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications)
+