Control: tags 846343 + pending
Control: tags 862805 + pending

Dear maintainer,

I've prepared an NMU for protobuf (versioned as 3.0.0-9.1) and
uploaded it to DELAYED/2. Please feel free to tell me if I
should delay it longer.

Regards.

-- 
regards,
                        Mattia Rizzolo

GPG Key: 66AE 2B4A FCCF 3F52 DA18  4D18 4B04 3FCD B944 4540      .''`.
more about me:  https://mapreri.org                             : :'  :
Launchpad user: https://launchpad.net/~mapreri                  `. `'`
Debian QA page: https://qa.debian.org/developer.php?login=mattia  `-
diffstat for protobuf-3.0.0 protobuf-3.0.0

 changelog              |   24 ++++++++++++++++++++++++
 control                |   11 +++++------
 patches/python36.patch |   29 +++++++++++++++++++++++++++++
 patches/series         |    1 +
 rules                  |   45 +++++++++++++++++++++++++++++++++++++++------
 run_protoc             |    5 +++++
 6 files changed, 103 insertions(+), 12 deletions(-)

diff -Nru protobuf-3.0.0/debian/changelog protobuf-3.0.0/debian/changelog
--- protobuf-3.0.0/debian/changelog	2016-11-25 17:11:01.000000000 +0100
+++ protobuf-3.0.0/debian/changelog	2017-10-16 13:34:16.000000000 +0200
@@ -1,3 +1,27 @@
+protobuf (3.0.0-9.1) unstable; urgency=medium
+
+  * Non-maintainer upload.
+
+  [ Mattia Rizzolo ]
+  * Apply patch from Ubuntu to fix tests with Python 3.6.  Closes: #862805
+  * Add missing Build-Depends on python-six.
+
+  [ Helmut Grohne ]
+  * Fix FTCBFS:
+    + Remove unneeded versioned Build-Depends on g++ (satisfied in oldstable).
+    + Remove unused Build-Depends on python-google-apputils.
+    + Mark the python(3)-all Build-Depends with :any.
+    + Run generate_descriptor_proto.sh on a native build before performing
+      the actual cross build.
+    + Save the native protoc in debian/native_protoc/ and pass it to the
+      cross build via --with-protoc.
+    + Set up environment variables for cross building python extensions.
+    + Fix the loops used for the python(3) builds install and tests, to
+      actually build for all python versions and tests them all.
+    + Closes: #846343
+
+ -- Mattia Rizzolo <mat...@debian.org>  Mon, 16 Oct 2017 13:34:16 +0200
+
 protobuf (3.0.0-9) unstable; urgency=medium
 
   * Backport upstream fix for Python 3 build failure (closes: #845686).
diff -Nru protobuf-3.0.0/debian/control protobuf-3.0.0/debian/control
--- protobuf-3.0.0/debian/control	2016-11-24 18:33:28.000000000 +0100
+++ protobuf-3.0.0/debian/control	2017-10-16 11:50:01.000000000 +0200
@@ -13,19 +13,18 @@
  , debhelper (>= 9)
  , dh-autoreconf
 # C/C++
- , g++ (>= 4:4.7)
  , zlib1g-dev
  , google-mock
  , libgtest-dev
 # Python
  , dh-python
- , python-all (>= 2.7)
- , libpython-all-dev (>= 2.7)
- , python3-all (>= 3.3)
- , libpython3-all-dev (>= 3.3)
+ , python-all:any
+ , libpython-all-dev
+ , python3-all:any
+ , libpython3-all-dev
  , python-setuptools
+ , python-six
  , python3-setuptools
- , python-google-apputils
  , python3-six
 # Manpage generator
  , xmlto
diff -Nru protobuf-3.0.0/debian/patches/python36.patch protobuf-3.0.0/debian/patches/python36.patch
--- protobuf-3.0.0/debian/patches/python36.patch	1970-01-01 01:00:00.000000000 +0100
+++ protobuf-3.0.0/debian/patches/python36.patch	2017-10-16 10:58:28.000000000 +0200
@@ -0,0 +1,29 @@
+Description: Fix two tests with Python 3.6
+Author: Michael Hudson-Doyle <michael.hud...@ubuntu.com>
+Origin: vendor
+Bug: https://github.com/google/protobuf/issues/3037
+Bug-Debian: https://bugs.debian.org/862805
+Last-Update: 2017-10-16
+
+--- a/python/google/protobuf/internal/json_format_test.py
++++ b/python/google/protobuf/internal/json_format_test.py
+@@ -753,7 +753,7 @@
+     text = '{"value": "0000-01-01T00:00:00Z"}'
+     self.assertRaisesRegexp(
+         json_format.ParseError,
+-        'Failed to parse value field: year is out of range.',
++        'Failed to parse value field: year (0 )?is out of range.',
+         json_format.Parse, text, message)
+     # Time bigger than maxinum time.
+     message.value.seconds = 253402300800
+--- a/python/google/protobuf/internal/well_known_types_test.py
++++ b/python/google/protobuf/internal/well_known_types_test.py
+@@ -284,7 +284,7 @@
+         '1972-01-01T01:00:00.01+08',)
+     self.assertRaisesRegexp(
+         ValueError,
+-        'year is out of range',
++        'year (0 )?is out of range',
+         message.FromJsonString,
+         '0000-01-01T00:00:00Z')
+     message.seconds = 253402300800
diff -Nru protobuf-3.0.0/debian/patches/series protobuf-3.0.0/debian/patches/series
--- protobuf-3.0.0/debian/patches/series	2016-11-25 17:11:01.000000000 +0100
+++ protobuf-3.0.0/debian/patches/series	2017-10-16 10:57:22.000000000 +0200
@@ -6,3 +6,4 @@
 s390x.patch
 sparc64.patch
 python3_long_fix.patch
