--- Begin Message ---
- To: Debian Bug Tracking System <submit@bugs.debian.org>
- Subject: cups FTCBFS: runs host architecture utilities during build
- From: Helmut Grohne <helmut@subdivi.de>
- Date: Thu, 15 Sep 2016 19:22:20 +0200
- Message-id: <20160915172219.fe7i2dwyonh3hvql@alf.mars>
Source: cups
Version: 2.1.4-4
Tags: patch
User: helmutg@debian.org
Usertags: rebootstrap
cups fails to cross build from source, because it runs host architecture
utilities during build. Otherwise, its cross build support is fairly
complete and cups is not a small or simple package, thus fairly
impressive. The two tools that are being run are genstrings and
mantohtml. For genstrings, I figured that its output is not installed
into any binary package, so we can simply stop running it. I updated
mantohtml to not required any other cups component, which makes it
possible to build it with a different compiler. Please consider applying
the attached patch as it makes cups cross build just fine.
Helmut
diff --minimal -Nru cups-2.1.4/debian/changelog cups-2.1.4/debian/changelog
--- cups-2.1.4/debian/changelog 2016-07-11 13:19:14.000000000 +0200
+++ cups-2.1.4/debian/changelog 2016-09-15 19:18:13.000000000 +0200
@@ -1,3 +1,12 @@
+cups (2.1.4-4.1) UNRELEASED; urgency=medium
+
+ * Non-maintainer upload.
+ * Fix FTCBFS: (Closes: #-1)
+ + cross-skip-genstrings-sample.patch: Don't run genstrings
+ + cross-mantohtml.patch: Build mantohtml with CC_FOR_BUILD
+
+ -- Helmut Grohne <helmut@subdivi.de> Thu, 15 Sep 2016 07:59:16 +0200
+
cups (2.1.4-4) unstable; urgency=medium
* Patch a final lpstat call to really make the build reproducible when built
diff --minimal -Nru cups-2.1.4/debian/patches/cross-mantohtml.patch cups-2.1.4/debian/patches/cross-mantohtml.patch
--- cups-2.1.4/debian/patches/cross-mantohtml.patch 1970-01-01 01:00:00.000000000 +0100
+++ cups-2.1.4/debian/patches/cross-mantohtml.patch 2016-09-15 19:17:27.000000000 +0200
@@ -0,0 +1,105 @@
+From: Helmut Grohne <helmut@subdivi.de>
+Subject: build mantohtml with the build architecture compiler
+
+mantohtml is run during build. Thus it needs to be built with the build
+architecture compiler (or execution fails). The obvious part is switching to
+CC_FOR_BUILD. That also depends on it not requiring any other cups components.
+In particular, removing uses of strlcpy and replacing host architecture-
+specific includes is thus needed.
+
+Index: cups-2.1.4/man/mantohtml.c
+===================================================================
+--- cups-2.1.4.orig/man/mantohtml.c
++++ cups-2.1.4/man/mantohtml.c
+@@ -17,8 +17,10 @@
+ * Include necessary headers.
+ */
+
+-#include <cups/string-private.h>
+-#include <cups/array-private.h>
++#include <ctype.h>
++#include <stdio.h>
++#include <stdlib.h>
++#include <string.h>
+ #include <unistd.h>
+
+
+@@ -817,7 +819,8 @@
+ * Anchor for HTML output...
+ */
+
+- strlcpy(anchor, line + 4, sizeof(anchor));
++ strncpy(anchor, line + 4, sizeof(anchor) - 1);
++ anchor[sizeof(anchor) - 1] = '\0';
+ }
+ else if (strncmp(line, ".\\\"", 3))
+ {
+@@ -946,7 +949,8 @@
+ manfile[1024], /* Man page filename */
+ manurl[1024]; /* Man page URL */
+
+- strlcpy(name, s, sizeof(name));
++ strncpy(name, s, sizeof(name) - 1);
++ name[sizeof(name) - 1] = '\0';
+ if ((size_t)(end - s) < sizeof(name))
+ name[end - s] = '\0';
+
+@@ -1175,7 +1179,8 @@
+ if (end[-1] == ',' || end[-1] == '.' || end[-1] == ')')
+ end --;
+
+- strlcpy(temp, s, sizeof(temp));
++ strncpy(temp, s, sizeof(temp) - 1);
++ temp[sizeof(temp) - 1] = '\0';
+ if ((size_t)(end -s) < sizeof(temp))
+ temp[end - s] = '\0';
+
+Index: cups-2.1.4/man/Makefile
+===================================================================
+--- cups-2.1.4.orig/man/Makefile
++++ cups-2.1.4/man/Makefile
+@@ -234,10 +234,8 @@
+ ./mantohtml `basename $$file .$(MAN8EXT)`.man >../doc/help/man-`basename $$file .$(MAN8EXT)`.html; \
+ done
+
+-mantohtml: mantohtml.o ../cups/$(LIBCUPSSTATIC)
+- $(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ mantohtml.o \
+- ../cups/$(LIBCUPSSTATIC) $(LIBGSSAPI) $(SSLLIBS) \
+- $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
++mantohtml: mantohtml.c
++ $(CC_FOR_BUILD) -o $@ $<
+
+
+ #
+Index: cups-2.1.4/configure.ac
+===================================================================
+--- cups-2.1.4.orig/configure.ac
++++ cups-2.1.4/configure.ac
+@@ -24,6 +24,15 @@
+ sinclude(config-scripts/cups-directories.m4)
+ sinclude(config-scripts/cups-manpages.m4)
+
++AC_MSG_CHECKING([for build system compiler])
++if test "$cross_compiling" = yes; then
++ CC_FOR_BUILD=${CC_FOR_BUILD-cc}
++else
++ CC_FOR_BUILD=${CC}
++fi
++AC_MSG_RESULT(${CC_FOR_BUILD})
++AC_SUBST(CC_FOR_BUILD)
++
+ sinclude(config-scripts/cups-sharedlibs.m4)
+ sinclude(config-scripts/cups-libtool.m4)
+ sinclude(config-scripts/cups-compiler.m4)
+Index: cups-2.1.4/Makedefs.in
+===================================================================
+--- cups-2.1.4.orig/Makedefs.in
++++ cups-2.1.4/Makedefs.in
+@@ -20,6 +20,7 @@
+ AR = @AR@
+ AWK = @AWK@
+ CC = @LIBTOOL@ @CC@
++CC_FOR_BUILD = @CC_FOR_BUILD@
+ CHMOD = @CHMOD@
+ CXX = @LIBTOOL@ @CXX@
+ DSO = @DSO@
diff --minimal -Nru cups-2.1.4/debian/patches/cross-skip-genstrings-sample.patch cups-2.1.4/debian/patches/cross-skip-genstrings-sample.patch
--- cups-2.1.4/debian/patches/cross-skip-genstrings-sample.patch 1970-01-01 01:00:00.000000000 +0100
+++ cups-2.1.4/debian/patches/cross-skip-genstrings-sample.patch 2016-09-15 07:59:13.000000000 +0200
@@ -0,0 +1,20 @@
+From: Helmut Grohne <helmut@subdivi.de>
+Subject: Do not execute genstrings during build
+
+We cannot run genstrings during build, because it is compiled for the host
+architecture. Fortunately, the generated file sample.c is neither processed any
+further nor installed. Thus skipping it is ok.
+
+Index: cups-2.1.4/ppdc/Makefile
+===================================================================
+--- cups-2.1.4.orig/ppdc/Makefile
++++ cups-2.1.4/ppdc/Makefile
+@@ -242,8 +242,6 @@
+ $(CXX) $(ARCHFLAGS) $(LDFLAGS) -o genstrings genstrings.o \
+ -lcupsppdc ../cups/$(LIBCUPSSTATIC) $(LIBGSSAPI) $(SSLLIBS) \
+ $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
+- echo Generating localization strings...
+- LD_LIBRARY_PATH=.:../cups/ ./genstrings >sample.c
+
+
+ #
diff --minimal -Nru cups-2.1.4/debian/patches/series cups-2.1.4/debian/patches/series
--- cups-2.1.4/debian/patches/series 2016-07-07 14:53:11.000000000 +0200
+++ cups-2.1.4/debian/patches/series 2016-09-15 08:18:59.000000000 +0200
@@ -55,3 +55,5 @@
# po4a might not be appropriate. It also needs to be high on the patch
# queue to catch all Debian-specific changes
manpage-translations.patch
+cross-skip-genstrings-sample.patch
+cross-mantohtml.patch
--- End Message ---
--- Begin Message ---
Source: cups
Source-Version: 2.2.1-1
We believe that the bug you reported is fixed in the latest version of
cups, which is due to be installed in the Debian FTP archive.
A summary of the changes between this version and the previous one is
attached.
Thank you for reporting the bug, which will now be closed. If you
have further comments please address them to 837936@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.
Debian distribution maintenance software
pp.
Didier Raboud <odyx@debian.org> (supplier of updated cups package)
(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
Format: 1.8
Date: Wed, 05 Oct 2016 11:32:06 +0200
Source: cups
Binary: libcups2 libcupsimage2 libcupscgi1 libcupsmime1 libcupsppdc1 cups cups-core-drivers cups-daemon cups-client cups-ipp-utils libcups2-dev libcupsimage2-dev cups-bsd cups-common cups-server-common cups-ppdc
Architecture: source
Version: 2.2.1-1
Distribution: unstable
Urgency: medium
Maintainer: Debian Printing Team <debian-printing@lists.debian.org>
Changed-By: Didier Raboud <odyx@debian.org>
Description:
cups - Common UNIX Printing System(tm) - PPD/driver support, web interfa
cups-bsd - Common UNIX Printing System(tm) - BSD commands
cups-client - Common UNIX Printing System(tm) - client programs (SysV)
cups-common - Common UNIX Printing System(tm) - common files
cups-core-drivers - Common UNIX Printing System(tm) - PPD-less printing
cups-daemon - Common UNIX Printing System(tm) - daemon
cups-ipp-utils - Common UNIX Printing System(tm) - IPP developer/admin utilities
cups-ppdc - Common UNIX Printing System(tm) - PPD manipulation utilities
cups-server-common - Common UNIX Printing System(tm) - server common files
libcups2 - Common UNIX Printing System(tm) - Core library
libcups2-dev - Common UNIX Printing System(tm) - Development files CUPS library
libcupscgi1 - Common UNIX Printing System(tm) - CGI library
libcupsimage2 - Common UNIX Printing System(tm) - Raster image library
libcupsimage2-dev - Common UNIX Printing System(tm) - Development files CUPS image li
libcupsmime1 - Common UNIX Printing System(tm) - MIME library
libcupsppdc1 - Common UNIX Printing System(tm) - PPD manipulation library
Closes: 711697 837936 838854
Changes:
cups (2.2.1-1) unstable; urgency=medium
.
* New 2.2.1 upstream release
- Updated man pages (PR #4885, Closes: #838854)
.
[ Helge Kreutzmann ]
* Update German man page
.
[ Didier Raboud ]
* Demote libcupsfilters{1,-dev} dependencies to recommends (Closes: #711697)
* Remove lsb Depends from cups, bump cups-daemon's to 3.2-14~
.
[ Helmut Grohne ]
* Fix FTCBFS (Closes: #837936)
- Build mantohtml with the build architecture compiler
- Do not execute genstrings during build
Checksums-Sha1:
079d541e07502d486ff1f8ca8195c6e985392474 3367 cups_2.2.1-1.dsc
80d00096ace2da2c0cbc0f8c160f8f84adece9b0 9486635 cups_2.2.1.orig.tar.gz
89c399b8d37ee5307a6ffec767fa1f0540962c17 797 cups_2.2.1.orig.tar.gz.asc
fd50aa119eeaf1d6428a22cc01a3be413be4c680 361248 cups_2.2.1-1.debian.tar.xz
Checksums-Sha256:
cfe0ea5c1e914e1d9fa9fa3aa22bd4b90599a9e9dddf701a048ec0b2afda1d50 3367 cups_2.2.1-1.dsc
83b8730aa977cc055e7410df6a3a682548994c113994ca630a16513017e419d5 9486635 cups_2.2.1.orig.tar.gz
37c2e6215b2794c33864e543bc0caf6aefa724844e41b4c9659c87f28d125c2a 797 cups_2.2.1.orig.tar.gz.asc
3893854db828c20468b15c7a28295e54fdee7507e0e6ba57b697ad1408ba18d7 361248 cups_2.2.1-1.debian.tar.xz
Files:
f13b15af15f9ba8812f5dd5a5a3408c1 3367 net optional cups_2.2.1-1.dsc
a94da2a1e9dbdccb4f3836a38a431931 9486635 net optional cups_2.2.1.orig.tar.gz
499e3666442fdeda4d9caf3e483b8a46 797 net optional cups_2.2.1.orig.tar.gz.asc
5f362be6f03705f32a377cc3458a1c13 361248 net optional cups_2.2.1-1.debian.tar.xz
-----BEGIN PGP SIGNATURE-----
iQGcBAEBCgAGBQJX9M1ZAAoJEIvPpx7KFjRVCmAMAJqHXDZd4swRQ+lzTQm7yVqg
pbKPNE3RAPi19CTCbamISLG+kn3J5/qtiXEcdl3V4LR7o0ErBcnkDnFevYoFFgXA
V8UDLaLeKbruEgDBINuFxMtJQe/DlNCn14LE0zA/bhf4IQ++qMfRgvftkY1ASQ2i
Muw/CQ/qAG6DzJYgA9gYHxDIFkBAagr0s23WmP4vLG8Z+mC1eOPXNCuNoe9tUeBC
vQbBmO/ek6AnBcyDiDGNKMatJMNkHTOCspOaKJhe/xFUxzPVscQUVwDPBQHOg50N
tGMLuxF7Gk6WwXiNFJTXgKcCEYgAPyPp5CuNf4WU4LZqL5DD+fhf1oL8rjQPqjKv
3dvbjcaaedOiVHZ6YF4fVi7WPrVPwyGIsq9q9lUBGkjSOh4YW+V0cCy+mOOFHa9f
NcBDqQACDWHVAXJ4FrDx3RZjtY7n/AIKJGnh3aFUoVjNVMH/dYfuQPWJMqU4vzlk
gka//YNEQ/E6vpIRYc76ma2kSGinRtLfWfAcjFe8uQ==
=dllm
-----END PGP SIGNATURE-----
--- End Message ---