[sfcgal] 01/02: Add patches by Sebastien Loriot to fix FTBFS with CGAL 4.11.

Bas Couwenberg sebastic at debian.org
Thu Mar 15 19:07:18 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 69f9c2097cf408b111c70937fedcf3bbdbba32d1
Author: Bas Couwenberg <sebastic at xs4all.nl>
Date:   Thu Mar 15 17:12:35 2018 +0100

    Add patches by Sebastien Loriot to fix FTBFS with CGAL 4.11.
---
 debian/changelog                                   |   2 +-
 .../patches/fix-gmpxx-compatibility-in-tests.patch | 105 +++++++++++++++++++++
 debian/patches/series                              |   2 +
 debian/patches/update-cmake-scripts.patch          | 100 ++++++++++++++++++++
 4 files changed, 208 insertions(+), 1 deletion(-)

diff --git a/debian/changelog b/debian/changelog
index a2d27f6..d889bb8 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -8,7 +8,7 @@ sfcgal (1.3.2-1) UNRELEASED; urgency=medium
   * Add patch by Pierre-Eric Pelloux-Prayer to fix FTBFS with CGAL 4.11.
     (closes: #876521)
   * Update copyright-format URL to use HTTPS.
-  * Add patch by Sebastien Loriot to fix FTBFS with CGAL 4.11.
+  * Add patches by Sebastien Loriot to fix FTBFS with CGAL 4.11.
     (closes: #876521)
 
  -- Bas Couwenberg <sebastic at debian.org>  Fri, 15 Sep 2017 20:49:16 +0200
diff --git a/debian/patches/fix-gmpxx-compatibility-in-tests.patch b/debian/patches/fix-gmpxx-compatibility-in-tests.patch
new file mode 100644
index 0000000..23344f1
--- /dev/null
+++ b/debian/patches/fix-gmpxx-compatibility-in-tests.patch
@@ -0,0 +1,105 @@
+Description: fix gmpxx compatibility in tests
+Author: =?UTF-8?q?S=C3=A9bastien=20Loriot?= <sebastien.loriot at cgal.org>
+Origin: https://github.com/Oslandia/SFCGAL/pull/157/commits/3c840d79b21993a0b7a590eb3a57cd25194a0c4b
+Bug: https://github.com/Oslandia/SFCGAL/issues/145
+Bug-Debian: https://bugs.debian.org/876521
+
+--- a/src/numeric.cpp
++++ b/src/numeric.cpp
+@@ -58,6 +58,48 @@ CGAL::Gmpz round( const CGAL::Gmpq& v )
+     }
+ }
+ 
++#ifdef CGAL_USE_GMPXX
++///
++///
++///
++mpz_class floor( const mpq_class& v )
++{
++    return v.get_num() / v.get_den() ;
++}
++
++///
++///
++///
++mpz_class ceil( const mpq_class& v )
++{
++    mpz_class result( 0 ) ;
++    mpz_cdiv_q( result.get_mpz_t(), v.get_num().get_mpz_t(), v.get_den().get_mpz_t() ) ;
++    return result ;
++}
++
++///
++///
++///
++mpz_class round( const mpq_class& v )
++{
++    if ( v < 0 ) {
++        //ceil( v - 0.5 ) ;
++        mpq_class tmp = v - mpq_class( 1,2 );
++        return ceil( tmp );
++    }
++    else if ( v == 0 ) {
++        return 0 ;
++    }
++    else {
++        //floor( v + 0.5 ) ;
++        mpq_class tmp = v + mpq_class( 1,2 );
++        return floor( tmp );
++    }
++}
++#endif
++
++
++
+ }//SFCGAL
+ 
+ 
+--- a/test/unit/SFCGAL/KernelTest.cpp
++++ b/test/unit/SFCGAL/KernelTest.cpp
+@@ -22,6 +22,7 @@
+ #include <boost/test/unit_test.hpp>
+ 
+ #include <SFCGAL/Kernel.h>
++#include <CGAL/mpq_class.h>
+ #include <SFCGAL/Coordinate.h>
+ #include <SFCGAL/LineString.h>
+ 
+@@ -61,10 +62,11 @@ BOOST_AUTO_TEST_CASE( testSerializeDeser
+     Kernel::FT a = 1 ;
+     a /= 3 ;
+ 
+-    std::ostringstream oss ;
+-    oss << CGAL::exact( a ) ;
++    std::stringstream ss ;
++    ss << CGAL::exact( a ) ;
+ 
+-    Kernel::FT b( oss.str() );
++    Kernel::FT b;
++    ss >> b;
+     BOOST_CHECK_EQUAL( a, b ) ;
+ }
+ 
+--- a/test/unit/SFCGAL/io/WktReaderTest.cpp
++++ b/test/unit/SFCGAL/io/WktReaderTest.cpp
+@@ -246,10 +246,16 @@ BOOST_AUTO_TEST_CASE( wkt_exactTest )
+     BOOST_REQUIRE_EQUAL( g->as< LineString >().numPoints(), 2U );
+     Kernel::Exact_kernel::FT x = CGAL::exact( g->as<LineString>().pointN( 0 ).x() );
+     Kernel::Exact_kernel::FT y = CGAL::exact( g->as<LineString>().pointN( 0 ).y() );
+-    BOOST_CHECK_EQUAL( x.numerator(), 2 );
+-    BOOST_CHECK_EQUAL( x.denominator(), 3 );
+-    BOOST_CHECK_EQUAL( y.numerator(), 3 );
+-    BOOST_CHECK_EQUAL( y.denominator(), 2 );
++
++    CGAL::Fraction_traits<Kernel::Exact_kernel::FT>::Numerator_type xn, xd, yn, yd;
++    CGAL::Fraction_traits<Kernel::Exact_kernel::FT>::Decompose decomp;
++    decomp(x, xn, xd);
++    decomp(y, yn, yd);
++
++    BOOST_CHECK_EQUAL( xn, 2 );
++    BOOST_CHECK_EQUAL( xd, 3 );
++    BOOST_CHECK_EQUAL( yn, 3 );
++    BOOST_CHECK_EQUAL( yd, 2 );
+ }
+ 
+ BOOST_AUTO_TEST_CASE( charArrayRead )
diff --git a/debian/patches/series b/debian/patches/series
index 39187ef..471350a 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,4 @@
 no-matching-function-call.patch
 Compatibility-with-gmpxx.patch
