Bug#943658: wmbattery FTCBFS: fails ./configure during clean

Helmut Grohne helmut at subdivi.de
Sun Oct 27 15:38:50 GMT 2019


Source: wmbattery
Version: 2.51-2
Tags: patch
User: debian-cross at lists.debian.org
Usertags: ftcbfs

wmbattery fails to cross build from source, because the upstream
Makefile configures for the build architecture when running make clean
and this is what dh_auto_clean does ahead of a build. We can prevent
that behaviour by carefully touching a few files that are to be removed
anyway.

Then it fails, because the Makefile runs the build architecture
pkg-config. In theory, make has no business in running pkg-config in an
autotools project. It should be using PKG_CHECK_MODULES instead.

Please consider applying the attached patch.

Helmut
-------------- next part --------------
diff --minimal -Nru wmbattery-2.51/debian/changelog wmbattery-2.51/debian/changelog
--- wmbattery-2.51/debian/changelog	2018-04-17 17:02:05.000000000 +0200
+++ wmbattery-2.51/debian/changelog	2019-10-27 16:26:19.000000000 +0100
@@ -1,3 +1,12 @@
+wmbattery (2.51-2.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix FTCBFS: (Closes: #-1)
+    + Don't run ./configure during dh_auto_clean.
+    + cross.patch: Detect upower-glib using PKG_CHECK_MODULES.
+
+ -- Helmut Grohne <helmut at subdivi.de>  Sun, 27 Oct 2019 16:26:19 +0100
+
 wmbattery (2.51-2) unstable; urgency=medium
 
   * debian/compat
diff --minimal -Nru wmbattery-2.51/debian/patches/cross.patch wmbattery-2.51/debian/patches/cross.patch
--- wmbattery-2.51/debian/patches/cross.patch	1970-01-01 01:00:00.000000000 +0100
+++ wmbattery-2.51/debian/patches/cross.patch	2019-10-27 16:26:19.000000000 +0100
@@ -0,0 +1,33 @@
+--- wmbattery-2.51.orig/autoconf/makeinfo.in
++++ wmbattery-2.51/autoconf/makeinfo.in
+@@ -19,3 +19,5 @@
+ #USE_HAL		= 1
+ 
+ USE_UPOWER = 1
++UPOWER_GLIB_CFLAGS = @UPOWER_GLIB_CFLAGS@
++UPOWER_GLIB_LIBS   = @UPOWER_GLIB_LIBS@
+--- wmbattery-2.51.orig/configure.ac
++++ wmbattery-2.51/configure.ac
+@@ -47,4 +47,6 @@
+ AC_FUNC_VPRINTF
+ AC_CHECK_FUNCS(strdup)
+ 
++PKG_CHECK_MODULES([UPOWER_GLIB],[upower-glib])
++
+ AC_OUTPUT(makeinfo:autoconf/makeinfo.in)
+--- wmbattery-2.51.orig/Makefile
++++ wmbattery-2.51/Makefile
+@@ -29,11 +29,11 @@
+ endif
+ 
+ ifdef USE_UPOWER
+-LIBS+=$(shell pkg-config --libs upower-glib)
++LIBS+=$(UPOWER_GLIB_LIBS)
+ OBJS+=upower.o
+ CFLAGS+=-DUPOWER
+ upower.o: upower.c
+-	$(CC) $(CPPFLAGS) $(CFLAGS) $(shell pkg-config --cflags upower-glib) -c upower.c -o upower.o
++	$(CC) $(CPPFLAGS) $(CFLAGS) $(UPOWER_GLIB_CFLAGS) -c upower.c -o upower.o
+ endif
+ 
+ wmbattery: $(OBJS)
diff --minimal -Nru wmbattery-2.51/debian/patches/series wmbattery-2.51/debian/patches/series
--- wmbattery-2.51/debian/patches/series	2018-04-17 17:02:05.000000000 +0200
+++ wmbattery-2.51/debian/patches/series	2019-10-27 16:26:19.000000000 +0100
@@ -1 +1,2 @@
 manpage-typo.patch
+cross.patch
diff --minimal -Nru wmbattery-2.51/debian/rules wmbattery-2.51/debian/rules
--- wmbattery-2.51/debian/rules	2018-04-17 17:02:05.000000000 +0200
+++ wmbattery-2.51/debian/rules	2019-10-27 16:26:19.000000000 +0100
@@ -4,3 +4,7 @@
 
 %:
 	dh $@
+
+override_dh_auto_clean:
+	touch makeinfo config.status configure # prevent running ./configure
+	dh_auto_clean


More information about the Pkg-wmaker-devel mailing list