Package: osm2pgsql
Severity: important
Version: 0.84.0-1

Hi,

Per #755212, a new major version of protobuf-c is about to be uploaded
to unstable, requiring a transition.  The osm2pgsql package needs
sourceful changes in order to be compatible with the upcoming protobuf-c
1.0.0 release.

Please apply the changes in the attached patch to the osm2pgsql package.
The changes are compatible with the version of the protobuf-c package
currently in testing/unstable, and will allow for compatibility with
protobuf-c >= 1.0.0 once it has been uploaded to unstable.

The upstream issue corresponding to this transition is here:

    https://github.com/openstreetmap/osm2pgsql/issues/129

Thanks!

-- 
Robert Edmonds
edmo...@debian.org
diff -Npru osm2pgsql-0.84.0.orig/debian/control osm2pgsql-0.84.0/debian/control
--- osm2pgsql-0.84.0.orig/debian/control	2014-07-10 03:22:12.000000000 -0400
+++ osm2pgsql-0.84.0/debian/control	2014-07-21 19:36:16.556259459 -0400
@@ -14,7 +14,7 @@ Build-Depends: debhelper (>= 9),
                libpq-dev,
                libxml2-dev,
                libproj-dev,
-               libprotobuf-c0-dev (>= 0.14),
+               libprotobuf-c-dev | libprotobuf-c0-dev (>= 0.14),
                protobuf-c-compiler,
                liblua5.2-dev,
                lua5.2
diff -Npru osm2pgsql-0.84.0.orig/debian/patches/03-fix-build-for-protobuf-c-1.0.0.patch osm2pgsql-0.84.0/debian/patches/03-fix-build-for-protobuf-c-1.0.0.patch
--- osm2pgsql-0.84.0.orig/debian/patches/03-fix-build-for-protobuf-c-1.0.0.patch	1969-12-31 19:00:00.000000000 -0500
+++ osm2pgsql-0.84.0/debian/patches/03-fix-build-for-protobuf-c-1.0.0.patch	2014-07-21 19:35:16.803450416 -0400
@@ -0,0 +1,15 @@
+Description: Fix FTBFS with protobuf-c >= 1.0.0
+Applied-Upstream: https://github.com/openstreetmap/osm2pgsql/commit/8c7c6dbb319e97715b174edd081303174c96b03b
+--- a/m4/ax_lib_protobuf_c.m4
++++ b/m4/ax_lib_protobuf_c.m4
+@@ -207,7 +207,9 @@ AC_DEFUN([AX_LIB_PROTOBUF_C],
+       CFLAGS="$CFLAGS $PROTOBUF_C_CFLAGS"
+       AX_COMPARE_VERSION([$protobuf_c_wanted_version], [ge], [0.14],
+          [AC_CHECK_MEMBER([ProtobufCFieldDescriptor.packed],,
+-                          [protobuf_c_version_ok="no"],
++                          [AC_CHECK_MEMBER([ProtobufCFieldDescriptor.flags],,
++                                           [protobuf_c_version_ok="no"],
++                                           [[#include <protobuf-c/protobuf-c.h>]])],
+                           [[#include <google/protobuf-c/protobuf-c.h>]
+          ])
+       ])
diff -Npru osm2pgsql-0.84.0.orig/debian/patches/04-api-changes-for-protobuf-c-1.0.0.patch osm2pgsql-0.84.0/debian/patches/04-api-changes-for-protobuf-c-1.0.0.patch
--- osm2pgsql-0.84.0.orig/debian/patches/04-api-changes-for-protobuf-c-1.0.0.patch	1969-12-31 19:00:00.000000000 -0500
+++ osm2pgsql-0.84.0/debian/patches/04-api-changes-for-protobuf-c-1.0.0.patch	2014-07-21 19:35:16.803450416 -0400
@@ -0,0 +1,34 @@
+Description: Update for API changes in protobuf-c >= 1.0.0
+Author: Robert Edmonds <edmo...@debian.org>
+Forwarded: https://github.com/openstreetmap/osm2pgsql/issues/129
+--- a/parse-pbf.c
++++ b/parse-pbf.c
+@@ -258,7 +258,7 @@ int processOsmHeader(void *data, size_t length)
+     return 0;
+   }
+   
+-  header_block__free_unpacked (hmsg, &protobuf_c_system_allocator);
++  header_block__free_unpacked (hmsg, NULL);
+ 
+   return 1;
+ }
+@@ -541,7 +541,7 @@ int processOsmData(struct osmdata_t *osmdata, void *data, size_t length)
+     if (!processOsmDataRelations(osmdata, group, string_table)) return 0;
+   }
+ 
+-  primitive_block__free_unpacked (pmsg, &protobuf_c_system_allocator);
++  primitive_block__free_unpacked (pmsg, NULL);
+ 
+   return 1;
+ }
+@@ -606,8 +606,8 @@ int streamFilePbf(char *filename, int sanitize UNUSED, struct osmdata_t *osmdata
+       }
+     }
+ 
+-    blob__free_unpacked (blob_msg, &protobuf_c_system_allocator);
+-    block_header__free_unpacked (header_msg, &protobuf_c_system_allocator);
++    blob__free_unpacked (blob_msg, NULL);
++    block_header__free_unpacked (header_msg, NULL);
+   } while (!feof(input));
+ 
+   if (!feof(input)) {
diff -Npru osm2pgsql-0.84.0.orig/debian/patches/series osm2pgsql-0.84.0/debian/patches/series
--- osm2pgsql-0.84.0.orig/debian/patches/series	2014-07-10 03:22:12.000000000 -0400
+++ osm2pgsql-0.84.0/debian/patches/series	2014-07-21 19:35:16.803450416 -0400
@@ -1,3 +1,5 @@
 00-fix_build.patch
 01-hyphen-used-as-minus-sign.patch
 02-spelling-error-in-manpage.patch
+03-fix-build-for-protobuf-c-1.0.0.patch
+04-api-changes-for-protobuf-c-1.0.0.patch

Reply via email to