[Git][debian-gis-team/sfcgal][master] 2 commits: Add patches by Sebastien Loriot to fix FTBFS with CGAL 4.11.

Bas Couwenberg gitlab at salsa.debian.org
Thu Mar 15 19:07:35 UTC 2018


Bas Couwenberg pushed to branch master at Debian GIS Project / sfcgal


Commits:
69f9c209 by Bas Couwenberg at 2018-03-15T18:55:17+01:00
Add patches by Sebastien Loriot to fix FTBFS with CGAL 4.11.

- - - - -
6f577f50 by Bas Couwenberg at 2018-03-15T19:43:31+01:00
Add patch to remove FindCGAL.cmake, breaks Config mode.

- - - - -


5 changed files:

- debian/changelog
- + debian/patches/fix-gmpxx-compatibility-in-tests.patch
- + debian/patches/remove-findcgal.patch
- debian/patches/series
- + debian/patches/update-cmake-scripts.patch


Changes:

=====================================
debian/changelog
=====================================
--- a/debian/changelog
+++ b/debian/changelog
@@ -8,8 +8,9 @@ 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)
+  * Add patch to remove FindCGAL.cmake, breaks Config mode.
 
  -- Bas Couwenberg <sebastic at debian.org>  Fri, 15 Sep 2017 20:49:16 +0200
 


=====================================
debian/patches/fix-gmpxx-compatibility-in-tests.patch
=====================================
--- /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 )


