Bug#949181: cppcheck: Improve debian/rules, reenabling parallel building

2020-01-18 Thread Joachim Reichel
Control: tags -1 +pending

Hi,

weird, I believe I had parallel builds working in my environment. And I'm not
sure why override_dh_auto_configure did not work for me.

Anyway, it is now much simpler and cleaner. The rules for override_dh_missing
and override_dh_auto_clean can also be removed.

  Joachim



Bug#949181: cppcheck: Improve debian/rules, reenabling parallel building

2020-01-17 Thread Lisandro Damián Nicanor Pérez Meyer
Source: cppcheck
Version: 1.90-2
Severity: normal
Tags: patch

Hi! After you closed the bugs I've filled I noticed the builds went slower than
usual, so I've got the source and made some improvements in debian/rules.

I'm attaching the patch.

Kinds regards, Lisandro.

-- System Information:
Debian Release: bullseye/sid
  APT prefers unstable
  APT policy: (990, 'unstable'), (500, 'unstable-debug'), (500, 
'testing-debug'), (500, 'buildd-unstable'), (500, 'testing'), (1, 
'experimental-debug'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386, arm64, armhf

Kernel: Linux 5.4.0-2-amd64 (SMP w/2 CPU cores)
Kernel taint flags: TAINT_WARN, TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
Locale: LANG=es_AR.UTF-8, LC_CTYPE=es_AR.UTF-8 (charmap=UTF-8), 
LANGUAGE=es_AR:es (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

-- no debconf information
From 75d4087ae10195f037e58d322197c0da75214a08 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Lisandro=20Dami=C3=A1n=20Nicanor=20P=C3=A9rez=20Meyer?=
 
Date: Fri, 17 Jan 2020 17:24:07 -0300
Subject: [PATCH] Improve debian/rules, reenabling parallel build.

---
 debian/changelog | 16 
 debian/rules | 18 --
 2 files changed, 28 insertions(+), 6 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 376b0a8..aeb6099 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,19 @@
+cppcheck (1.90-2.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Improve debian/rules:
+- Export QT_SELECT set to qt5. Be safe even if using CMake.
+- Pass --builddirectory=build to dh so the rest of the tooling knows where
+  the build directory is.
+- Override dh_auto_configure and run the tool in this step where it
+  belongs.
+- Call dh_auto_build instead of calling $(MAKE). With this parallel 
building
+  is renabled.
+- Same as above for dh_auto_install.
+- Override dh_missing in it's proper place.
+
+ -- Lisandro Damián Nicanor Pérez Meyer   Fri, 17 Jan 
2020 16:49:53 -0300
+
 cppcheck (1.90-2) unstable; urgency=medium
 
   * Use build system based on cmake which supports generation of *.qm files
diff --git a/debian/rules b/debian/rules
index 5f81e7b..2f8f7b1 100755
--- a/debian/rules
+++ b/debian/rules
@@ -9,6 +9,8 @@ export DEB_BUILD_MAINT_OPTIONS = hardening=+bindnow
 
 export DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
 
+export QT_SELECT := qt5
+
 # See http://wiki.debian.org/Hardening#Notes_for_packages_using_CMake
 CFLAGS   := $(CFLAGS) $(CPPFLAGS)
 CXXFLAGS := $(CXXFLAGS) $(CPPFLAGS)
@@ -17,13 +19,15 @@ DB2MAN  = 
/usr/share/sgml/docbook/stylesheet/xsl/nwalsh/manpages/docbook.xsl
 XP  = xsltproc -''-nonet -''-param man.charmap.use.subset "0"
 
 %:
-   dh $@ --buildsystem=cmake
+   dh $@ --buildsystem=cmake --builddirectory=build
+
+override_dh_auto_configure:
+   QTDIR= dh_auto_configure -- -DCMAKE_BUILD_TYPE=Release \
+   -DUSE_MATCHCOMPILER=ON -DBUILD_TESTS=ON -DBUILD_GUI=ON -DWITH_QCHART=ON 
\
+   -DHAVE_RULES=ON -DFILESDIR=/usr/lib/$(DEB_HOST_MULTIARCH)/cppcheck
 
 override_dh_auto_build:
-   QTDIR= dh_auto_configure --builddirectory=build -- 
-DCMAKE_BUILD_TYPE=Release \
- -DUSE_MATCHCOMPILER=ON -DBUILD_TESTS=ON -DBUILD_GUI=ON 
-DWITH_QCHART=ON \
- -DHAVE_RULES=ON -DFILESDIR=/usr/lib/$(DEB_HOST_MULTIARCH)/cppcheck
-   $(MAKE) -C build
+   dh_auto_build
$(XP) --output build/cppcheck.1 $(DB2MAN) man/cppcheck.1.xml
sed -e "s/1.70/$(DEB_VERSION_UPSTREAM)/" 
debian/cppcheck-htmlreport.1.in >build/cppcheck-htmlreport.1
 
@@ -33,11 +37,13 @@ ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
 endif
 
 override_dh_auto_install:
-   $(MAKE) -C build DESTDIR=$(CURDIR)/debian/tmp install
+   dh_auto_install
install -d $(CURDIR)/debian/tmp/usr/share/man/man1
install build/cppcheck.1 $(CURDIR)/debian/tmp/usr/share/man/man1
install build/cppcheck-htmlreport.1 
$(CURDIR)/debian/tmp/usr/share/man/man1
dh_install --sourcedir=debian/tmp
+
+override_dh_missing:
dh_missing --list-missing
 
 override_dh_auto_clean:
-- 
2.25.0