Source: sleepd Version: 2.11 Tags: patch User: debian-cr...@lists.debian.org Usertags: ftcbfs
sleepd fails to cross build from source, because its upstream Makefile hard codes the build architecture pkg-config. After making it substitutable, it continues to fail by invoking the build architecture strip via install -s. Using dh_auto_install normally helps here, but it substitutes INSTALL whereas the Makefile uses INSTALL_PROGRAM. Chaining that substitution finally fixes the cross build. Please consider applying the attached patch. Helmut
diff --minimal -Nru sleepd-2.11/Makefile sleepd-2.12/Makefile --- sleepd-2.11/Makefile 2020-05-29 16:04:18.000000000 +0200 +++ sleepd-2.12/Makefile 2021-04-28 21:11:04.000000000 +0200 @@ -1,8 +1,10 @@ +PKG_CONFIG ?= pkg-config CFLAGS ?= -O2 -g -Wall CFLAGS += -DACPI_APM -pthread BINS = sleepd sleepctl PREFIX = / -INSTALL_PROGRAM = install +INSTALL = install +INSTALL_PROGRAM = $(INSTALL) # USE_HAL = 1 # USE_APM = 1 # USE_UPOWER = 1 @@ -23,19 +25,19 @@ all: $(BINS) ifdef USE_HAL -LIBS+=$(shell pkg-config --libs hal) +LIBS+=$(shell $(PKG_CONFIG) --libs hal) OBJS+=simplehal.o CFLAGS+=-DHAL simplehal.o: simplehal.c - $(CC) $(CPPFLAGS) $(CFLAGS) $(shell pkg-config --cflags hal) -c simplehal.c -o simplehal.o + $(CC) $(CPPFLAGS) $(CFLAGS) $(shell $(PKG_CONFIG) --cflags hal) -c simplehal.c -o simplehal.o endif ifdef USE_UPOWER -LIBS+=$(shell pkg-config --libs upower-glib) +LIBS+=$(shell $(PKG_CONFIG) --libs upower-glib) 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) $(shell $(PKG_CONFIG) --cflags upower-glib) -c upower.c -o upower.o endif ifdef USE_APM diff --minimal -Nru sleepd-2.11/debian/changelog sleepd-2.12/debian/changelog --- sleepd-2.11/debian/changelog 2020-05-29 19:24:44.000000000 +0200 +++ sleepd-2.12/debian/changelog 2021-04-28 21:11:04.000000000 +0200 @@ -1,3 +1,12 @@ +sleepd (2.12) UNRELEASED; urgency=medium + + * Fix FTCBFS: (Closes: #-1) + + Make pkg-config substitutable. + + Make install substitutable. + + Let dh_auto_install substitute a non-stripping install. + + -- Helmut Grohne <hel...@subdivi.de> Wed, 28 Apr 2021 21:11:04 +0200 + sleepd (2.11) unstable; urgency=medium * QA upload. diff --minimal -Nru sleepd-2.11/debian/rules sleepd-2.12/debian/rules --- sleepd-2.11/debian/rules 2020-05-29 16:04:18.000000000 +0200 +++ sleepd-2.12/debian/rules 2021-04-28 21:11:04.000000000 +0200 @@ -6,7 +6,7 @@ dh_auto_build -- USE_UPOWER=1 override_dh_auto_install: - $(MAKE) install PREFIX=debian/sleepd + dh_auto_install -- PREFIX=debian/sleepd override_dh_fixperms: dh_fixperms -X sleepctl