Bug#968421: sane-airscan FTCBFS: build architecture build tools
Source: sane-airscan
Version: 0.99.13-1
Tags: patch upstream
User: debian-cross@lists.debian.org
Usertags: ftcbfs
sane-airscan fails to cross build from source for two reasons.
The first is using the build architecture pkg-config. The upstream
Makefile hard codes the build architecture pkg-config despite setting up
the standard PKG_CONFIG variable. All it needs to do here is use the
variable to pick up the correct pkg-config passed by dh_auto_build.
It also passes -s to install, which causes the build architecture strip
to be invoked. Beyond breaking cross compilation, this breaks generation
of -dbgsym packages and DEB_BUILD_OPTIONS=nostrip. It is best practice
to defer all stripping to dh_strip, which does the right thing. While
the upstream build system supports a way of avoiding that (passing an
empty STRIP variable), it would be nice if it would also support the
standard debhelper way. dh_auto_install passes an INSTALL that never
strips (even if requested via -s). Alternatively, adding an
override_dh_auto_install passing STRIP= to would also do.
Please consider applying the attached patch to fix all mentioned issues.
Helmut
--- sane-airscan-0.99.13.orig/Makefile
+++ sane-airscan-0.99.13/Makefile
@@ -21,6 +21,7 @@
MANDIR = /usr/share/man/
PKG_CONFIG = /usr/bin/pkg-config
STRIP = -s
+INSTALL = install
# These variables are not intended to be user-settable
OBJDIR = objs/
@@ -42,11 +43,11 @@
OBJ = $(addprefix $(OBJDIR), $(SRC:.c=.o))
# Obtain CFLAGS and LDFLAGS for dependencies
-deps_CFLAGS := $(foreach lib, $(DEPS_COMMON), $(shell pkg-config --cflags $(lib)))
-deps_CFLAGS += $(foreach lib, $(DEPS_CODECS), $(shell pkg-config --cflags $(lib)))
+deps_CFLAGS := $(foreach lib, $(DEPS_COMMON), $(shell $(PKG_CONFIG) --cflags $(lib)))
+deps_CFLAGS += $(foreach lib, $(DEPS_CODECS), $(shell $(PKG_CONFIG) --cflags $(lib)))
-deps_LIBS := $(foreach lib, $(DEPS_COMMON), $(shell pkg-config --libs $(lib))) -lm
-deps_LIBS_CODECS := $(foreach lib, $(DEPS_CODECS), $(shell pkg-config --libs $(lib)))
+deps_LIBS := $(foreach lib, $(DEPS_COMMON), $(shell $(PKG_CONFIG) --libs $(lib))) -lm
+deps_LIBS_CODECS := $(foreach lib, $(DEPS_CODECS), $(shell $(PKG_CONFIG) --libs $(lib)))
# Compute CFLAGS and LDFLAGS for backend and tools
#
@@ -89,13 +90,13 @@
mkdir -p $(DESTDIR)$(PREFIX)$(BINDIR)
mkdir -p $(DESTDIR)$(PREFIX)$(CONFDIR)
mkdir -p $(DESTDIR)$(PREFIX)$(CONFDIR)/dll.d
- install $(STRIP) -D -t $(DESTDIR)$(PREFIX)$(BINDIR) $(DISCOVER)
+ $(INSTALL) $(STRIP) -D -t $(DESTDIR)$(PREFIX)$(BINDIR) $(DISCOVER)
cp -n airscan.conf $(DESTDIR)$(PREFIX)$(CONFDIR)
cp -n dll.conf $(DESTDIR)$(PREFIX)$(CONFDIR)/dll.d/airscan
- install $(STRIP) -D -t $(DESTDIR)$(PREFIX)$(LIBDIR)/sane $(BACKEND)
+ $(INSTALL) $(STRIP) -D -t $(DESTDIR)$(PREFIX)$(LIBDIR)/sane $(BACKEND)
mkdir -p $(DESTDIR)$(PREFIX)/$(MANDIR)/man5
- install -m 644 -D -t $(DESTDIR)$(PREFIX)$(MANDIR)/man1 $(MAN_DISCOVER)
- install -m 644 -D -t $(DESTDIR)$(PREFIX)$(MANDIR)/man5 $(MAN_BACKEND)
+ $(INSTALL) -m 644 -D -t $(DESTDIR)$(PREFIX)$(MANDIR)/man1 $(MAN_DISCOVER)
+ $(INSTALL) -m 644 -D -t $(DESTDIR)$(PREFIX)$(MANDIR)/man5 $(MAN_BACKEND)
[ "$(COMPRESS)" = "" ] || $(COMPRESS) -f $(DESTDIR)$(PREFIX)$(MANDIR)/man1/$(MAN_DISCOVER)
[ "$(COMPRESS)" = "" ] || $(COMPRESS) -f $(DESTDIR)$(PREFIX)$(MANDIR)/man5/$(MAN_BACKEND)
Reply to: