diff -Nru protobuf-3.6.1.1/debian/changelog protobuf-3.6.1.3/debian/changelog --- protobuf-3.6.1.1/debian/changelog 2018-11-26 23:23:31.000000000 +0000 +++ protobuf-3.6.1.3/debian/changelog 2018-12-09 12:45:11.000000000 +0000 @@ -1,3 +1,20 @@ +protobuf (3.6.1.3-1) unstable; urgency=medium + + * New upstream release. + * Mark libprotobuf-java Multi-Arch foreign. + + -- Laszlo Boszormenyi (GCS) Sun, 09 Dec 2018 12:45:11 +0000 + +protobuf (3.6.1.2-1) unstable; urgency=medium + + * New upstream release. + * Remove Python 3.7 patches as applied upstream. + + [ Michael Vogt ] + * Remove explicit #!/usr/bin/python2.4 usage (closes: #600261). + + -- Laszlo Boszormenyi (GCS) Sat, 08 Dec 2018 16:13:58 +0000 + protobuf (3.6.1.1-1) unstable; urgency=medium * New upstream release. diff -Nru protobuf-3.6.1.1/debian/control protobuf-3.6.1.3/debian/control --- protobuf-3.6.1.1/debian/control 2018-11-26 23:23:31.000000000 +0000 +++ protobuf-3.6.1.3/debian/control 2018-12-09 12:45:11.000000000 +0000 @@ -233,6 +233,7 @@ Package: libprotobuf-java Architecture: all +Multi-Arch: foreign Depends: ${misc:Depends} Section: java Description: Java bindings for protocol buffers diff -Nru protobuf-3.6.1.1/debian/patches/Add_Python_3.7_compatibility.patch protobuf-3.6.1.3/debian/patches/Add_Python_3.7_compatibility.patch --- protobuf-3.6.1.1/debian/patches/Add_Python_3.7_compatibility.patch 2018-08-14 18:22:07.000000000 +0000 +++ protobuf-3.6.1.3/debian/patches/Add_Python_3.7_compatibility.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,70 +0,0 @@ -From 5c42943e75231b79f4ffcc37a22f0077a2fb0e7d Mon Sep 17 00:00:00 2001 -From: Ben Webb -Date: Tue, 3 Jul 2018 09:51:09 -0700 -Subject: [PATCH] Add Python 3.7 compatibility - -Compilation of Python wrappers fails with Python 3.7 because -the Python folks changed their C API such that -PyUnicode_AsUTF8AndSize() now returns a const char* rather -than a char*. Add a patch to work around. Relates #4086. ---- - python/google/protobuf/pyext/descriptor.cc | 2 +- - python/google/protobuf/pyext/descriptor_containers.cc | 2 +- - python/google/protobuf/pyext/descriptor_pool.cc | 2 +- - python/google/protobuf/pyext/extension_dict.cc | 2 +- - python/google/protobuf/pyext/message.cc | 4 ++-- - 5 files changed, 6 insertions(+), 6 deletions(-) - ---- a/python/google/protobuf/pyext/descriptor.cc -+++ b/python/google/protobuf/pyext/descriptor.cc -@@ -56,7 +56,7 @@ - #endif - #define PyString_AsStringAndSize(ob, charpp, sizep) \ - (PyUnicode_Check(ob)? \ -- ((*(charpp) = PyUnicode_AsUTF8AndSize(ob, (sizep))) == NULL? -1: 0): \ -+ ((*(charpp) = const_cast(PyUnicode_AsUTF8AndSize(ob, (sizep)))) == NULL? -1: 0): \ - PyBytes_AsStringAndSize(ob, (charpp), (sizep))) - #endif - ---- a/python/google/protobuf/pyext/descriptor_containers.cc -+++ b/python/google/protobuf/pyext/descriptor_containers.cc -@@ -66,7 +66,7 @@ - #endif - #define PyString_AsStringAndSize(ob, charpp, sizep) \ - (PyUnicode_Check(ob)? \ -- ((*(charpp) = PyUnicode_AsUTF8AndSize(ob, (sizep))) == NULL? -1: 0): \ -+ ((*(charpp) = const_cast(PyUnicode_AsUTF8AndSize(ob, (sizep)))) == NULL? -1: 0): \ - PyBytes_AsStringAndSize(ob, (charpp), (sizep))) - #endif - ---- a/python/google/protobuf/pyext/descriptor_pool.cc -+++ b/python/google/protobuf/pyext/descriptor_pool.cc -@@ -48,7 +48,7 @@ - #endif - #define PyString_AsStringAndSize(ob, charpp, sizep) \ - (PyUnicode_Check(ob)? \ -- ((*(charpp) = PyUnicode_AsUTF8AndSize(ob, (sizep))) == NULL? -1: 0): \ -+ ((*(charpp) = const_cast(PyUnicode_AsUTF8AndSize(ob, (sizep)))) == NULL? -1: 0): \ - PyBytes_AsStringAndSize(ob, (charpp), (sizep))) - #endif - ---- a/python/google/protobuf/pyext/message.cc -+++ b/python/google/protobuf/pyext/message.cc -@@ -79,7 +79,7 @@ - (PyUnicode_Check(ob)? PyUnicode_AsUTF8(ob): PyBytes_AsString(ob)) - #define PyString_AsStringAndSize(ob, charpp, sizep) \ - (PyUnicode_Check(ob)? \ -- ((*(charpp) = PyUnicode_AsUTF8AndSize(ob, (sizep))) == NULL? -1: 0): \ -+ ((*(charpp) = const_cast(PyUnicode_AsUTF8AndSize(ob, (sizep)))) == NULL? -1: 0): \ - PyBytes_AsStringAndSize(ob, (charpp), (sizep))) - #endif - #endif -@@ -1529,7 +1529,7 @@ - return NULL; - } - #else -- field_name = PyUnicode_AsUTF8AndSize(arg, &size); -+ field_name = const_cast(PyUnicode_AsUTF8AndSize(arg, &size)); - if (!field_name) { - return NULL; - } diff -Nru protobuf-3.6.1.1/debian/patches/default_python_version protobuf-3.6.1.3/debian/patches/default_python_version --- protobuf-3.6.1.1/debian/patches/default_python_version 1970-01-01 00:00:00.000000000 +0000 +++ protobuf-3.6.1.3/debian/patches/default_python_version 2018-12-08 16:13:58.000000000 +0000 @@ -0,0 +1,20 @@ +Index: protobuf-2.1.0/python/mox.py +=================================================================== +--- protobuf-2.1.0.orig/python/mox.py 2009-11-17 03:37:29.000000000 +1100 ++++ protobuf-2.1.0/python/mox.py 2009-11-17 03:38:08.000000000 +1100 +@@ -1,4 +1,4 @@ +-#!/usr/bin/python2.4 ++#!/usr/bin/python + # + # Copyright 2008 Google Inc. + # +Index: protobuf-2.1.0/python/stubout.py +=================================================================== +--- protobuf-2.1.0.orig/python/stubout.py 2009-11-17 03:37:29.000000000 +1100 ++++ protobuf-2.1.0/python/stubout.py 2009-11-17 03:38:17.000000000 +1100 +@@ -1,4 +1,4 @@ +-#!/usr/bin/python2.4 ++#!/usr/bin/python + # + # Copyright 2008 Google Inc. + # diff -Nru protobuf-3.6.1.1/debian/patches/more_Python_3.7_compatibility.patch protobuf-3.6.1.3/debian/patches/more_Python_3.7_compatibility.patch --- protobuf-3.6.1.1/debian/patches/more_Python_3.7_compatibility.patch 2018-08-14 18:22:07.000000000 +0000 +++ protobuf-3.6.1.3/debian/patches/more_Python_3.7_compatibility.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,18 +0,0 @@ -Description: more typecast fix for Python 3.7 - Add explicit typecast. -Author: Laszlo Boszormenyi (GCS) -Last-Update: 2018-08-14 - ---- - ---- protobuf-3.6.1.orig/python/google/protobuf/pyext/extension_dict.cc -+++ protobuf-3.6.1/python/google/protobuf/pyext/extension_dict.cc -@@ -53,7 +53,7 @@ - #endif - #define PyString_AsStringAndSize(ob, charpp, sizep) \ - (PyUnicode_Check(ob)? \ -- ((*(charpp) = PyUnicode_AsUTF8AndSize(ob, (sizep))) == NULL? -1: 0): \ -+ ((*(charpp) = const_cast(PyUnicode_AsUTF8AndSize(ob, (sizep)))) == NULL? -1: 0): \ - PyBytes_AsStringAndSize(ob, (charpp), (sizep))) - #endif - diff -Nru protobuf-3.6.1.1/debian/patches/series protobuf-3.6.1.3/debian/patches/series --- protobuf-3.6.1.1/debian/patches/series 2018-10-11 15:15:45.000000000 +0000 +++ protobuf-3.6.1.3/debian/patches/series 2018-12-08 16:13:58.000000000 +0000 @@ -1,8 +1,7 @@ hurd.patch +default_python_version #java-test-scope.patch #misleading-indentation.patch s390x.patch disable_local_gmock.patch -Add_Python_3.7_compatibility.patch -more_Python_3.7_compatibility.patch fix_google_test_link.patch diff -Nru protobuf-3.6.1.1/js/binary/utils.js protobuf-3.6.1.3/js/binary/utils.js --- protobuf-3.6.1.1/js/binary/utils.js 2018-11-21 19:00:45.000000000 +0000 +++ protobuf-3.6.1.3/js/binary/utils.js 2018-12-08 01:32:11.000000000 +0000 @@ -971,9 +971,10 @@ return /** @type {!Uint8Array} */(new Uint8Array(data)); } - if (data.constructor === Buffer) { - return /** @type {!Uint8Array} */(new Uint8Array(data)); - } + if (typeof Buffer != 'undefined' && data.constructor === Buffer) { + return /** @type {!Uint8Array} */ ( + new Uint8Array(/** @type {?} */ (data))); + } if (data.constructor === Array) { data = /** @type {!Array} */(data); diff -Nru protobuf-3.6.1.1/kokoro/release/python/linux/build_artifacts.sh protobuf-3.6.1.3/kokoro/release/python/linux/build_artifacts.sh --- protobuf-3.6.1.1/kokoro/release/python/linux/build_artifacts.sh 2018-11-21 19:00:45.000000000 +0000 +++ protobuf-3.6.1.3/kokoro/release/python/linux/build_artifacts.sh 2018-12-08 01:32:11.000000000 +0000 @@ -43,3 +43,4 @@ build_artifact_version 3.4 build_artifact_version 3.5 build_artifact_version 3.6 +build_artifact_version 3.7 diff -Nru protobuf-3.6.1.1/kokoro/release/python/macos/build_artifacts.sh protobuf-3.6.1.3/kokoro/release/python/macos/build_artifacts.sh --- protobuf-3.6.1.1/kokoro/release/python/macos/build_artifacts.sh 2018-11-21 19:00:45.000000000 +0000 +++ protobuf-3.6.1.3/kokoro/release/python/macos/build_artifacts.sh 2018-12-08 01:32:11.000000000 +0000 @@ -45,3 +45,4 @@ build_artifact_version 3.4 build_artifact_version 3.5 build_artifact_version 3.6 +build_artifact_version 3.7 diff -Nru protobuf-3.6.1.1/kokoro/release/python/windows/build_artifacts.bat protobuf-3.6.1.3/kokoro/release/python/windows/build_artifacts.bat --- protobuf-3.6.1.1/kokoro/release/python/windows/build_artifacts.bat 2018-11-21 19:00:45.000000000 +0000 +++ protobuf-3.6.1.3/kokoro/release/python/windows/build_artifacts.bat 2018-12-08 01:32:11.000000000 +0000 @@ -51,3 +51,13 @@ SET PYTHON_VERSION=3.6 SET PYTHON_ARCH=64 CALL build_single_artifact.bat + +SET PYTHON=C:\python37_32bit +SET PYTHON_VERSION=3.7 +SET PYTHON_ARCH=32 +CALL build_single_artifact.bat + +SET PYTHON=C:\python37 +SET PYTHON_VERSION=3.7 +SET PYTHON_ARCH=64 +CALL build_single_artifact.bat diff -Nru protobuf-3.6.1.1/protobuf.bzl protobuf-3.6.1.3/protobuf.bzl --- protobuf-3.6.1.1/protobuf.bzl 2018-11-21 19:00:45.000000000 +0000 +++ protobuf-3.6.1.3/protobuf.bzl 2018-12-08 01:32:11.000000000 +0000 @@ -266,8 +266,8 @@ Args: srcs: the well known protos """ - root = Label("%s//protobuf_java" % (REPOSITORY_NAME)).workspace_root - pkg = PACKAGE_NAME + "/" if PACKAGE_NAME else "" + root = Label("%s//protobuf_java" % (native.repository_name())).workspace_root + pkg = native.package_name() + "/" if native.package_name() else "" if root == "": include = " -I%ssrc " % pkg else: diff -Nru protobuf-3.6.1.1/python/google/protobuf/pyext/descriptor.cc protobuf-3.6.1.3/python/google/protobuf/pyext/descriptor.cc --- protobuf-3.6.1.1/python/google/protobuf/pyext/descriptor.cc 2018-11-21 19:00:45.000000000 +0000 +++ protobuf-3.6.1.3/python/google/protobuf/pyext/descriptor.cc 2018-12-08 01:32:11.000000000 +0000 @@ -56,7 +56,7 @@ #endif #define PyString_AsStringAndSize(ob, charpp, sizep) \ (PyUnicode_Check(ob)? \ - ((*(charpp) = PyUnicode_AsUTF8AndSize(ob, (sizep))) == NULL? -1: 0): \ + ((*(charpp) = const_cast(PyUnicode_AsUTF8AndSize(ob, (sizep)))) == NULL? -1: 0): \ PyBytes_AsStringAndSize(ob, (charpp), (sizep))) #endif diff -Nru protobuf-3.6.1.1/python/google/protobuf/pyext/descriptor_containers.cc protobuf-3.6.1.3/python/google/protobuf/pyext/descriptor_containers.cc --- protobuf-3.6.1.1/python/google/protobuf/pyext/descriptor_containers.cc 2018-11-21 19:00:45.000000000 +0000 +++ protobuf-3.6.1.3/python/google/protobuf/pyext/descriptor_containers.cc 2018-12-08 01:32:11.000000000 +0000 @@ -66,7 +66,7 @@ #endif #define PyString_AsStringAndSize(ob, charpp, sizep) \ (PyUnicode_Check(ob)? \ - ((*(charpp) = PyUnicode_AsUTF8AndSize(ob, (sizep))) == NULL? -1: 0): \ + ((*(charpp) = const_cast(PyUnicode_AsUTF8AndSize(ob, (sizep)))) == NULL? -1: 0): \ PyBytes_AsStringAndSize(ob, (charpp), (sizep))) #endif diff -Nru protobuf-3.6.1.1/python/google/protobuf/pyext/descriptor_pool.cc protobuf-3.6.1.3/python/google/protobuf/pyext/descriptor_pool.cc --- protobuf-3.6.1.1/python/google/protobuf/pyext/descriptor_pool.cc 2018-11-21 19:00:45.000000000 +0000 +++ protobuf-3.6.1.3/python/google/protobuf/pyext/descriptor_pool.cc 2018-12-08 01:32:11.000000000 +0000 @@ -48,7 +48,7 @@ #endif #define PyString_AsStringAndSize(ob, charpp, sizep) \ (PyUnicode_Check(ob)? \ - ((*(charpp) = PyUnicode_AsUTF8AndSize(ob, (sizep))) == NULL? -1: 0): \ + ((*(charpp) = const_cast(PyUnicode_AsUTF8AndSize(ob, (sizep)))) == NULL? -1: 0): \ PyBytes_AsStringAndSize(ob, (charpp), (sizep))) #endif diff -Nru protobuf-3.6.1.1/python/google/protobuf/pyext/extension_dict.cc protobuf-3.6.1.3/python/google/protobuf/pyext/extension_dict.cc --- protobuf-3.6.1.1/python/google/protobuf/pyext/extension_dict.cc 2018-11-21 19:00:45.000000000 +0000 +++ protobuf-3.6.1.3/python/google/protobuf/pyext/extension_dict.cc 2018-12-08 01:32:11.000000000 +0000 @@ -53,7 +53,7 @@ #endif #define PyString_AsStringAndSize(ob, charpp, sizep) \ (PyUnicode_Check(ob)? \ - ((*(charpp) = PyUnicode_AsUTF8AndSize(ob, (sizep))) == NULL? -1: 0): \ + ((*(charpp) = const_cast(PyUnicode_AsUTF8AndSize(ob, (sizep)))) == NULL? -1: 0): \ PyBytes_AsStringAndSize(ob, (charpp), (sizep))) #endif diff -Nru protobuf-3.6.1.1/python/google/protobuf/pyext/message.cc protobuf-3.6.1.3/python/google/protobuf/pyext/message.cc --- protobuf-3.6.1.1/python/google/protobuf/pyext/message.cc 2018-11-21 19:00:45.000000000 +0000 +++ protobuf-3.6.1.3/python/google/protobuf/pyext/message.cc 2018-12-08 01:32:11.000000000 +0000 @@ -79,7 +79,7 @@ (PyUnicode_Check(ob)? PyUnicode_AsUTF8(ob): PyBytes_AsString(ob)) #define PyString_AsStringAndSize(ob, charpp, sizep) \ (PyUnicode_Check(ob)? \ - ((*(charpp) = PyUnicode_AsUTF8AndSize(ob, (sizep))) == NULL? -1: 0): \ + ((*(charpp) = const_cast(PyUnicode_AsUTF8AndSize(ob, (sizep)))) == NULL? -1: 0): \ PyBytes_AsStringAndSize(ob, (charpp), (sizep))) #endif #endif @@ -1529,7 +1529,7 @@ return NULL; } #else - field_name = PyUnicode_AsUTF8AndSize(arg, &size); + field_name = const_cast(PyUnicode_AsUTF8AndSize(arg, &size)); if (!field_name) { return NULL; } diff -Nru protobuf-3.6.1.1/python/setup.py protobuf-3.6.1.3/python/setup.py --- protobuf-3.6.1.1/python/setup.py 2018-11-21 19:00:45.000000000 +0000 +++ protobuf-3.6.1.3/python/setup.py 2018-12-08 01:32:11.000000000 +0000 @@ -1,10 +1,14 @@ #! /usr/bin/env python # # See README for usage instructions. +from distutils import util import glob import os +import pkg_resources +import re import subprocess import sys +import sysconfig import platform # We must use setuptools, not distutils, because we need to use the @@ -186,6 +190,18 @@ extra_compile_args.append('-Wno-invalid-offsetof') extra_compile_args.append('-Wno-sign-compare') + # https://developer.apple.com/documentation/xcode_release_notes/xcode_10_release_notes + # C++ projects must now migrate to libc++ and are recommended to set a + # deployment target of macOS 10.9 or later, or iOS 7 or later. + if sys.platform == 'darwin': + mac_target = sysconfig.get_config_var('MACOSX_DEPLOYMENT_TARGET') + if mac_target and (pkg_resources.parse_version(mac_target) < + pkg_resources.parse_version('10.9.0')): + os.environ['MACOSX_DEPLOYMENT_TARGET'] = '10.9' + os.environ['_PYTHON_HOST_PLATFORM'] = re.sub( + r'macosx-[0-9]+\.[0-9]+-(.+)', r'macosx-10.9-\1', + util.get_platform()) + # https://github.com/Theano/Theano/issues/4926 if sys.platform == 'win32': extra_compile_args.append('-D_hypot=hypot')