diff -Nru libgpg-error-1.21/debian/changelog libgpg-error-1.21/debian/changelog --- libgpg-error-1.21/debian/changelog 2015-12-15 15:43:23.000000000 +0000 +++ libgpg-error-1.21/debian/changelog 2016-02-18 11:35:58.000000000 +0000 @@ -1,3 +1,17 @@ +libgpg-error (1.21-2ubuntu1) xenial; urgency=medium + + * Don't build the libgpg-error-mingw-w64-dev package (mingw64 is in universe). + + -- Matthias Klose Thu, 18 Feb 2016 12:35:30 +0100 + +libgpg-error (1.21-2) unstable; urgency=medium + + * build out-of-tree for cleanliness + * added libgpg-error-mingw-w64-dev package, in preparation for + cross-building win32-loader component gpgv.exe + + -- Daniel Kahn Gillmor Mon, 08 Feb 2016 22:50:50 -0500 + libgpg-error (1.21-1) unstable; urgency=medium * New upstream release. diff -Nru libgpg-error-1.21/debian/clean libgpg-error-1.21/debian/clean --- libgpg-error-1.21/debian/clean 2015-09-17 01:40:00.000000000 +0000 +++ libgpg-error-1.21/debian/clean 2016-02-16 06:09:57.000000000 +0000 @@ -2,3 +2,6 @@ debian/libgpg-error-dev.install po/*.gmo po/stamp-po +build-x86_64-w64-mingw32/ +build-i686-w64-mingw32/ +build/ diff -Nru libgpg-error-1.21/debian/libgpg-error-dev.lintian-overrides libgpg-error-1.21/debian/libgpg-error-dev.lintian-overrides --- libgpg-error-1.21/debian/libgpg-error-dev.lintian-overrides 1970-01-01 00:00:00.000000000 +0000 +++ libgpg-error-1.21/debian/libgpg-error-dev.lintian-overrides 2016-02-10 04:18:44.000000000 +0000 @@ -0,0 +1,5 @@ +# this is an ongoing discussion with upstream, with little likely to change any time soon: +# see: https://bugs.debian.org/643341 +# and: http://lists.gnupg.org/pipermail/gnupg-devel/2014-May/028473.html +libgpg-error-dev: old-style-config-script usr/bin/gpg-error-config +libgpg-error-dev: old-style-config-script-multiarch-path usr/bin/gpg-error-config full text contains architecture specific dir x86_64-linux-gnu diff -Nru libgpg-error-1.21/debian/libgpg-error-dev.manpages libgpg-error-1.21/debian/libgpg-error-dev.manpages --- libgpg-error-1.21/debian/libgpg-error-dev.manpages 2015-09-17 01:40:00.000000000 +0000 +++ libgpg-error-1.21/debian/libgpg-error-dev.manpages 2016-02-10 04:18:44.000000000 +0000 @@ -1,2 +1,2 @@ -debian/tmp/usr/share/man/man1/gpg-error-config.1 debian/gpg-error.1 +debian/tmp/usr/share/man/man1/gpg-error-config.1 diff -Nru libgpg-error-1.21/debian/libgpg-error-mingw-w64-dev.install libgpg-error-1.21/debian/libgpg-error-mingw-w64-dev.install --- libgpg-error-1.21/debian/libgpg-error-mingw-w64-dev.install 1970-01-01 00:00:00.000000000 +0000 +++ libgpg-error-1.21/debian/libgpg-error-mingw-w64-dev.install 2016-02-16 06:09:57.000000000 +0000 @@ -0,0 +1,6 @@ +usr/x86_64-w64-mingw32/bin/* +usr/x86_64-w64-mingw32/include/* +usr/x86_64-w64-mingw32/lib/* +usr/i686-w64-mingw32/bin/* +usr/i686-w64-mingw32/include/* +usr/i686-w64-mingw32/lib/* diff -Nru libgpg-error-1.21/debian/libgpg-error-mingw-w64-dev.lintian-overrides libgpg-error-1.21/debian/libgpg-error-mingw-w64-dev.lintian-overrides --- libgpg-error-1.21/debian/libgpg-error-mingw-w64-dev.lintian-overrides 1970-01-01 00:00:00.000000000 +0000 +++ libgpg-error-1.21/debian/libgpg-error-mingw-w64-dev.lintian-overrides 2016-02-16 06:09:57.000000000 +0000 @@ -0,0 +1,13 @@ +# libgpg-error-mingw-w64-dev is "arch-independent" from debian's perspective, +# since it ships binaries that are only used during cross-building +# windows software. +libgpg-error-mingw-w64-dev: arch-independent-package-contains-binary-or-object + +# The location of these cross-building tools is the result of +# discussion with mingw maintainers: +# https://lists.alioth.debian.org/pipermail/pkg-gnupg-maint/2016-February/003281.html +libgpg-error-mingw-w64-dev: file-in-unusual-dir +libgpg-error-mingw-w64-dev: non-standard-dir-in-usr + +# DLLs exported via Samba need to be executable (see #796224) +libgpg-error-mingw-w64-dev: executable-not-elf-or-script diff -Nru libgpg-error-1.21/debian/patches/0001-avoid-identifying-as-beta.patch libgpg-error-1.21/debian/patches/0001-avoid-identifying-as-beta.patch --- libgpg-error-1.21/debian/patches/0001-avoid-identifying-as-beta.patch 2015-09-17 01:40:00.000000000 +0000 +++ libgpg-error-1.21/debian/patches/0001-avoid-identifying-as-beta.patch 2016-02-10 04:18:44.000000000 +0000 @@ -11,7 +11,7 @@ 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac -index ec8d112..05b40de 100644 +index a8e09cf..8b83c2c 100644 --- a/configure.ac +++ b/configure.ac @@ -40,7 +40,7 @@ m4_define([mym4_revision_dec], diff -Nru libgpg-error-1.21/debian/patches/0002-Measure-revision-by-length-of-debian-changelog.patch libgpg-error-1.21/debian/patches/0002-Measure-revision-by-length-of-debian-changelog.patch --- libgpg-error-1.21/debian/patches/0002-Measure-revision-by-length-of-debian-changelog.patch 1970-01-01 00:00:00.000000000 +0000 +++ libgpg-error-1.21/debian/patches/0002-Measure-revision-by-length-of-debian-changelog.patch 2016-02-10 04:18:44.000000000 +0000 @@ -0,0 +1,31 @@ +From: Daniel Kahn Gillmor +Date: Tue, 9 Feb 2016 01:09:26 -0500 +Subject: Measure revision by length of debian/changelog + +Upstream libgpg-error's autoreconf step derives the package "revision" +number from the first couple octets of the git commit ID. + +But Debian doesn't build packages from git, and we autoreconf the +package before building. So we need to figure out a different value +for the package revision. + +This patch makes the package revision reflect the number of lines in +debian/changelog instead of trying to derive a revision number from +the git ID. +--- + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/configure.ac b/configure.ac +index 8b83c2c..2d27cc6 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -35,7 +35,7 @@ m4_define([mym4_version_minor], [21]) + # processing is done by autoconf and not during the configure run. + m4_define([mym4_version], [mym4_version_major.mym4_version_minor]) + m4_define([mym4_revision], +- m4_esyscmd([git rev-parse --short HEAD | tr -d '\n\r'])) ++ m4_esyscmd([printf %x $(wc -l < debian/changelog)])) + m4_define([mym4_revision_dec], + m4_esyscmd_s([echo $((0x$(echo ]mym4_revision[|head -c 4)))])) + m4_define([mym4_betastring], diff -Nru libgpg-error-1.21/debian/patches/0003-avoid-whitespace-in-gpg-error.def-linker-script-for-.patch libgpg-error-1.21/debian/patches/0003-avoid-whitespace-in-gpg-error.def-linker-script-for-.patch --- libgpg-error-1.21/debian/patches/0003-avoid-whitespace-in-gpg-error.def-linker-script-for-.patch 1970-01-01 00:00:00.000000000 +0000 +++ libgpg-error-1.21/debian/patches/0003-avoid-whitespace-in-gpg-error.def-linker-script-for-.patch 2016-02-10 04:18:44.000000000 +0000 @@ -0,0 +1,41 @@ +From: Daniel Kahn Gillmor +Date: Mon, 8 Feb 2016 23:30:22 -0500 +Subject: avoid whitespace in gpg-error.def linker script for mingw32 + +When cross-building for Windows with ./configure --host +i686-w64-mingw32 on recent versions of debian, the library doesn't get +built properly because of a difference in the whitespace produced in +the library's .def linker script. + +The errors look like: + +/bin/bash ../libtool --tag=CC --mode=link i686-w64-mingw32-gcc -g -Os -Wall -Wpointer-arith -Wno-psabi -no-undefined -export-symbols gpg-error.def -XCClinker -static-libgcc -version-info 17:0:17 -Xlinker --no-insert-timestamp -o libgpg-error.la -rpath /usr/share/win32/lib libgpg_error_la-w32-gettext.lo libgpg_error_la-w32-lock.lo libgpg_error_la-w32-thread.lo libgpg_error_la-init.lo libgpg_error_la-version.lo libgpg_error_la-estream.lo libgpg_error_la-estream-printf.lo libgpg_error_la-strsource.lo libgpg_error_la-strerror.lo libgpg_error_la-code-to-errno.lo libgpg_error_la-code-from-errno.lo libgpg_error_la-visibility.lo versioninfo.lo +libtool: link: /usr/bin/i686-w64-mingw32-nm -B .libs/libgpg_error_la-w32-gettext.o .libs/libgpg_error_la-w32-lock.o .libs/libgpg_error_la-w32-thread.o .libs/libgpg_error_la-init.o .libs/libgpg_error_la-version.o .libs/libgpg_error_la-estream.o .libs/libgpg_error_la-estream-printf.o .libs/libgpg_error_la-strsource.o .libs/libgpg_error_la-strerror.o .libs/libgpg_error_la-code-to-errno.o .libs/libgpg_error_la-code-from-errno.o .libs/libgpg_error_la-visibility.o .libs/versioninfo.o | sed -n -e 's/^.*[ ]\([ABCDGIRSTW][ABCDGIRSTW]*\)[ ][ ]*_\([_A-Za-z][_A-Za-z0-9]*\)$/\1 _\2 \2/p' | sed '/ __gnu_lto/d' | /bin/sed -e '/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //' | sort | uniq > .libs/libgpg-error.exp +libtool: link: if test "x`/bin/sed 1q .libs/libgpg-error.def`" = xEXPORTS; then cp .libs/libgpg-error.def .libs/libgpg-error-0.dll.def; else echo EXPORTS > .libs/libgpg-error-0.dll.def; cat .libs/libgpg-error.def >> .libs/libgpg-error-0.dll.def; fi +libtool: link: i686-w64-mingw32-gcc -shared .libs/libgpg-error-0.dll.def .libs/libgpg_error_la-w32-gettext.o .libs/libgpg_error_la-w32-lock.o .libs/libgpg_error_la-w32-thread.o .libs/libgpg_error_la-init.o .libs/libgpg_error_la-version.o .libs/libgpg_error_la-estream.o .libs/libgpg_error_la-estream-printf.o .libs/libgpg_error_la-strsource.o .libs/libgpg_error_la-strerror.o .libs/libgpg_error_la-code-to-errno.o .libs/libgpg_error_la-code-from-errno.o .libs/libgpg_error_la-visibility.o .libs/versioninfo.o -Os -static-libgcc -Wl,--no-insert-timestamp -o .libs/libgpg-error-0.dll -Wl,--enable-auto-image-base -Xlinker --out-implib -Xlinker .libs/libgpg-error.dll.a +/usr/bin/i686-w64-mingw32-ld: .libs/libgpg-error-0.dll.def:4: syntax error +/usr/bin/i686-w64-mingw32-ld:.libs/libgpg-error-0.dll.def: file format not recognized; treating as linker script +/usr/bin/i686-w64-mingw32-ld:.libs/libgpg-error-0.dll.def:3: syntax error +collect2: error: ld returned 1 exit status +Makefile:654: recipe for target 'libgpg-error.la' failed +make[5]: *** [libgpg-error.la] Error 1 +make[5]: Leaving directory '/home/dkg/src/pkg-gnupg/libgpg-error/build-win32/src' + +With this patch, the "/usr/bin/sed 1q" line recognizes that the file +is already a valid linker script and doesn't try to tweak it further. +--- + src/gpg-error.def.in | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/src/gpg-error.def.in b/src/gpg-error.def.in +index 16de809..517f38a 100644 +--- a/src/gpg-error.def.in ++++ b/src/gpg-error.def.in +@@ -23,7 +23,6 @@ + */ + + #include +- + EXPORTS + gpg_strerror @1 + gpg_strerror_r @2 diff -Nru libgpg-error-1.21/debian/patches/series libgpg-error-1.21/debian/patches/series --- libgpg-error-1.21/debian/patches/series 2015-09-17 01:40:00.000000000 +0000 +++ libgpg-error-1.21/debian/patches/series 2016-02-10 04:18:44.000000000 +0000 @@ -1 +1,3 @@ 0001-avoid-identifying-as-beta.patch +0002-Measure-revision-by-length-of-debian-changelog.patch +0003-avoid-whitespace-in-gpg-error.def-linker-script-for-.patch diff -Nru libgpg-error-1.21/debian/rules libgpg-error-1.21/debian/rules --- libgpg-error-1.21/debian/rules 2015-09-17 01:40:00.000000000 +0000 +++ libgpg-error-1.21/debian/rules 2016-02-18 11:36:49.000000000 +0000 @@ -1,12 +1,4 @@ #!/usr/bin/make -f - -#export DH_VERBOSE=1 - -export CPPFLAGS := $(shell dpkg-buildflags --get CPPFLAGS) -export CFLAGS := $(shell dpkg-buildflags --get CFLAGS) -export CXXFLAGS := $(shell dpkg-buildflags --get CXXFLAGS) -export LDFLAGS := $(shell dpkg-buildflags --get LDFLAGS) - export DEB_BUILD_MULTIARCH ?= $(shell dpkg-architecture -qDEB_BUILD_MULTIARCH) export DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH) @@ -15,18 +7,21 @@ override_dh_auto_configure: touch po/libgpg-error.pot - dh_auto_configure -- \ + dh_auto_configure --builddirectory=build -- \ --enable-static \ --disable-rpath \ --infodir=\$${prefix}/share/info \ --libdir=\$${prefix}/lib/$(DEB_HOST_MULTIARCH) -override_dh_auto_build: - dh_auto_build --parallel +override_dh_auto_build-arch: + dh_auto_build --parallel --builddirectory=build ifeq ($(DEB_HOST_MULTIARCH),$(DEB_BUILD_MULTIARCH)) - tail -vn+0 src/lock-obj-pub.native.h + tail -vn+0 build/src/lock-obj-pub.native.h endif +override_dh_auto_install-arch: + dh_auto_install --parallel --builddirectory=build + override_dh_install: sed -e"s,@DEB_HOST_MULTIARCH@,${DEB_HOST_MULTIARCH},g" \ debian/libgpg-error0.install.in > debian/libgpg-error0.install @@ -45,3 +40,4 @@ override_dh_link: dh_link -plibgpg-error-dev lib/$(DEB_HOST_MULTIARCH)/libgpg-error.so.0 usr/lib/$(DEB_HOST_MULTIARCH)/libgpg-error.so + diff -Nru libgpg-error-1.21/debian/tests/control libgpg-error-1.21/debian/tests/control --- libgpg-error-1.21/debian/tests/control 1970-01-01 00:00:00.000000000 +0000 +++ libgpg-error-1.21/debian/tests/control 2016-02-16 06:09:57.000000000 +0000 @@ -0,0 +1,5 @@ +Test-Command: ./libgpg-error-mingw-w64 i686 +Depends: libgpg-error-mingw-w64-dev, wine, wine32, libgpg-error-dev + +Test-Command: ./libgpg-error-mingw-w64 x86_64 +Depends: libgpg-error-mingw-w64-dev, wine, wine64, libgpg-error-dev diff -Nru libgpg-error-1.21/debian/tests/libgpg-error-mingw-w64-dev libgpg-error-1.21/debian/tests/libgpg-error-mingw-w64-dev --- libgpg-error-1.21/debian/tests/libgpg-error-mingw-w64-dev 1970-01-01 00:00:00.000000000 +0000 +++ libgpg-error-1.21/debian/tests/libgpg-error-mingw-w64-dev 2016-02-16 06:09:57.000000000 +0000 @@ -0,0 +1,19 @@ +#!/bin/bash + +set -e + +ARCH="$1" + +# just make sure that gpg-error.exe works + +wine /usr/"${ARCH}"-w64-mingw32/bin/gpg-error.exe --version + +# just compare the first 200 error messages (not all of them, because +# some errors have no available strings on windows): +for x in $(seq 0 200); do + diff -u <(gpg-error $x) \ + <(wine /usr/"${ARCH}"-w64-mingw32/bin/gpg-error.exe $x | sed 's/\r$//' ) +done + +# FIXME: it would be good to test building another windows binary +# linking to libgpg-error and run it here.