Source: sleepd
Version: 2.15
Tags: patch upstream
User: [email protected]
Usertags: ftcbfs

sleepd fails to cross build from source, because the upstream Makefile 
hard codes the build architecture pkg-config. Once making it 
substitutable, it cross builds successfully, because dh_auto_build 
substitutes it correctly. I'm attaching a patch for your convenience.

Helmut
--- sleepd-2.15+nmu1.orig/Makefile
+++ sleepd-2.15+nmu1/Makefile
@@ -1,3 +1,4 @@
+PKG_CONFIG ?= pkg-config
 CFLAGS     ?= -O2 -g -Wall
 CFLAGS     += -DACPI_APM -pthread
 BINS        = sleepd sleepctl
@@ -13,19 +14,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

Reply via email to