Source: package-update-indicator Version: 5-1 Tags: patch User: debian-cr...@lists.debian.org Usertags: ftcbfs
package-update-indicator fails to cross build from source, because debian/rules does not pass cross tools to make. The easiest way of doing so - using dh_auto_build - does not entirely fix the build. For one thing, the upstream Makefile hard codes the build architecture pkg-config. For another, it stuffs a compiler flag into the CC variable, which gets overridden by dh_auto_build. The flag should be moved to CFLAGS. Please consider applying the attached patch. Helmut
diff --minimal -Nru package-update-indicator-5/debian/changelog package-update-indicator-5/debian/changelog --- package-update-indicator-5/debian/changelog 2020-02-20 22:34:28.000000000 +0100 +++ package-update-indicator-5/debian/changelog 2020-06-04 06:39:22.000000000 +0200 @@ -1,3 +1,13 @@ +package-update-indicator (5-1.1) UNRELEASED; urgency=medium + + * Non-maintainer upload. + * Fix FTCBFS: (Closes: #-1) + + Let dh_auto_build pass cross tools to make. + + Don't stuff compiler flags into CC. + + Make pkg-config substitutable. + + -- Helmut Grohne <hel...@subdivi.de> Thu, 04 Jun 2020 06:39:22 +0200 + package-update-indicator (5-1) unstable; urgency=medium * New upstream version: 5 diff --minimal -Nru package-update-indicator-5/debian/patches/cross.patch package-update-indicator-5/debian/patches/cross.patch --- package-update-indicator-5/debian/patches/cross.patch 1970-01-01 01:00:00.000000000 +0100 +++ package-update-indicator-5/debian/patches/cross.patch 2020-06-04 06:39:12.000000000 +0200 @@ -0,0 +1,61 @@ +--- package-update-indicator-5.orig/Makefile ++++ package-update-indicator-5/Makefile +@@ -30,7 +30,7 @@ + BUG_ADDRESS = guido+...@berhoerster.name + + # gcc, clang, icc, Sun/Solaris Studio +-CC := $(CC) -std=c99 ++CFLAGS += -std=c99 + COMPILE.c = $(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) $(XCPPFLAGS) $(TARGET_ARCH) -c + # gcc, clang, icc + MAKEDEPEND.c = $(CC) -MM $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) $(XCPPFLAGS) +@@ -48,9 +48,10 @@ + PAX := pax + GZIP := gzip + SED := sed +-GLIB_COMPILE_SCHEMAS := $(shell pkg-config --variable=glib_compile_schemas gio-2.0) +-GLIB_COMPILE_RESOURCES := $(shell pkg-config --variable=glib_compile_resources gio-2.0) +-GLIB_MKENUMS := $(shell pkg-config --variable=glib_mkenums glib-2.0) ++PKG_CONFIG ?= pkg-config ++GLIB_COMPILE_SCHEMAS := $(shell $(PKG_CONFIG) --variable=glib_compile_schemas gio-2.0) ++GLIB_COMPILE_RESOURCES := $(shell $(PKG_CONFIG) --variable=glib_compile_resources gio-2.0) ++GLIB_MKENUMS := $(shell $(PKG_CONFIG) --variable=glib_mkenums glib-2.0) + XSLTPROC := xsltproc + DOCBOOK5_MANPAGES_STYLESHEET = http://docbook.sourceforge.net/release/xsl-ns/current/manpages/docbook.xsl + DOCBOOK5_MANPAGES_FLAGS = --stringparam man.authors.section.enabled 0 \ +@@ -71,9 +72,9 @@ + --keyword=g_dngettext:2,3 \ + --add-comments + INDICATOR_LIB := $(or \ +- $(shell pkg-config --exists appindicator3-0.1 && \ ++ $(shell $(PKG_CONFIG) --exists appindicator3-0.1 && \ + printf '%s\\\n' appindicator3-0.1), \ +- $(shell pkg-config --exists ayatana-appindicator3-0.1 && \ ++ $(shell $(PKG_CONFIG) --exists ayatana-appindicator3-0.1 && \ + printf '%s\\\n' ayatana-appindicator3-0.1), \ + appindicator3-0.1) + INDICATOR_FLAG := $(if $(findstring ayatana,$(INDICATOR_LIB)), \ +@@ -160,10 +161,10 @@ + -DSETTINGS_SCHEMA_ID=\"$(APPLICATION_ID)\" \ + -DI_KNOW_THE_PACKAGEKIT_GLIB2_API_IS_SUBJECT_TO_CHANGE \ + $(INDICATOR_FLAG) +-$(PACKAGE): XCFLAGS = $(shell pkg-config --cflags gtk+-3.0 \ ++$(PACKAGE): XCFLAGS = $(shell $(PKG_CONFIG) --cflags gtk+-3.0 \ + $(INDICATOR_LIB) packagekit-glib2 \ + polkit-gobject-1 upower-glib) +-$(PACKAGE): LDLIBS = $(shell pkg-config --libs gtk+-3.0 \ ++$(PACKAGE): LDLIBS = $(shell $(PKG_CONFIG) --libs gtk+-3.0 \ + $(INDICATOR_LIB) packagekit-glib2 \ + polkit-gobject-1 upower-glib) + +@@ -174,8 +175,8 @@ + -DPACKAGE_LOCALE_DIR="\"$(localedir)\"" \ + -DGETTEXT_PACKAGE=\"$(PACKAGE)\" \ + -DSETTINGS_SCHEMA_ID=\"$(APPLICATION_ID)\" +-$(PACKAGE)-prefs: XCFLAGS = $(shell pkg-config --cflags gtk+-3.0) +-$(PACKAGE)-prefs: LDLIBS = $(shell pkg-config --libs gtk+-3.0) ++$(PACKAGE)-prefs: XCFLAGS = $(shell $(PKG_CONFIG) --cflags gtk+-3.0) ++$(PACKAGE)-prefs: LDLIBS = $(shell $(PKG_CONFIG) --libs gtk+-3.0) + + ifneq ($(findstring $(OS_NAME),FreeBSD DragonFly OpenBSD),) + $(PACKAGE): XCPPFLAGS += -I/usr/local/include diff --minimal -Nru package-update-indicator-5/debian/patches/series package-update-indicator-5/debian/patches/series --- package-update-indicator-5/debian/patches/series 2018-12-16 17:16:18.000000000 +0100 +++ package-update-indicator-5/debian/patches/series 2020-06-04 06:37:55.000000000 +0200 @@ -1 +1,2 @@ 01_no-local-compiler-flags.patch +cross.patch diff --minimal -Nru package-update-indicator-5/debian/rules package-update-indicator-5/debian/rules --- package-update-indicator-5/debian/rules 2020-02-20 22:34:28.000000000 +0100 +++ package-update-indicator-5/debian/rules 2020-06-04 06:39:20.000000000 +0200 @@ -10,7 +10,7 @@ dh $@ override_dh_auto_build: - $(MAKE) all prefix=/usr + dh_auto_build -- all prefix=/usr override_dh_auto_install: $(MAKE) install DESTDIR=$(INSTALLDIR) prefix=/usr