[sfcgal] 01/04: Add another patch by Sebastien Loriot to fix FTBFS with CGAL 4.11.

Bas Couwenberg sebastic at debian.org
Fri Mar 30 15:17:50 UTC 2018


This is an automated email from the git hooks/post-receive script.

sebastic pushed a commit to branch master
in repository sfcgal.

commit c8103a8b3430ee236ea631d3e0c7e0f52f5b3c40
Author: Bas Couwenberg <sebastic at xs4all.nl>
Date:   Thu Mar 22 20:43:22 2018 +0100

    Add another patch by Sebastien Loriot to fix FTBFS with CGAL 4.11.
---
 debian/patches/fix-IO-input-with-gmpxx.patch | 74 ++++++++++++++++++++++++++++
 debian/patches/inputstreamreader.patch       | 17 +++++++
 debian/patches/series                        |  2 +
 3 files changed, 93 insertions(+)

diff --git a/debian/patches/fix-IO-input-with-gmpxx.patch b/debian/patches/fix-IO-input-with-gmpxx.patch
new file mode 100644
index 0000000..2444587
--- /dev/null
+++ b/debian/patches/fix-IO-input-with-gmpxx.patch
@@ -0,0 +1,74 @@
+Description: fix I/O input with gmpxx + make it similar to Gmpq
+Author: =?UTF-8?q?S=C3=A9bastien=20Loriot?= <sebastien.loriot at cgal.org>
+Origin: https://github.com/Oslandia/SFCGAL/pull/157/commits/8de5943b4f392b1a6b7b4d89bfed5d735cb9a277
+Bug: https://github.com/Oslandia/SFCGAL/issues/145
+Bug-Debian: https://bugs.debian.org/876521
+
+--- a/src/Coordinate.cpp
++++ b/src/Coordinate.cpp
+@@ -267,10 +267,10 @@ private:
+ 
+     Kernel::FT _roundFT( const Kernel::FT& v ) const {
+         #ifdef CGAL_USE_GMPXX
+-        return Kernel::FT( ::mpq_class(
+-                               SFCGAL::round( v.exact() * _scaleFactor ),
+-                               _scaleFactor
+-                           ) ) ;
++        ::mpq_class q( SFCGAL::round( v.exact() * _scaleFactor ),
++                                    _scaleFactor) ;
++        q.canonicalize();
++        return Kernel::FT(q);
+         #else
+         return Kernel::FT( CGAL::Gmpq(
+                                SFCGAL::round( v.exact() * _scaleFactor ),
+--- a/src/detail/io/WktWriter.cpp
++++ b/src/detail/io/WktWriter.cpp
+@@ -40,6 +40,22 @@ namespace SFCGAL {
+ namespace detail {
+ namespace io {
+ 
++namespace impl {
++std::ostream& writeFT(std::ostream& s, const CGAL::Gmpq& ft)
++{
++  s << ft;
++  return s;
++}
++
++#ifdef CGAL_USE_GMPXX
++std::ostream& writeFT(std::ostream& s, const mpq_class& ft)
++{
++  s << ft.get_num() << "/" << ft.get_den();
++  return s;
++}
++#endif
++} //end of impl namespace
++
+ ///
+ ///
+ ///
+@@ -135,10 +151,12 @@ void WktWriter::writeCoordinateType( con
+ void WktWriter::writeCoordinate( const Point& g )
+ {
+     if ( _exactWrite ) {
+-        _s << CGAL::exact( g.x() ) << " " << CGAL::exact( g.y() );
++        impl::writeFT(_s, CGAL::exact( g.x() )) << " ";
++        impl::writeFT(_s, CGAL::exact( g.y() ));
+ 
+         if ( g.is3D() ) {
+-            _s << " " << CGAL::exact( g.z() );
++            _s << " ";
++            impl::writeFT(_s, CGAL::exact( g.z() ));
+         }
+     }
+     else {
+--- a/src/detail/tools/InputStreamReader.h
++++ b/src/detail/tools/InputStreamReader.h
+@@ -150,7 +150,7 @@ public:
+             skipWhiteSpaces();
+         }
+ 
+-        if ( _s >> value ) {
++        if ( CGAL::Input_rep<T>(value)(_s) ) {
+             commit();
+             return true ;
+         }
diff --git a/debian/patches/inputstreamreader.patch b/debian/patches/inputstreamreader.patch
new file mode 100644
index 0000000..716f59e
--- /dev/null
+++ b/debian/patches/inputstreamreader.patch
@@ -0,0 +1,17 @@
+Description: Suggestion by Laurent Rineau.
+Author: Laurent Rineau
+Origin: https://github.com/Oslandia/SFCGAL/pull/157#pullrequestreview-106251289
+Bug: https://github.com/Oslandia/SFCGAL/issues/145
+Bug-Debian: https://bugs.debian.org/876521
+
+--- a/src/detail/tools/InputStreamReader.h
++++ b/src/detail/tools/InputStreamReader.h
+@@ -150,7 +150,7 @@ public:
+             skipWhiteSpaces();
+         }
+ 
+-        if ( CGAL::Input_rep<T>(value)(_s) ) {
++        if(_s >> CGAL::iformat(value)) {
+             commit();
+             return true ;
+         }
diff --git a/debian/patches/series b/debian/patches/series
index 3e5440e..7c2e237 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -3,3 +3,5 @@ Compatibility-with-gmpxx.patch
 fix-gmpxx-compatibility-in-tests.patch
 update-cmake-scripts.patch
 remove-findcgal.patch
+fix-IO-input-with-gmpxx.patch
+inputstreamreader.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-grass/sfcgal.git



More information about the Pkg-grass-devel mailing list