Source: pngquant Version: 2.5.0-2 Tags: patch User: [email protected] Usertags: rebootstrap
pngquant fails to cross build from source. It starts with using the build architecture compiler. Using dpkg's buildtools.mk fixes that as ./configure recognizes CC. Then the SSE detection checks the build architecture, but it should check the host architecture. Finally, ./configure hard codes the build architecture pkg-config. The attached patch fixes all of that and makes pngquant cross buildable. Please consider applying the attached patch. Helmut
diff --minimal -Nru pngquant-2.5.0/debian/changelog pngquant-2.5.0/debian/changelog --- pngquant-2.5.0/debian/changelog 2017-06-01 10:05:51.000000000 +0200 +++ pngquant-2.5.0/debian/changelog 2018-06-27 19:20:19.000000000 +0200 @@ -1,3 +1,13 @@ +pngquant (2.5.0-2.1) UNRELEASED; urgency=medium + + * Non-maintainer upload. + * Fix FTCBFS: (Closes: #-1) + + Let SSEFLAG depend on the host architecture, not build architecture. + + Use buildtools.mk to supply cross tools to ./configure. + + cross.patch: Don't hard code the build architecture pkg-config. + + -- Helmut Grohne <[email protected]> Wed, 27 Jun 2018 19:20:19 +0200 + pngquant (2.5.0-2) unstable; urgency=medium * Fix CVE-2016-5735 (Thanks for the patch to Emilio Pozuelo diff --minimal -Nru pngquant-2.5.0/debian/patches/cross.patch pngquant-2.5.0/debian/patches/cross.patch --- pngquant-2.5.0/debian/patches/cross.patch 1970-01-01 01:00:00.000000000 +0100 +++ pngquant-2.5.0/debian/patches/cross.patch 2018-06-27 19:18:58.000000000 +0200 @@ -0,0 +1,25 @@ +--- pngquant-2.5.0.orig/configure ++++ pngquant-2.5.0/configure +@@ -20,6 +20,7 @@ + + # make gcc default compiler unless CC is already set + CC=${CC:-gcc} ++PKG_CONFIG=${PKG_CONFIG:-pkg-config} + + help() { + printf "%4s %s\n" "" "$1" +@@ -147,10 +148,10 @@ + + find_pkgconfig() { + LIBNAME=$1 +- if pkg-config --exists "$LIBNAME" &> /dev/null; then +- cflags "$(pkg-config --cflags "$LIBNAME")" +- lflags "$(pkg-config --libs "$LIBNAME")" +- status "$LIBNAME" "shared ($(pkg-config --modversion "$LIBNAME"))" ++ if $PKG_CONFIG --exists "$LIBNAME" &> /dev/null; then ++ cflags "$($PKG_CONFIG --cflags "$LIBNAME")" ++ lflags "$($PKG_CONFIG --libs "$LIBNAME")" ++ status "$LIBNAME" "shared ($($PKG_CONFIG --modversion "$LIBNAME"))" + return 0 + fi + return 1 diff --minimal -Nru pngquant-2.5.0/debian/patches/series pngquant-2.5.0/debian/patches/series --- pngquant-2.5.0/debian/patches/series 2017-05-31 22:08:30.000000000 +0200 +++ pngquant-2.5.0/debian/patches/series 2018-06-27 19:18:06.000000000 +0200 @@ -1 +1,2 @@ CVE-2016-5735.patch +cross.patch diff --minimal -Nru pngquant-2.5.0/debian/rules pngquant-2.5.0/debian/rules --- pngquant-2.5.0/debian/rules 2015-07-27 09:54:49.000000000 +0200 +++ pngquant-2.5.0/debian/rules 2018-06-27 19:17:36.000000000 +0200 @@ -1,6 +1,13 @@ #!/usr/bin/make -f -SSEFLAG=$(shell if grep -q "^flags.*sse" /proc/cpuinfo ; then echo "--enable-sse" ; else echo "--disable-sse" ; fi) +include /usr/share/dpkg/architecture.mk +DPKG_EXPORT_BUILDTOOLS=1 +-include /usr/share/dpkg/buildtools.mk +ifeq ($(DEB_HOST_ARCH_CPU),amd64) +SSEFLAG=--enable-sse +else +SSEFLAG=--disable-sse +endif %: dh $@

