[Pkg-osm-maint] Bug#749501: NMU debdiff for osmium_0.0~20111213-g7f3500a-3.1

Aníbal Monsalve Salazar anibal at debian.org
Wed May 28 08:57:23 UTC 2014


Hello,

At Imagination Technologies (http://imgtec.com/) Jurica Stanojkovic has
found a solution to Debian bug #749501.

https://bugs.debian.org/749501

My NMU patch for osmium_0.0~20111213-g7f3500a-3.1 is below, at the end
of this message.

With the changes in the NMU patch osmium builds successfully on mips,
mipsel and amd64.

Regards,

Aníbal
--
Aníbal Monsalve Salazar <Anibal.MonsalveSalazar at imgtec.com>

debdiff osmium_0.0~20111213-g7f3500a-3.dsc osmium_0.0~20111213-g7f3500a-3.1.dsc
diff -Nru osmium-0.0~20111213-g7f3500a/debian/changelog osmium-0.0~20111213-g7f3500a/debian/changelog
--- osmium-0.0~20111213-g7f3500a/debian/changelog	2012-04-14 18:55:01.000000000 +0100
+++ osmium-0.0~20111213-g7f3500a/debian/changelog	2014-05-28 09:21:26.000000000 +0100
@@ -1,3 +1,13 @@
+osmium (0.0~20111213-g7f3500a-3.1) unstable; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix FTBFS on mips big-endian.
+    Add 04-big-endian.patch.
+    Patch by Jurica Stanojkovic <Jurica.Stanojkovic at imgtec.com>.
+    Closes: #749501.
+
+ -- Anibal Monsalve Salazar <anibal at debian.org>  Wed, 28 May 2014 09:20:00 +0100
+
 osmium (0.0~20111213-g7f3500a-3) unstable; urgency=low
 
   * Disable building the documentation, since doxygen randomly fails
diff -Nru osmium-0.0~20111213-g7f3500a/debian/patches/04-big-endian.patch osmium-0.0~20111213-g7f3500a/debian/patches/04-big-endian.patch
--- osmium-0.0~20111213-g7f3500a/debian/patches/04-big-endian.patch	1970-01-01 01:00:00.000000000 +0100
+++ osmium-0.0~20111213-g7f3500a/debian/patches/04-big-endian.patch	2014-05-28 09:19:55.000000000 +0100
@@ -0,0 +1,192 @@
+From: Jurica Stanojkovic <Jurica.Stanojkovic at imgtec.com>
+Subject: package osmium FTBFS on mips big-endian
+Date: Mon, 26 May 2014 10:20:07 -0700
+
+http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=749501
+
+Package osmium_0.0~20111213-g7f3500a-3 FTBFS on mips big-endian.
+
+Build log:
+https://buildd.debian.org/status/fetch.php?pkg=osmium&arch=mips&ver=0.0~20111213-g7f3500a-3&stamp=1397047060
+
+Test values are hard-coded in little-endian.
+
+This patch detects endianess used and adds big-endian test values.
+
+--- a/include/osmium/geometry.hpp
++++ b/include/osmium/geometry.hpp
+@@ -23,6 +23,7 @@ You should have received a copy of the L
+ */
+ 
+ #include <sstream>
++#include <endian.h>
+ 
+ #ifdef OSMIUM_WITH_GEOS
+ # include <geos/geom/GeometryFactory.h>
+@@ -40,6 +41,14 @@ You should have received a copy of the L
+ #include <osmium/exceptions.hpp>
+ #include <osmium/osm/types.hpp>
+ 
++#if __BYTE_ORDER == __LITTLE_ENDIAN
++# define BYTE_ORDER_LITTLE_ENDIAN
++#elif __BYTE_ORDER == __BIG_ENDIAN
++# define BYTE_ORDER_BIG_ENDIAN
++#else
++# error unknown byte order
++#endif
++
+ namespace Osmium {
+ 
+     /**
+@@ -161,7 +173,11 @@ namespace Osmium {
+          * - (optionally) the SRID
+          */
+         inline void write_binary_wkb_header(std::ostream& out, bool with_srid, uint32_t type) {
++#ifdef BYTE_ORDER_LITTLE_ENDIAN // LITTLE_ENDIAN
+             write_binary<uint8_t>(out, wkbNDR);
++#else // BIG_ENDIAN
++	    write_binary<uint8_t>(out, wkbXDR);
++#endif
+             if (with_srid) {
+                 write_binary<uint32_t>(out, type | wkbSRID);
+                 write_binary<uint32_t>(out, srid);
+@@ -178,7 +194,11 @@ namespace Osmium {
+          * - (optionally) the SRID
+          */
+         inline void write_hex_wkb_header(std::ostream& out, bool with_srid, uint32_t type) {
++#ifdef BYTE_ORDER_LITTLE_ENDIAN // LITTLE_ENDIAN
+             write_hex<uint8_t>(out, wkbNDR);
++#else // BIG_ENDIAN
++            write_hex<uint8_t>(out, wkbXDR);
++#endif
+             if (with_srid) {
+                 write_hex<uint32_t>(out, type | wkbSRID);
+                 write_hex<uint32_t>(out, srid);
+--- a/test/testgroup_ogr/geometry/test_geometry.cpp
++++ b/test/testgroup_ogr/geometry/test_geometry.cpp
+@@ -53,7 +53,11 @@ BOOST_AUTO_TEST_CASE(polygon_from_way) {
+     OGRPolygon* ogrpolygon = polygon.create_ogr_geometry();
+     std::string ogrwkb;
+     ogrwkb.resize(ogrpolygon->WkbSize());
++#ifdef BYTE_ORDER_LITTLE_ENDIAN
+     ogrpolygon->exportToWkb(wkbNDR, (unsigned char*)ogrwkb.c_str());
++#else
++    ogrpolygon->exportToWkb(wkbXDR, (unsigned char*)ogrwkb.c_str());
++#endif
+     output_test_stream osmiumwkb;
+     osmiumwkb << polygon.as_WKB();
+     BOOST_CHECK_EQUAL(osmiumwkb.str().size(), ogrpolygon->WkbSize());
+--- a/test/testgroup_plain/geometry/test_linestring_geometry.cpp
++++ b/test/testgroup_plain/geometry/test_linestring_geometry.cpp
+@@ -47,19 +47,35 @@ BOOST_AUTO_TEST_CASE(output) {
+ 
+     std::ostringstream out_wkb;
+     out_wkb << line2.as_WKB();
++#ifdef BYTE_ORDER_LITTLE_ENDIAN
+     BOOST_CHECK_EQUAL(Osmium::Test::to_hex(out_wkb.str()), "01020000000300000033333333333307403333333333330740666666666666FE3F3333333333330740666666666666FE3F666666666666FE3F");
++#else
++    BOOST_CHECK_EQUAL(Osmium::Test::to_hex(out_wkb.str()), "000000000200000003400733333333333340073333333333333FFE66666666666640073333333333333FFE6666666666663FFE666666666666");
++#endif
+ 
+     std::ostringstream out_ewkb;
+     out_ewkb << line2.as_WKB(true);
++#ifdef BYTE_ORDER_LITTLE_ENDIAN
+     BOOST_CHECK_EQUAL(Osmium::Test::to_hex(out_ewkb.str()), "0102000020E61000000300000033333333333307403333333333330740666666666666FE3F3333333333330740666666666666FE3F666666666666FE3F");
++#else
++    BOOST_CHECK_EQUAL(Osmium::Test::to_hex(out_ewkb.str()), "0020000002000010E600000003400733333333333340073333333333333FFE66666666666640073333333333333FFE6666666666663FFE666666666666");
++#endif
+ 
+     std::ostringstream out_hexwkb;
+     out_hexwkb << line1.as_HexWKB();
++#ifdef BYTE_ORDER_LITTLE_ENDIAN
+     BOOST_CHECK_EQUAL(out_hexwkb.str(), "010200000003000000666666666666FE3F666666666666FE3F666666666666FE3F333333333333074033333333333307403333333333330740");
++#else
++    BOOST_CHECK_EQUAL(out_hexwkb.str(), "0000000002000000033FFE6666666666663FFE6666666666663FFE666666666666400733333333333340073333333333334007333333333333");
++#endif
+ 
+     std::ostringstream out_hexewkb;
+     out_hexewkb << line1.as_HexWKB(true);
++#ifdef BYTE_ORDER_LITTLE_ENDIAN
+     BOOST_CHECK_EQUAL(out_hexewkb.str(), "0102000020E610000003000000666666666666FE3F666666666666FE3F666666666666FE3F333333333333074033333333333307403333333333330740");
++#else
++    BOOST_CHECK_EQUAL(out_hexewkb.str(), "0020000002000010E6000000033FFE6666666666663FFE6666666666663FFE666666666666400733333333333340073333333333334007333333333333");
++#endif
+ }
+ 
+ BOOST_AUTO_TEST_SUITE_END()
+--- a/test/testgroup_plain/geometry/test_point_geometry.cpp
++++ b/test/testgroup_plain/geometry/test_point_geometry.cpp
+@@ -36,19 +36,35 @@ BOOST_AUTO_TEST_CASE(output) {
+ 
+     std::ostringstream out_wkb;
+     out_wkb << point1.as_WKB();
++#ifdef BYTE_ORDER_LITTLE_ENDIAN
+     BOOST_CHECK_EQUAL(Osmium::Test::to_hex(out_wkb.str()), "0101000000333333333333F33F3333333333330B40");
++#else
++    BOOST_CHECK_EQUAL(Osmium::Test::to_hex(out_wkb.str()), "00000000013FF3333333333333400B333333333333");
++#endif
+ 
+     std::ostringstream out_ewkb;
+     out_ewkb << point1.as_WKB(true);
++#ifdef BYTE_ORDER_LITTLE_ENDIAN
+     BOOST_CHECK_EQUAL(Osmium::Test::to_hex(out_ewkb.str()), "0101000020E6100000333333333333F33F3333333333330B40");
++#else
++    BOOST_CHECK_EQUAL(Osmium::Test::to_hex(out_ewkb.str()), "0020000001000010E63FF3333333333333400B333333333333");
++#endif
+ 
+     std::ostringstream out_hexwkb;
+     out_hexwkb << point1.as_HexWKB();
++#ifdef BYTE_ORDER_LITTLE_ENDIAN
+     BOOST_CHECK_EQUAL(out_hexwkb.str(), "0101000000333333333333F33F3333333333330B40");
++#else
++    BOOST_CHECK_EQUAL(out_hexwkb.str(), "00000000013FF3333333333333400B333333333333");
++#endif
+ 
+     std::ostringstream out_hexewkb;
+     out_hexewkb << point1.as_HexWKB(true);
++#ifdef BYTE_ORDER_LITTLE_ENDIAN
+     BOOST_CHECK_EQUAL(out_hexewkb.str(), "0101000020E6100000333333333333F33F3333333333330B40");
++#else
++    BOOST_CHECK_EQUAL(out_hexewkb.str(), "0020000001000010E63FF3333333333333400B333333333333");
++#endif
+ }
+ 
+ BOOST_AUTO_TEST_SUITE_END()
+--- a/test/testgroup_plain/geometry/test_polygon_geometry.cpp
++++ b/test/testgroup_plain/geometry/test_polygon_geometry.cpp
+@@ -51,19 +51,35 @@ BOOST_AUTO_TEST_CASE(output) {
+ 
+     std::ostringstream out_wkb;
+     out_wkb << polygon.as_WKB();
++#ifdef BYTE_ORDER_LITTLE_ENDIAN
+     BOOST_CHECK_EQUAL(Osmium::Test::to_hex(out_wkb.str()), "01030000000100000004000000666666666666FE3F666666666666FE3F666666666666FE3F333333333333074033333333333307403333333333330740666666666666FE3F666666666666FE3F");
+
++#else
++    BOOST_CHECK_EQUAL(Osmium::Test::to_hex(out_wkb.str()), "000000000300000001000000043FFE6666666666663FFE6666666666663FFE6666666666664007333333333333400733333333333340073333333333333FFE6666666666663FFE666666666666");
++#endif
+     std::ostringstream out_ewkb;
+     out_ewkb << polygon.as_WKB(true);
++#ifdef BYTE_ORDER_LITTLE_ENDIAN
+     BOOST_CHECK_EQUAL(Osmium::Test::to_hex(out_ewkb.str()), "0103000020E61000000100000004000000666666666666FE3F666666666666FE3F666666666666FE3F333333333333074033333333333307403333333333330740666666666666FE3F666666666666FE3F");
+
++#else
++    BOOST_CHECK_EQUAL(Osmium::Test::to_hex(out_ewkb.str()), "0020000003000010E600000001000000043FFE6666666666663FFE6666666666663FFE6666666666664007333333333333400733333333333340073333333333333FFE6666666666663FFE666666666666");
++#endif
+     std::ostringstream out_hexwkb;
+     out_hexwkb << polygon.as_HexWKB();
++#ifdef BYTE_ORDER_LITTLE_ENDIAN
+     BOOST_CHECK_EQUAL(out_hexwkb.str(), "01030000000100000004000000666666666666FE3F666666666666FE3F666666666666FE3F333333333333074033333333333307403333333333330740666666666666FE3F666666666666FE3F");
+
++#else
++    BOOST_CHECK_EQUAL(out_hexwkb.str(), "000000000300000001000000043FFE6666666666663FFE6666666666663FFE6666666666664007333333333333400733333333333340073333333333333FFE6666666666663FFE666666666666");
++#endif
+     std::ostringstream out_hexewkb;
+     out_hexewkb << polygon.as_HexWKB(true);
++#ifdef BYTE_ORDER_LITTLE_ENDIAN
+     BOOST_CHECK_EQUAL(out_hexewkb.str(), "0103000020E61000000100000004000000666666666666FE3F666666666666FE3F666666666666FE3F333333333333074033333333333307403333333333330740666666666666FE3F666666666666FE3F");
++#else
++    BOOST_CHECK_EQUAL(out_hexewkb.str(), "0020000003000010E600000001000000043FFE6666666666663FFE6666666666663FFE6666666666664007333333333333400733333333333340073333333333333FFE6666666666663FFE666666666666");
++#endif
+ }
+ 
+ BOOST_AUTO_TEST_SUITE_END()
diff -Nru osmium-0.0~20111213-g7f3500a/debian/patches/series osmium-0.0~20111213-g7f3500a/debian/patches/series
--- osmium-0.0~20111213-g7f3500a/debian/patches/series	2012-04-14 18:55:01.000000000 +0100
+++ osmium-0.0~20111213-g7f3500a/debian/patches/series	2014-05-27 11:37:01.000000000 +0100
@@ -2,3 +2,4 @@
 01-fix_ld--as-needed.patch
 02-support_new_libgeos++.patch
 03-disable_building_docs.patch
+04-big-endian.patch
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.alioth.debian.org/pipermail/pkg-osm-maint/attachments/20140528/10be91fa/attachment-0001.sig>


More information about the Pkg-osm-maint mailing list