On 2023/07/08 09:48, Antoine Jacoutot wrote:
> On Wed, Jul 05, 2023 at 01:22:46AM -0600, Landry Breuil wrote:
> > CVSROOT: /cvs
> > Module name: ports
> > Changes by: [email protected] 2023/07/05 01:22:46
> >
> > Modified files:
> > geo/geos : Makefile distinfo
> > geo/geos/pkg : PLIST
> >
> > Log message:
> > geo/geos: update to 3.12.0, now requires C++14
> > see https://github.com/libgeos/geos/blob/3.12.0/NEWS.md#changes-in-3120
>
> I don't know if this has been reported before but it broke cad/pcb2gcode.
>
> geos_helpers.cpp:7:10: fatal error: 'geos/geom/CoordinateSequenceFactory.h'
> file not found
> #include <geos/geom/CoordinateSequenceFactory.h>
>
> --
> Antoine
>
yep - tracey, is this update ok with you?
Index: Makefile
===================================================================
RCS file: /cvs/ports/cad/pcb2gcode/Makefile,v
retrieving revision 1.6
diff -u -p -r1.6 Makefile
--- Makefile 6 Nov 2022 09:23:24 -0000 1.6
+++ Makefile 7 Jul 2023 13:08:05 -0000
@@ -1,10 +1,9 @@
COMMENT = tool for isolation, routing, and drilling of PCBs
-V = 2.4.0
+V = 2.5.0
GH_ACCOUNT = pcb2gcode
GH_PROJECT = pcb2gcode
GH_TAGNAME = v${V}
-REVISION = 2
CATEGORIES = cad
Index: distinfo
===================================================================
RCS file: /cvs/ports/cad/pcb2gcode/distinfo,v
retrieving revision 1.2
diff -u -p -r1.2 distinfo
--- distinfo 11 May 2021 19:09:34 -0000 1.2
+++ distinfo 7 Jul 2023 13:08:05 -0000
@@ -1,2 +1,2 @@
-SHA256 (pcb2gcode-2.4.0.tar.gz) = XU8G9wQf4UoQh4C9uVOqUg9+VWdzp7n7hDXpuS/vYU0=
-SIZE (pcb2gcode-2.4.0.tar.gz) = 7456824
+SHA256 (pcb2gcode-2.5.0.tar.gz) = lvGxtP1Y6G8VK2kSAqFVk4FZSdySUPq5qwLyNG9cLFI=
+SIZE (pcb2gcode-2.5.0.tar.gz) = 7654793
Index: patches/patch-bg_operators_cpp
===================================================================
RCS file: patches/patch-bg_operators_cpp
diff -N patches/patch-bg_operators_cpp
--- patches/patch-bg_operators_cpp 11 Mar 2022 18:24:31 -0000 1.4
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,42 +0,0 @@
-backport https://github.com/pcb2gcode/pcb2gcode/pull/594 to fix build with
geos 3.10
-
-Index: bg_operators.cpp
---- bg_operators.cpp.orig
-+++ bg_operators.cpp
-@@ -2,8 +2,8 @@
- #include "geometry_int.hpp"
- #include "bg_helpers.hpp"
- #ifdef GEOS_VERSION
--#include <geos/operation/union/CascadedUnion.h>
- #include <geos/util/TopologyException.h>
-+#include <geos/geom/GeometryFactory.h>
- #include "geos_helpers.hpp"
- #endif // GEOS_VERSION
-
-@@ -245,7 +245,6 @@ multi_polygon_type_fp sum(const std::vector<multi_poly
- return mpolys[0];
- }
- #ifdef GEOS_VERSION
-- std::vector<geos::geom::Geometry*> geos_mpolys;
- std::vector<std::unique_ptr<geos::geom::Geometry>> geos_mpolys_tmp;
- for (const auto& mpoly : mpolys) {
- if (bg::area(mpoly) == 0) {
-@@ -254,14 +253,15 @@ multi_polygon_type_fp sum(const std::vector<multi_poly
- auto mpoly_temp = mpoly;
- round(mpoly_temp);
- geos_mpolys_tmp.push_back(to_geos(mpoly_temp));
-- geos_mpolys.push_back(geos_mpolys_tmp.back().get());
- }
-- if (geos_mpolys.size() == 0) {
-+ auto geos_factory = geos::geom::GeometryFactory::create();
-+ auto geos_collection =
geos_factory->buildGeometry(std::move(geos_mpolys_tmp));
-+ if (geos_collection->isEmpty()) {
- return {};
- }
- try {
- std::unique_ptr<geos::geom::Geometry> geos_out(
-- geos::operation::geounion::CascadedUnion::Union(&geos_mpolys));
-+ geos_collection->Union());
- return from_geos<multi_polygon_type_fp>(geos_out);
- } catch (const geos::util::TopologyException& e) {
- std::cerr << "\nError: Internal error with libgeos. Upgrading geos may
help." << std::endl;
Index: patches/patch-geos_helpers_cpp
===================================================================
RCS file: /cvs/ports/cad/pcb2gcode/patches/patch-geos_helpers_cpp,v
retrieving revision 1.1
diff -u -p -r1.1 patch-geos_helpers_cpp
--- patches/patch-geos_helpers_cpp 26 Jul 2022 12:05:05 -0000 1.1
+++ patches/patch-geos_helpers_cpp 7 Jul 2023 13:08:05 -0000
@@ -1,21 +1,53 @@
-fix build with geos 3.11.
+From a7c2ec216cb50fa4f01d61c358cb93e7a17b01d1 Mon Sep 17 00:00:00 2001
+From: eyal0 <[email protected]>
+Date: Wed, 7 Dec 2022 22:09:53 -0700
+Subject: [PATCH] fix: Don't use the CoordinateSequenceFactory.
-https://github.com/pcb2gcode/pcb2gcode/commit/f7b93da36eb607f92b4d35ea576658ae008ca6a5
+It's not used anymore in geos since geos commit
+https://github.com/libgeos/geos/commit/d463bcb6df8fc1f01f276b27719ee8ccfb2d788a
.
Index: geos_helpers.cpp
--- geos_helpers.cpp.orig
+++ geos_helpers.cpp
-@@ -3,13 +3,10 @@
- #include "geos_helpers.hpp"
+@@ -4,11 +4,20 @@
#include "geometry.hpp"
#include <geos/io/WKTReader.h>
--#include <geos/io/WKTReader.inl>
#include <geos/io/WKTWriter.h>
- #include <geos/geom/CoordinateSequenceFactory.h>
+-#include <geos/geom/CoordinateSequenceFactory.h>
#include <geos/geom/Coordinate.h>
--#include <geos/geom/Coordinate.inl>
#include <geos/geom/GeometryFactory.h>
--#include <geos/geom/GeometryFactory.inl>
#include <boost/pointer_cast.hpp>
++#include <geos/version.h>
++#include <geos/util.h>
++#if ((GEOS_VERSION_MAJOR > 3) || \
++ (GEOS_VERSION_MAJOR == 3 && GEOS_VERSION_MINOR > 11))
++ #define CoordinateArraySequence CoordinateSequence
++ #include <geos/geom/CoordinateSequence.h>
++#else
++ #include <geos/geom/CoordinateArraySequence.h>
++#endif
++
linestring_type_fp from_geos(const geos::geom::LineString* ls) {
+ linestring_type_fp ret;
+ ret.reserve(ls->getNumPoints());
+@@ -86,8 +95,7 @@ multi_polygon_type_fp from_geos(const std::unique_ptr<
+ std::unique_ptr<geos::geom::LineString> to_geos(
+ const linestring_type_fp& ls) {
+ auto geom_factory = geos::geom::GeometryFactory::create();
+- auto coord_factory = geom_factory->getCoordinateSequenceFactory();
+- auto coords = coord_factory->create(ls.size(), 2 /* dimensions */);
++ auto coords =
geos::detail::make_unique<geos::geom::CoordinateArraySequence>(ls.size(), 2 /*
dimensions */);
+ for (size_t i = 0; i < ls.size(); i++) {
+ coords->setAt(geos::geom::Coordinate(ls[i].x(), ls[i].y()), i);
+ }
+@@ -96,8 +104,7 @@ std::unique_ptr<geos::geom::LineString> to_geos(
+
+ std::unique_ptr<geos::geom::LinearRing> to_geos(const ring_type_fp& ring) {
+ auto geom_factory = geos::geom::GeometryFactory::create();
+- auto coord_factory = geom_factory->getCoordinateSequenceFactory();
+- auto coords = coord_factory->create(ring.size(), 2 /* dimensions */);
++ auto coords =
geos::detail::make_unique<geos::geom::CoordinateArraySequence>(ring.size(), 2
/* dimensions */);
+ for (size_t i = 0; i < ring.size(); i++) {
+ // reverse rings for geos.
+ coords->setAt(geos::geom::Coordinate(ring[i].x(), ring[i].y()), i);