From a40d397cdd1a35fdabf3a13ce7168d07ecbedbb3 Mon Sep 17 00:00:00 2001 From: Alexpux Date: Sat, 27 Jun 2015 10:23:48 +0300 Subject: [PATCH] cgal: Update to 4.6 --- mingw-w64-cgal/PKGBUILD | 36 ++--- mingw-w64-cgal/cgal-4.4-mingw.patch | 12 -- mingw-w64-cgal/convex_hull_fix.patch | 223 --------------------------- 3 files changed, 15 insertions(+), 256 deletions(-) delete mode 100644 mingw-w64-cgal/cgal-4.4-mingw.patch delete mode 100644 mingw-w64-cgal/convex_hull_fix.patch diff --git a/mingw-w64-cgal/PKGBUILD b/mingw-w64-cgal/PKGBUILD index 402cb3509a..403240dfef 100644 --- a/mingw-w64-cgal/PKGBUILD +++ b/mingw-w64-cgal/PKGBUILD @@ -2,52 +2,46 @@ _realname=cgal pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}" -pkgver=4.5.1 -pkgrel=3 -_pkgid=34139 +pkgver=4.6 +pkgrel=1 +_pkgid=34705 pkgdesc="Computational Geometry Algorithms Library (mingw-w64)" arch=('any') url="http://www.cgal.org" license=("LGPL, GPL") makedepends=("${MINGW_PACKAGE_PREFIX}-gcc" - "${MINGW_PACKAGE_PREFIX}-pkg-config" "${MINGW_PACKAGE_PREFIX}-cmake" "${MINGW_PACKAGE_PREFIX}-eigen3" - "${MINGW_PACKAGE_PREFIX}-boost") + "${MINGW_PACKAGE_PREFIX}-pkg-config") depends=("${MINGW_PACKAGE_PREFIX}-gcc-libs" - "${MINGW_PACKAGE_PREFIX}-mpfr" "${MINGW_PACKAGE_PREFIX}-boost" - "${MINGW_PACKAGE_PREFIX}-gmp") + "${MINGW_PACKAGE_PREFIX}-gmp" + "${MINGW_PACKAGE_PREFIX}-mpfr") optdepends=("${MINGW_PACKAGE_PREFIX}-eigen3: for some packages, see the CGAL manual" #"${MINGW_PACKAGE_PREFIX}qt4: for CGAL_Qt4" ) options=('strip' 'staticlibs') -source=(http://gforge.inria.fr/frs/download.php/$_pkgid/CGAL-$pkgver.tar.xz - cgal-4.4-mingw.patch - convex_hull_fix.patch +source=(http://gforge.inria.fr/frs/download.php/${_pkgid}/CGAL-${pkgver}.tar.xz msys2-relocate-cmake-config.patch) -sha1sums=('97c60d3b12727b4fbbcce45a0965941bb1d60cbe' - '1d2b06fe6faa0cb1ee748fa14f2de92f9e9e091f' - 'a847bc5aab43944429e7da62b5392347bac2fcd8' +sha1sums=('8f0f0351de319306fea7d61f32d6a25381a5310a' '3742f2bb189f6c53e66e6ba5562c28685f9d1a86') prepare() { - cd "${srcdir}"/CGAL-${pkgver%.*} - patch -p1 -i "${srcdir}"/cgal-4.4-mingw.patch - patch -p1 -i "${srcdir}"/convex_hull_fix.patch + cd "${srcdir}"/CGAL-${pkgver} patch -p1 -i "${srcdir}"/msys2-relocate-cmake-config.patch } build() { - mkdir $srcdir/build-${MINGW_CHOST} - cd $srcdir/build-${MINGW_CHOST} + [[ -d ${srcdir}/build-${MINGW_CHOST} ]] && rm -rf ${srcdir}/build-${MINGW_CHOST} + mkdir ${srcdir}/build-${MINGW_CHOST} + cd ${srcdir}/build-${MINGW_CHOST} MSYS2_ARG_CONV_EXCL="-DCMAKE_INSTALL_PREFIX=" \ - cmake \ + ${MINGW_PREFIX}/bin/cmake \ -G"MSYS Makefiles" \ -DCMAKE_INSTALL_PREFIX=${MINGW_PREFIX} \ -DCMAKE_BUILD_TYPE=Release \ - ../CGAL-${pkgver%.*} + ../CGAL-${pkgver} make } @@ -55,7 +49,7 @@ build() { package() { cd "${srcdir}/build-${MINGW_CHOST}" make install DESTDIR=${pkgdir} - MINGW_PREFIX_WIN=$(cygpath -m ${MINGW_PREFIX}) + local MINGW_PREFIX_WIN=$(cygpath -am ${MINGW_PREFIX}) sed -s "s|${MINGW_PREFIX_WIN}|\${RELOCATED_INSTALL_PREFIX}|g" -i "${pkgdir}"${MINGW_PREFIX}/lib/CGAL/CGALConfig.cmake sed -s "s|${MINGW_PREFIX}|\${RELOCATED_INSTALL_PREFIX}|g" -i "${pkgdir}"${MINGW_PREFIX}/lib/CGAL/CGALConfig.cmake } diff --git a/mingw-w64-cgal/cgal-4.4-mingw.patch b/mingw-w64-cgal/cgal-4.4-mingw.patch deleted file mode 100644 index fa6505f790..0000000000 --- a/mingw-w64-cgal/cgal-4.4-mingw.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -Naur CGAL-4.4-orig/include/CGAL/sse2.h CGAL-4.4/include/CGAL/sse2.h ---- CGAL-4.4-orig/include/CGAL/sse2.h 2012-11-13 17:13:59.000000000 +0400 -+++ CGAL-4.4/include/CGAL/sse2.h 2014-06-28 19:05:29.078000000 +0400 -@@ -27,7 +27,7 @@ - - #include - --#if defined ( _MSC_VER ) -+#if defined ( _WIN32 ) - #define CGAL_ALIGN_16 __declspec(align(16)) - #elif defined( __GNU__ ) - #define CGAL_ALIGN_16 __attribute__((aligned(16))) diff --git a/mingw-w64-cgal/convex_hull_fix.patch b/mingw-w64-cgal/convex_hull_fix.patch deleted file mode 100644 index 19bc308838..0000000000 --- a/mingw-w64-cgal/convex_hull_fix.patch +++ /dev/null @@ -1,223 +0,0 @@ -diff -Naur --ignore-all-space CGAL-4.5-org/include/CGAL/convex_hull_3.h CGAL-4.5/include/CGAL/convex_hull_3.h ---- CGAL-4.5-org/include/CGAL/convex_hull_3.h 2015-01-07 21:08:53.260410300 +0100 -+++ CGAL-4.5/include/CGAL/convex_hull_3.h 2015-01-07 09:24:02.000000000 +0100 -@@ -69,7 +69,7 @@ - //FT is a floating point type and Kernel is a filtered kernel - template - struct Default_traits_for_Chull_3{ -- typedef Convex_hull_traits_3< typename Kernel_traits::Kernel > type; -+ typedef Convex_hull_traits_3< typename Kernel_traits::Kernel, Tag_true > type; - }; - - template -@@ -77,9 +77,9 @@ - typedef CGAL::Polyhedron_3 type; - }; - --template --struct Default_polyhedron_for_Chull_3 >{ -- typedef typename Convex_hull_traits_3::Polyhedron_3 type; -+template -+struct Default_polyhedron_for_Chull_3 >{ -+ typedef typename Convex_hull_traits_3::Polyhedron_3 type; - }; - - //utility class to select the right version of internal predicate Is_on_positive_side_of_plane_3 -@@ -129,10 +129,10 @@ - //interval arithmetic (the protector must be created before using this predicate) - //and in case of failure, exact arithmetic is used. - template --class Is_on_positive_side_of_plane_3,Tag_true>{ -+class Is_on_positive_side_of_plane_3,Tag_true>{ - typedef Simple_cartesian::Type> PK; - typedef Simple_cartesian CK; -- typedef Convex_hull_traits_3 Traits; -+ typedef Convex_hull_traits_3 Traits; - typedef typename Traits::Point_3 Point_3; - - Cartesian_converter to_CK; -@@ -312,12 +312,8 @@ - template - void coplanar_3_hull(InputIterator first, InputIterator beyond, - const Point_3& p1, const Point_3& p2, const Point_3& p3, -- Polyhedron_3& P, const Traits& traits) -+ Polyhedron_3& P, const Traits& /* traits */) - { -- typedef typename Traits::Vector_3 Vector_3; -- typedef typename Traits::Construct_vector_3 Construct_vector_3; -- typedef typename Traits::Orientation_3 Orientation_3; -- - typedef typename internal::Convex_hull_3::Projection_traits PTraits; - typedef typename PTraits::Traits_xy_3 Traits_xy_3; - typedef typename PTraits::Traits_yz_3 Traits_yz_3; -@@ -326,31 +322,26 @@ - std::list CH_2; - typedef typename std::list::iterator CH_2_iterator; - -- Construct_vector_3 vector_3 = traits.construct_vector_3_object(); -- Orientation_3 orientation = traits.orientation_3_object(); -- Vector_3 v1 = vector_3(p1,p2); -- Vector_3 v2 = vector_3(p1,p3); -- -- Vector_3 vx = vector_3(1,0,0); -- -- -- -- if ( orientation(v1, v2, vx) != COPLANAR ) -+ Traits_xy_3 traits_xy; -+ typename Traits_xy_3::Left_turn_2 left_turn_in_xy = traits_xy.left_turn_2_object(); -+ if ( left_turn_in_xy(p1,p2,p3) || left_turn_in_xy(p2,p1,p3) ) - convex_hull_points_2( first, beyond, - std::back_inserter(CH_2), -- Traits_yz_3() ); -+ traits_xy ); - else{ -- Vector_3 vy = vector_3(0,1,0); -- if ( orientation(v1,v2,vy) != COPLANAR ) -+ Traits_yz_3 traits_yz; -+ typename Traits_yz_3::Left_turn_2 left_turn_in_yz = traits_yz.left_turn_2_object(); -+ if ( left_turn_in_yz(p1,p2,p3) || left_turn_in_yz(p2,p1,p3) ) - convex_hull_points_2( first, beyond, - std::back_inserter(CH_2), -- Traits_xz_3() ); -+ traits_yz ); - else{ -- CGAL_assertion_code( Vector_3 vz = vector_3(0,0,1); ) -- CGAL_assertion( orientation(v1,v2,vz) != COPLANAR ); -+ Traits_xz_3 traits_xz; -+ CGAL_assertion_code( typename Traits_xz_3::Left_turn_2 left_turn_in_xz = traits_xz.left_turn_2_object(); ) -+ CGAL_assertion( left_turn_in_xz(p1,p2,p3) || left_turn_in_xz(p2,p1,p3) ); - convex_hull_points_2( first, beyond, - std::back_inserter(CH_2), -- Traits_xy_3() ); -+ traits_xz ); - } - } - -diff -Naur --ignore-all-space CGAL-4.5-org/include/CGAL/Convex_hull_traits_3.h CGAL-4.5/include/CGAL/Convex_hull_traits_3.h ---- CGAL-4.5-org/include/CGAL/Convex_hull_traits_3.h 2015-01-07 21:08:53.188407300 +0100 -+++ CGAL-4.5/include/CGAL/Convex_hull_traits_3.h 2015-01-07 09:24:02.000000000 +0100 -@@ -27,6 +27,8 @@ - #include - #include - #include -+#include -+#include - - namespace CGAL { - template < class R_ > -@@ -53,18 +55,40 @@ - - }; - -+template -+struct Point_triple_converter{ -+ // Point_triple_less_signed_distance_to_plane_3 is only working with a Cartesian Kernel -+ // so I hardcoded the converter type -+ CGAL::Cartesian_converter base; -+ -+ Point_triple -+ operator()(const Point_triple& t) const{ -+ return Point_triple( -+ base(t.p()), -+ base(t.q()), -+ base(t.r()) ); -+ } -+ -+ typename To::Point_3 -+ operator()(const typename From::Point_3& t) const{ -+ return base(t); -+ } -+}; -+ - template - class Point_triple_has_on_positive_side_3 { - - public: - typedef typename K::Point_3 Point_3; -- typedef typename K::Plane_3 Plane_3; -+ typedef Point_triple Plane_3; - bool - operator()( const Plane_3& pl, const Point_3& p) const - { - typename K::Orientation_3 o; - return ( o(pl.p(), pl.q(), pl.r(), p) == CGAL::POSITIVE ); - } -+ -+ typedef bool result_type; - }; - template - class Point_triple_construct_orthogonal_vector_3 -@@ -103,12 +127,12 @@ - } - }; - --template -+template - class Point_triple_less_signed_distance_to_plane_3 - { - public: - typedef typename K::Point_3 Point_3; -- typedef typename K::Plane_3 Plane_3; -+ typedef Point_triple Plane_3; - - typedef bool result_type; - -@@ -135,14 +159,39 @@ - typedef typename GT::Point_3 Point_2; - }; - -+template -+struct Convex_hull_traits_base_3 { -+ typedef Point_triple_has_on_positive_side_3 Has_on_positive_side_3; - -+ typedef Point_triple_less_signed_distance_to_plane_3 -+ Less_signed_distance_to_plane_3; -+}; - - template --class Convex_hull_traits_3 -+struct Convex_hull_traits_base_3{ -+ typedef Filtered_predicate< -+ Point_triple_has_on_positive_side_3< typename R_::Exact_kernel_rt >, -+ Point_triple_has_on_positive_side_3< typename R_::Approximate_kernel >, -+ Point_triple_converter, -+ Point_triple_converter -+ > Has_on_positive_side_3; -+ -+ typedef Filtered_predicate< -+ Point_triple_less_signed_distance_to_plane_3< typename R_::Exact_kernel_rt >, -+ Point_triple_less_signed_distance_to_plane_3< typename R_::Approximate_kernel >, -+ Point_triple_converter, -+ Point_triple_converter -+ > Less_signed_distance_to_plane_3; -+}; -+ -+ -+template -+class Convex_hull_traits_3 : -+ public Convex_hull_traits_base_3 - { - public: - typedef R_ R; -- typedef Convex_hull_traits_3 Self; -+ typedef Convex_hull_traits_3 Self; - typedef typename R::Point_3 Point_3; - typedef typename R::Segment_3 Segment_3; - typedef typename R::Triangle_3 Triangle_3; -@@ -172,10 +221,12 @@ - typedef typename R::Collinear_3 Collinear_3; - typedef typename R::Coplanar_3 Coplanar_3; - typedef typename R::Less_distance_to_point_3 Less_distance_to_point_3; -- typedef Point_triple_has_on_positive_side_3 Has_on_positive_side_3; - -- typedef Point_triple_less_signed_distance_to_plane_3 -- Less_signed_distance_to_plane_3; -+ typedef typename Convex_hull_traits_base_3 -+ ::Has_on_positive_side_3 Has_on_positive_side_3; -+ -+ typedef typename Convex_hull_traits_base_3 -+ ::Less_signed_distance_to_plane_3 Less_signed_distance_to_plane_3; - - // required for degenerate case of all points coplanar - typedef CGAL::Projection_traits_xy_3 Traits_xy_3;