+python36.patch
diff -Nru protobuf-3.0.0/debian/rules protobuf-3.0.0/debian/rules
--- protobuf-3.0.0/debian/rules	2016-11-24 18:33:28.000000000 +0100
+++ protobuf-3.0.0/debian/rules	2017-10-16 13:12:21.000000000 +0200
@@ -1,9 +1,27 @@
 #!/usr/bin/make -f
 # -*- makefile -*-
 
+include /usr/share/dpkg/architecture.mk
+ifeq ($(origin CXX),default)
+CXX := $(DEB_HOST_GNU_TYPE)-g++
+endif
+
 %:
 	dh $@ --with autoreconf,python2,python3 --parallel
 
+ifneq ($(DEB_BUILD_ARCH),$(DEB_HOST_ARCH))
+override_dh_auto_configure:
+	# build for the native (i.e. build) architecture, as we need
+	# the protoc compiler for the native arch.
+	dh_auto_configure -- --host=$(DEB_BUILD_GNU_TYPE)
+
+PYTHON_CROSS_VARS += PROTOC=$(CURDIR)/debian/run_protoc
+PYTHON_CROSS_VARS += PYTHONPATH=/usr/lib/python$$pv/plat-$(DEB_HOST_MULTIARCH)
+PYTHON_CROSS_VARS += _PYTHON_HOST_PLATFORM=$(DEB_HOST_ARCH_OS)-$(DEB_HOST_GNU_CPU)
+PYTHON_CROSS_VARS += CC=$(CXX)
+PYTHON_CROSS_VARS += CXX=$(CXX)
+endif
+
 override_dh_auto_build-arch:
 ## Chicken<->Egg problem: protobuf requires self-generated .pb.go files to
 ## be built. First we build it normally; then "generate_descriptor_proto.sh"
@@ -12,13 +30,27 @@
 	dh_auto_build --arch
 	bash -x ./generate_descriptor_proto.sh
 
+ifneq ($(DEB_BUILD_ARCH),$(DEB_HOST_ARCH))
+	# save the native compiler
+	cp -Rv src/.libs debian/native_protoc
+	# clean everything but regenerated .pb.{cc,go} files
+	$(MAKE) clean
+	# cross build
+	dh_auto_configure -- --with-protoc=$(CURDIR)/debian/run_protoc
+	dh_auto_build --arch
+endif
+
 	# Generate the manpage.
 	xmlto man debian/protoc.xml
 
 	# Python and Python3 build.
 	cp -rv python python3
-	cd python && python setup.py build --cpp_implementation
-	cd python3 && python3 setup.py build --cpp_implementation
+	set -e; cd python && for pv in $(shell pyversions -vr); do \
+		$(PYTHON_CROSS_VARS) python$$pv setup.py build --cpp_implementation; \
+	done
+	set -e; cd python3 && for pv in $(shell py3versions -vr); do \
+		$(PYTHON_CROSS_VARS) python$$pv setup.py build --cpp_implementation; \
+	done
 
 override_dh_auto_build-indep:
 	dh_auto_build --indep
@@ -82,16 +114,17 @@
 
 	# Python install.
 	set -e; \
-	cd python && for python in $(shell pyversions -r); do \
-		$$python setup.py install --cpp_implementation \
+	cd python && for pv in $(shell pyversions -vr); do \
+		$(PYTHON_CROSS_VARS) python$$pv setup.py install --cpp_implementation \
 			--install-layout=deb --no-compile \
 			--root=$(CURDIR)/debian/python-protobuf; \
 	done
 	find $(CURDIR)/debian/python-protobuf -name 'protobuf-*-nspkg.pth' -delete
 
 	# Python3 install.
-	cd python3 && for python in $(shell py3versions -r); do \
-		$$python setup.py install --cpp_implementation \
+	set -e; \
+	cd python3 && for pv in $(shell py3versions -vr); do \
+		$(PYTHON_CROSS_VARS) python$$pv setup.py install --cpp_implementation \
 			--install-layout=deb --no-compile \
 			--root=$(CURDIR)/debian/python3-protobuf; \
 	done
diff -Nru protobuf-3.0.0/debian/run_protoc protobuf-3.0.0/debian/run_protoc
--- protobuf-3.0.0/debian/run_protoc	1970-01-01 01:00:00.000000000 +0100
+++ protobuf-3.0.0/debian/run_protoc	2017-10-16 11:19:43.000000000 +0200
@@ -0,0 +1,5 @@
+#!/bin/sh
+# see debian/rules for how debian/native_protoc gets populated during cross builds
+location=$(dirname "$0")
+export LD_LIBRARY_PATH="$location/native_protoc${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
+exec "$location/native_protoc/protoc" "$@"

Attachment: signature.asc
Description: PGP signature

Reply via email to