diff --git a/ports/osgearth/CONTROL b/ports/osgearth/CONTROL index 3585c467e3f041..781ae1bd45c0ef 100644 --- a/ports/osgearth/CONTROL +++ b/ports/osgearth/CONTROL @@ -1,5 +1,6 @@ Source: osgearth Version: 3.0 +Port-Version: 1 Homepage: https://github.com/gwaldron/osgearth Description: osgEarth - Dynamic map generation toolkit for OpenSceneGraph Copyright 2015 Pelican Mapping. Build-Depends: osg[plugins] diff --git a/ports/osgearth/fix-build-with-geos-3-8.patch b/ports/osgearth/fix-build-with-geos-3-8.patch new file mode 100644 index 00000000000000..ea52a4b8a34c5f --- /dev/null +++ b/ports/osgearth/fix-build-with-geos-3-8.patch @@ -0,0 +1,41 @@ +diff --git a/src/osgEarth/GEOS.cpp b/src/osgEarth/GEOS.cpp +index 07da3fd..31f97ab 100644 +--- a/src/osgEarth/GEOS.cpp ++++ b/src/osgEarth/GEOS.cpp +@@ -63,9 +63,13 @@ namespace + { + coords->push_back( coords->front() ); + } ++#if GEOS_VERSION_AT_LEAST(3,8) ++ geom::CoordinateSequence::Ptr seq = factory->create(coords); ++ return seq.get(); ++#else + geom::CoordinateSequence* seq = factory->create( coords ); +- + return seq; ++#endif + } + + geom::Geometry* +@@ -141,12 +145,20 @@ namespace + if ( shell ) + { + const Polygon* poly = static_cast(input); ++#if GEOS_VERSION_AT_LEAST(3,8) ++ std::vector* holes = poly->getHoles().size() > 0 ? new std::vector() : 0L; ++#else + std::vector* holes = poly->getHoles().size() > 0 ? new std::vector() : 0L; ++#endif + if (holes) + { + for( RingCollection::const_iterator r = poly->getHoles().begin(); r != poly->getHoles().end(); ++r ) + { +- geom::Geometry* hole = import( r->get(), f ); ++#if GEOS_VERSION_AT_LEAST(3,8) ++ geom::LinearRing* hole = dynamic_cast(import( r->get(), f )); ++#else ++ geom::Geometry* hole = import(r->get(), f); ++#endif + if (hole) + { + if (hole->getGeometryTypeId() == geos::geom::GEOS_LINEARRING) diff --git a/ports/osgearth/portfile.cmake b/ports/osgearth/portfile.cmake index 3be639cb46b314..119ae6f66ad66f 100644 --- a/ports/osgearth/portfile.cmake +++ b/ports/osgearth/portfile.cmake @@ -15,6 +15,7 @@ vcpkg_from_github( HEAD_REF master PATCHES RocksDB.patch + fix-build-with-geos-3-8.patch # Remove this patch after https://github.com/gwaldron/osgearth/pull/1497 merge ) vcpkg_configure_cmake(