From dfd4c1736fa32cd035237f19bfb0a57288edb4a5 Mon Sep 17 00:00:00 2001 From: Benjamin Trigona-Harany Date: Sat, 16 Nov 2019 10:36:44 -0800 Subject: gis/osgEarth: Add geos 3.8 patch, remove Qt support. --- gis/osgEarth/README | 15 +------- gis/osgEarth/geos-3_6_1-support.patch | 60 ------------------------------ gis/osgEarth/geos-3_8-support.patch | 70 +++++++++++++++++++++++++++++++++++ gis/osgEarth/osgEarth.SlackBuild | 17 ++------- 4 files changed, 75 insertions(+), 87 deletions(-) delete mode 100644 gis/osgEarth/geos-3_6_1-support.patch create mode 100644 gis/osgEarth/geos-3_8-support.patch (limited to 'gis') diff --git a/gis/osgEarth/README b/gis/osgEarth/README index 8026af489f..eb37a51796 100644 --- a/gis/osgEarth/README +++ b/gis/osgEarth/README @@ -7,17 +7,4 @@ get up and running quickly and easily. Some optional requirements are recommended for enhanced functionality and/or performance. They include: - osgQt, poco, protobuf, rocksdb - -For all but osgQt, they will be used if detected when osgEarth is built. - -In the case of osgQt, the version of Qt that it was built with is relevant. -If osgQt was built with Qt5, the environment variable OSGQT=5 must be set when -running the osgEarth SlackBuild i.e. - OSGQT=5 sh osgEarth.SlackBuild -In this case, the qt5 package is also an additional build requirement. - -If osgQt was built with Qt4 (the standard for Slackware 14.2), set OSGQT=4 i.e. - OSGQT=4 sh osgEarth.SlackBuild - -If OSGQT is not set, osgQt support will not be included. + poco, protobuf, rocksdb diff --git a/gis/osgEarth/geos-3_6_1-support.patch b/gis/osgEarth/geos-3_6_1-support.patch deleted file mode 100644 index fc6a6beefb..0000000000 --- a/gis/osgEarth/geos-3_6_1-support.patch +++ /dev/null @@ -1,60 +0,0 @@ -diff -Naur osgearth-osgearth-2.8-orig/src/osgEarthSymbology/GEOS osgearth-osgearth-2.8/src/osgEarthSymbology/GEOS ---- osgearth-osgearth-2.8-orig/src/osgEarthSymbology/GEOS 2016-09-15 17:19:21.000000000 +0300 -+++ osgearth-osgearth-2.8/src/osgEarthSymbology/GEOS 2017-02-02 19:43:19.103864300 +0300 -@@ -26,6 +26,7 @@ - #include - #include - #include -+#include - - namespace osgEarth { namespace Symbology - { -@@ -45,7 +46,7 @@ - void disposeGeometry(geos::geom::Geometry* input); - - protected: -- geos::geom::GeometryFactory* _factory; -+ geos::geom::GeometryFactory::unique_ptr _factory; - }; - - } } // namespace osgEarth::Features -diff -Naur osgearth-osgearth-2.8-orig/src/osgEarthSymbology/GEOS.cpp osgearth-osgearth-2.8/src/osgEarthSymbology/GEOS.cpp ---- osgearth-osgearth-2.8-orig/src/osgEarthSymbology/GEOS.cpp 2016-09-15 17:19:21.000000000 +0300 -+++ osgearth-osgearth-2.8/src/osgEarthSymbology/GEOS.cpp 2017-02-02 19:44:46.772878700 +0300 -@@ -67,7 +67,7 @@ - } - - geom::Geometry* -- import( const Symbology::Geometry* input, const geom::GeometryFactory* f ) -+ import( const Symbology::Geometry* input, const geom::GeometryFactory::unique_ptr f ) - { - geom::Geometry* output = 0L; - -@@ -216,7 +216,7 @@ - geos::geom::PrecisionModel* pm = new geos::geom::PrecisionModel(geom::PrecisionModel::FLOATING); - - // Factory will clone the PM -- _factory = new geos::geom::GeometryFactory( pm ); -+ _factory = geos::geom::GeometryFactory::create( pm ); - - // Delete the template. - delete pm; -@@ -224,7 +224,6 @@ - - GEOSContext::~GEOSContext() - { -- delete _factory; - } - - geom::Geometry* -@@ -331,10 +330,7 @@ - { - if (input) - { -- geom::GeometryFactory* f = const_cast(input->getFactory()); - _factory->destroyGeometry(input); -- if ( f != _factory ) -- delete f; - } - } - diff --git a/gis/osgEarth/geos-3_8-support.patch b/gis/osgEarth/geos-3_8-support.patch new file mode 100644 index 0000000000..e5375e205c --- /dev/null +++ b/gis/osgEarth/geos-3_8-support.patch @@ -0,0 +1,70 @@ +Binary files osgearth-osgearth-2.10.2.a/src/osgEarthSymbology/.GEOS.cpp.un~ and osgearth-osgearth-2.10.2.b/src/osgEarthSymbology/.GEOS.cpp.un~ differ +diff -Nur osgearth-osgearth-2.10.2.a/src/osgEarthSymbology/GEOS.cpp osgearth-osgearth-2.10.2.b/src/osgEarthSymbology/GEOS.cpp +--- osgearth-osgearth-2.10.2.a/src/osgEarthSymbology/GEOS.cpp 2019-07-12 08:49:14.000000000 -0700 ++++ osgearth-osgearth-2.10.2.b/src/osgEarthSymbology/GEOS.cpp 2019-11-16 10:00:08.966241888 -0800 +@@ -49,7 +49,7 @@ + + namespace + { +- geom::CoordinateSequence* ++ std::unique_ptr + vec3dArray2CoordSeq( const Symbology::Geometry* input, bool close, const geom::CoordinateSequenceFactory* factory ) + { + bool needToClose = close && input->size() > 2 && input->front() != input->back(); +@@ -64,7 +64,7 @@ + { + coords->push_back( coords->front() ); + } +- geom::CoordinateSequence* seq = factory->create( coords ); ++ std::unique_ptr seq = factory->create( coords ); + + return seq; + } +@@ -108,7 +108,8 @@ + else + { + // any other type will at least contain points: +- geom::CoordinateSequence* seq = 0L; ++ std::unique_ptr seq = 0L; ++ + try + { + switch( input->getType() ) +@@ -119,24 +120,24 @@ + + case Symbology::Geometry::TYPE_POINTSET: + seq = vec3dArray2CoordSeq( input, false, f->getCoordinateSequenceFactory() ); +- if ( seq ) output = f->createPoint( seq ); ++ if ( seq ) output = f->createPoint( *seq ); + break; + + case Symbology::Geometry::TYPE_LINESTRING: + seq = vec3dArray2CoordSeq( input, false, f->getCoordinateSequenceFactory() ); +- if ( seq ) output = f->createLineString( seq ); ++ if ( seq ) output = f->createLineString( *seq ); + break; + + case Symbology::Geometry::TYPE_RING: + seq = vec3dArray2CoordSeq( input, true, f->getCoordinateSequenceFactory() ); +- if ( seq ) output = f->createLinearRing( seq ); ++ if ( seq ) output = f->createLinearRing( *seq ); + break; + + case Symbology::Geometry::TYPE_POLYGON: + seq = vec3dArray2CoordSeq( input, true, f->getCoordinateSequenceFactory() ); + geom::LinearRing* shell = 0L; + if ( seq ) +- shell = f->createLinearRing( seq ); ++ shell = f->createLinearRing( *seq ); + + if ( shell ) + { +@@ -155,7 +156,7 @@ + holes = 0L; + } + } +- output = f->createPolygon( shell, holes ); ++ output = f->createPolygon( shell, (std::vector*)holes ); + } + + break; diff --git a/gis/osgEarth/osgEarth.SlackBuild b/gis/osgEarth/osgEarth.SlackBuild index ff83e100c5..cf201daf4e 100644 --- a/gis/osgEarth/osgEarth.SlackBuild +++ b/gis/osgEarth/osgEarth.SlackBuild @@ -26,7 +26,7 @@ PRGNAM=osgEarth SRCNAM=osgearth VERSION=${VERSION:-2.10.2} -BUILD=${BUILD:-1} +BUILD=${BUILD:-2} TAG=${TAG:-_SBo} if [ -z "$ARCH" ]; then @@ -56,16 +56,6 @@ else LIBDIRSUFFIX="" fi -osgqt=""; -echo "OSGQT = $OSGQT" -if [ "$OSGQT" = "4" ]; then - osgqt="-DOSGEARTH_QT_BUILD=ON -DOSGEARTH_QT_VERSION=4" -elif [ "$OSGQT" = "5" ]; then - osgqt="-DOSGEARTH_QT_BUILD=ON -DOSGEARTH_QT_VERSION=5" -else - osgqt="" -fi - set -e rm -rf $PKG @@ -81,6 +71,8 @@ find -L . \ \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; +patch -p1 < $CWD/geos-3_8-support.patch + mkdir -p build cd build cmake .. \ @@ -88,8 +80,7 @@ cd build -DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS -lX11" \ -DCMAKE_INSTALL_PREFIX=/usr \ -DCMAKE_BUILD_TYPE=Release \ - -DDYNAMIC_OSGEARTH=ON \ - $osgqt + -DDYNAMIC_OSGEARTH=ON make make install DESTDIR=$PKG -- cgit v1.2.3