+fix-gmpxx-compatibility-in-tests.patch
+update-cmake-scripts.patch
diff --git a/debian/patches/update-cmake-scripts.patch b/debian/patches/update-cmake-scripts.patch
new file mode 100644
index 0000000..4d0a185
--- /dev/null
+++ b/debian/patches/update-cmake-scripts.patch
@@ -0,0 +1,100 @@
+Description: update cmake scripts
+Author: =?UTF-8?q?S=C3=A9bastien=20Loriot?= <sebastien.loriot at cgal.org>
+Origin: https://github.com/Oslandia/SFCGAL/pull/157/commits/3bb19aaf2343ce13b6ce2a0a0d9d59db036e1e0e
+Bug: https://github.com/Oslandia/SFCGAL/issues/145
+Bug-Debian: https://bugs.debian.org/876521
+
+--- a/test/garden/CMakeLists.txt
++++ b/test/garden/CMakeLists.txt
+@@ -6,12 +6,10 @@ add_executable( ${REGRESS_NAME} ${SFCGAL
+ 
+ target_link_libraries( ${REGRESS_NAME}
+ 	SFCGAL
+-	${Boost_LIBRARIES}
+-	${CGAL_LIBRARIES}
++        CGAL::CGAL
++        CGAL::CGAL_Core
+ )
+-if( ${SFCGAL_WITH_MPFR} )
+-  target_link_libraries( ${REGRESS_NAME} ${MPFR_LIBRARIES} )
+-endif( ${SFCGAL_WITH_MPFR} )
++target_link_libraries( ${REGRESS_NAME} ${CGAL_3RD_PARTY_LIBRARIES} )
+ 
+ set_target_properties( ${REGRESS_NAME} PROPERTIES DEBUG_POSTFIX "d" )
+ install( TARGETS ${REGRESS_NAME} DESTINATION bin )
+--- a/test/regress/convex_hull/CMakeLists.txt
++++ b/test/regress/convex_hull/CMakeLists.txt
+@@ -6,12 +6,11 @@ add_executable( ${REGRESS_NAME} ${SFCGAL
+ 
+ target_link_libraries( ${REGRESS_NAME}
+ 	SFCGAL
+-	${Boost_LIBRARIES}
+-	${CGAL_LIBRARIES}
++        CGAL::CGAL
++        CGAL::CGAL_Core
+ )
+-if( ${SFCGAL_WITH_MPFR} )
+-  target_link_libraries( ${REGRESS_NAME} ${MPFR_LIBRARIES} )
+-endif( ${SFCGAL_WITH_MPFR} )
++
++target_link_libraries( ${REGRESS_NAME} ${CGAL_3RD_PARTY_LIBRARIES} )
+ 
+ set_target_properties( ${REGRESS_NAME} PROPERTIES DEBUG_POSTFIX "d" )
+ install( TARGETS ${REGRESS_NAME} DESTINATION bin )
+--- a/test/regress/polygon_triangulator/CMakeLists.txt
++++ b/test/regress/polygon_triangulator/CMakeLists.txt
+@@ -6,12 +6,11 @@ add_executable( ${REGRESS_NAME} ${SFCGAL
+ 
+ target_link_libraries( ${REGRESS_NAME}
+ 	SFCGAL
+-	${Boost_LIBRARIES}
+-	${CGAL_LIBRARIES}
++        CGAL::CGAL
++        CGAL::CGAL_Core
+ )
+-if( ${SFCGAL_WITH_MPFR} )
+-  target_link_libraries( ${REGRESS_NAME} ${MPFR_LIBRARIES} )
+-endif( ${SFCGAL_WITH_MPFR} )
++target_link_libraries( ${REGRESS_NAME} ${CGAL_3RD_PARTY_LIBRARIES})
++
+ 
+ set_target_properties( ${REGRESS_NAME} PROPERTIES DEBUG_POSTFIX "d" )
+ install( TARGETS ${REGRESS_NAME} DESTINATION bin )
+--- a/test/regress/standalone/CMakeLists.txt
++++ b/test/regress/standalone/CMakeLists.txt
+@@ -4,12 +4,11 @@ add_executable( standalone-regress-test-
+ 
+ target_link_libraries( standalone-regress-test-SFCGAL 
+ 	SFCGAL
+-	${Boost_LIBRARIES}
+-	${CGAL_LIBRARIES}
++        CGAL::CGAL
++        CGAL::CGAL_Core
+ )
+-if( ${SFCGAL_WITH_MPFR} )
+-  target_link_libraries( standalone-regress-test-SFCGAL ${MPFR_LIBRARIES} )
+-endif( ${SFCGAL_WITH_MPFR} )
++target_link_libraries( standalone-regress-test-SFCGAL ${CGAL_3RD_PARTY_LIBRARIES} )
++
+ 
+ set_target_properties( standalone-regress-test-SFCGAL PROPERTIES DEBUG_POSTFIX "d" )
+ install( TARGETS standalone-regress-test-SFCGAL DESTINATION bin )
+--- a/test/unit/CMakeLists.txt
++++ b/test/unit/CMakeLists.txt
+@@ -3,13 +3,10 @@ file( GLOB_RECURSE SFCGAL_UNIT_TEST_SOUR
+ add_executable( unit-test-SFCGAL ${SFCGAL_UNIT_TEST_SOURCES} )
+ target_link_libraries( unit-test-SFCGAL 
+ 	SFCGAL
+-	${Boost_LIBRARIES}
+-	${CGAL_LIBRARIES}
++        CGAL::CGAL
++        CGAL::CGAL_Core
+ )
+-if( ${SFCGAL_WITH_MPFR} )
+-  target_link_libraries( unit-test-SFCGAL ${MPFR_LIBRARIES} ${GMP_LIBRARIES} )
+-endif( ${SFCGAL_WITH_MPFR} )
+-
++target_link_libraries(unit-test-SFCGAL ${CGAL_3RD_PARTY_LIBRARIES})
+ 
+ #include( PrecompiledHeader )
+ #if(PCHSupport_FOUND)

-- 
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