Source: dunst
Version: 1.3.0-3
Tags: patch
User: helm...@debian.org
Usertags: rebootstrap

dunst fails to cross build from source, because it uses the build
architecture pkg-config. The upstream Makefile hard codes plain
"pkg-config" and that fails to find the relevant .pc files. Making it
substitutable via $PKG_CONFIG partially solves that, but the Makefile
wants a working pkg-config even for make distclean, but debhelper only
supplies it for dh_auto_build. Thus debian/rules needs to export it
explicitly. After doing both, dunst cross builds successfully. Please
consider applying the attached patch.

Helmut
diff --minimal -Nru dunst-1.3.0/debian/changelog dunst-1.3.0/debian/changelog
--- dunst-1.3.0/debian/changelog        2018-08-05 19:27:16.000000000 +0200
+++ dunst-1.3.0/debian/changelog        2018-10-14 11:43:02.000000000 +0200
@@ -1,3 +1,12 @@
+dunst (1.3.0-3.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix FTCBFS: (Closes: #-1)
+    + cross.patch: Make pkg-config substitutable.
+    + rules: Supply $PKG_CONFIG for all targets.
+
+ -- Helmut Grohne <hel...@subdivi.de>  Sun, 14 Oct 2018 11:43:02 +0200
+
 dunst (1.3.0-3) unstable; urgency=medium
 
   [ Pascal De Vuyst ]
diff --minimal -Nru dunst-1.3.0/debian/patches/cross.patch 
dunst-1.3.0/debian/patches/cross.patch
--- dunst-1.3.0/debian/patches/cross.patch      1970-01-01 01:00:00.000000000 
+0100
+++ dunst-1.3.0/debian/patches/cross.patch      2018-10-14 11:42:21.000000000 
+0200
@@ -0,0 +1,39 @@
+--- dunst-1.3.0.orig/Makefile
++++ dunst-1.3.0/Makefile
+@@ -19,22 +19,22 @@
+ endif
+ endif
+ 
+-SERVICEDIR_DBUS ?= $(shell pkg-config dbus-1 
--variable=session_bus_services_dir)
++SERVICEDIR_DBUS ?= $(shell $(PKG_CONFIG) dbus-1 
--variable=session_bus_services_dir)
+ SERVICEDIR_DBUS := ${SERVICEDIR_DBUS}
+ ifeq (,${SERVICEDIR_DBUS})
+ $(error "Failed to query pkg-config for package 'dbus-1'!")
+ endif
+ 
+ ifneq (0,${SYSTEMD})
+-SERVICEDIR_SYSTEMD ?= $(shell pkg-config systemd 
--variable=systemduserunitdir)
++SERVICEDIR_SYSTEMD ?= $(shell $(PKG_CONFIG) systemd 
--variable=systemduserunitdir)
+ SERVICEDIR_SYSTEMD := ${SERVICEDIR_SYSTEMD}
+ ifeq (,${SERVICEDIR_SYSTEMD})
+ $(error "Failed to query pkg-config for package 'systemd'!")
+ endif
+ endif
+ 
+-LIBS := $(shell pkg-config --libs   ${pkg_config_packs})
+-INCS := $(shell pkg-config --cflags ${pkg_config_packs})
++LIBS := $(shell $(PKG_CONFIG) --libs   ${pkg_config_packs})
++INCS := $(shell $(PKG_CONFIG) --cflags ${pkg_config_packs})
+ 
+ ifneq (clean, $(MAKECMDGOALS))
+ ifeq ($(and $(INCS),$(LIBS)),)
+--- dunst-1.3.0.orig/config.mk
++++ dunst-1.3.0/config.mk
+@@ -19,6 +19,7 @@
+ CFLAGS_DEBUG   := -O0
+ LDFLAGS_DEBUG  :=
+ 
++PKG_CONFIG ?= pkg-config
+ pkg_config_packs := dbus-1 \
+                     gio-2.0 \
+                     gdk-pixbuf-2.0 \
diff --minimal -Nru dunst-1.3.0/debian/patches/series 
dunst-1.3.0/debian/patches/series
--- dunst-1.3.0/debian/patches/series   2018-08-05 19:27:16.000000000 +0200
+++ dunst-1.3.0/debian/patches/series   2018-10-14 11:37:20.000000000 +0200
@@ -1,2 +1,3 @@
 example_path.patch
 makefile.patch
+cross.patch
diff --minimal -Nru dunst-1.3.0/debian/rules dunst-1.3.0/debian/rules
--- dunst-1.3.0/debian/rules    2018-08-05 19:27:16.000000000 +0200
+++ dunst-1.3.0/debian/rules    2018-10-14 11:43:02.000000000 +0200
@@ -12,6 +12,8 @@
 export DEB_BUILD_MAINT_OPTIONS = hardening=+all
 DPKG_EXPORT_BUILDFLAGS = 1
 include /usr/share/dpkg/buildflags.mk
+-include /usr/share/dpkg/buildtools.mk
+export PKG_CONFIG ?= pkg-config
 
 override_dh_auto_install:
        dh_auto_install -- PREFIX=/usr

Reply via email to