=====================================
debian/patches/remove-findcgal.patch
=====================================
--- /dev/null
+++ b/debian/patches/remove-findcgal.patch
@@ -0,0 +1,101 @@
+Description: Remove FindCGAL.cmake, breaks Config mode.
+Author: Bas Couwenberg <sebastic at debian.org>
+Bug: https://github.com/Oslandia/SFCGAL/issues/145
+Bug-Debian: https://bugs.debian.org/876521
+
+--- a/cmake/Modules/FindCGAL.cmake
++++ /dev/null
+@@ -1,93 +0,0 @@
+-find_path(CGAL_INCLUDE_DIRS CGAL/gmp.h
+-    HINTS $ENV{CGAL_DIR}/include ${CGAL_DIR}/include ${CGAL_INCLUDE_DIRS}
+-    PATH_SUFFIXES CGAL
+-)
+-
+-if( MSVC10)
+-	set( CGAL_LIBRARY_POSTFIX "-vc100-mt-${CGAL_VERSION}" )
+-	set( CGAL_LIBRARY_POSTFIX_DEBUG "-vc100-mt-gd-${CGAL_VERSION}" )
+-else()
+-	set( CGAL_LIBRARY_POSTFIX "")
+-	set( CGAL_LIBRARY_POSTFIX_DEBUG "d")
+-endif()
+-
+-#-- incidates if debug version are found
+-set( CGAL_DEBUG_FOUND ON )
+-
+-
+-#-- find CGAL library
+-find_library( CGAL_LIBRARY "CGAL${CGAL_LIBRARY_POSTFIX}" ${CGAL_LIBRARY}
+-	HINTS ${CGAL_LIBRARY_DIRS} $ENV{CGAL_DIR}/lib
+-)
+-if( CGAL_LIBRARY )
+-	get_filename_component(CGAL_LIBRARY_DIRS ${CGAL_LIBRARY} PATH)
+-endif()
+-
+-if(CGAL_FIND_VERSION)
+-    message("CGAL_DIR ${CGAL_DIR}")
+-    find_file(version_file version.h HINTS $ENV{CGAL_DIR}/include ${CGAL_DIR}/include ${CGAL_INCLUDE_DIRS} PATH_SUFFIXES CGAL)
+-    file(STRINGS ${version_file} version_str REGEX "# *define +CGAL_VERSION +")
+-    string( REGEX REPLACE "# *define +CGAL_VERSION +" "" CGAL_VERSION ${version_str})
+-    if("${CGAL_VERSION}" VERSION_LESS "${CGAL_FIND_VERSION}")
+-        message(FATAL_ERROR "CGAL " ${CGAL_FIND_VERSION} " is required (found " ${CGAL_VERSION} " in ${version_file})" )
+-    endif()
+-
+-endif()
+-
+-find_library( CGAL_LIBRARY_DEBUG "CGAL${CGAL_LIBRARY_POSTFIX_DEBUG}" ${CGAL_LIBRARY_DEBUG}
+-	HINTS ${CGAL_LIBRARY_DIRS}
+-)
+-if( NOT CGAL_LIBRARY_DEBUG )
+-	set( CGAL_DEBUG_FOUND OFF )
+-endif()
+-
+-#-- CGAL components (Core, ImageIO)
+-foreach( CGAL_COMPONENT ${CGAL_FIND_COMPONENTS} )
+-	#-- find release
+-	find_library( CGAL_${CGAL_COMPONENT}_LIBRARY "CGAL_${CGAL_COMPONENT}${CGAL_LIBRARY_POSTFIX}" "${CGAL_${CGAL_COMPONENT}_LIBRARY}"
+-		HINTS ${CGAL_LIBRARY_DIRS} $ENV{CGAL_DIR}/lib
+-	)
+-	#-- find debug
+-	find_library( CGAL_${CGAL_COMPONENT}_LIBRARY_DEBUG "CGAL_${CGAL_COMPONENT}${CGAL_LIBRARY_POSTFIX_DEBUG}" "${CGAL_${CGAL_COMPONENT}_LIBRARY_DEBUG}"
+-		HINTS ${CGAL_LIBRARY_DIRS} $ENV{CGAL_DIR}/lib
+-	)
+-	
+-	if( NOT CGAL_${CGAL_COMPONENT}_LIBRARY_DEBUG )
+-		set( CGAL_DEBUG_FOUND OFF )
+-	endif()
+-endforeach()
+- 
+-
+-#-- build variable CGAL_LIBRARIES
+-
+-set( CGAL_LIBRARIES "" )
+-if( ${CGAL_DEBUG_FOUND} )
+-	list( APPEND CGAL_LIBRARIES optimized ${CGAL_LIBRARY} debug ${CGAL_LIBRARY_DEBUG} )
+-	foreach( CGAL_COMPONENT ${CGAL_FIND_COMPONENTS} )
+-		list( APPEND CGAL_LIBRARIES optimized "${CGAL_${CGAL_COMPONENT}_LIBRARY}" debug "${CGAL_${CGAL_COMPONENT}_LIBRARY_DEBUG}" )
+-	endforeach()
+-else()
+-	list( APPEND CGAL_LIBRARIES ${CGAL_LIBRARY} )
+-	foreach( CGAL_COMPONENT ${CGAL_FIND_COMPONENTS} )
+-		list( APPEND CGAL_LIBRARIES ${CGAL_${CGAL_COMPONENT}_LIBRARY} )
+-	endforeach()
+-endif()
+-
+-#-- report/validate
+-set( CGAL_COMPONENT_LIBRARIES "" )
+-set( CGAL_COMPONENT_LIBRARIES_DEBUG "" )
+-foreach( CGAL_COMPONENT ${CGAL_FIND_COMPONENTS} )
+-	list( APPEND CGAL_COMPONENT_LIBRARIES CGAL_${CGAL_COMPONENT}_LIBRARY )
+-	list( APPEND CGAL_COMPONENT_LIBRARIES_DEBUG CGAL_${CGAL_COMPONENT}_LIBRARY_DEBUG )
+-endforeach()
+-
+-include(FindPackageHandleStandardArgs)
+-find_package_handle_standard_args(
+-	CGAL DEFAULT_MSG
+-	CGAL_INCLUDE_DIRS CGAL_LIBRARIES ${CGAL_COMPONENT_LIBRARIES}
+-)
+-
+-mark_as_advanced( CGAL_LIBRARY_DIRS CGAL_LIBRARY_DEBUG ${CGAL_COMPONENT_LIBRARIES_DEBUG} )
+-
+-
+-


=====================================
debian/patches/series
=====================================
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,5 @@
 no-matching-function-call.patch
 Compatibility-with-gmpxx.patch
+fix-gmpxx-compatibility-in-tests.patch
+update-cmake-scripts.patch
+remove-findcgal.patch


=====================================
debian/patches/update-cmake-scripts.patch
=====================================
--- /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)



View it on GitLab: https://salsa.debian.org/debian-gis-team/sfcgal/compare/3462db2f47beaaa39c3ed9022749accfed619dc2...6f577f50b0da4856954cbf2905f41197e4c9ae12

---
View it on GitLab: https://salsa.debian.org/debian-gis-team/sfcgal/compare/3462db2f47beaaa39c3ed9022749accfed619dc2...6f577f50b0da4856954cbf2905f41197e4c9ae12
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/pkg-grass-devel/attachments/20180315/5e1d3e05/attachment-0001.html>


More information about the Pkg-grass-devel mailing list