aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Spencer <idlemoor@slackbuilds.org>2016-03-20 21:30:02 +0000
committerRobby Workman <rworkman@slackbuilds.org>2016-03-20 23:34:43 -0500
commitf4669e2ff8e69c1585abdb63fe2c7bc1e2813cdf (patch)
tree48a78b709404a81c331bfb456b2f992707645f40
parente57ae6d945622ef1bf2ade493ea5e6b217fc50af (diff)
ham/qradiopredict: Patched to build with gdal-2.0.2.
Signed-off-by: David Spencer <idlemoor@slackbuilds.org>
-rw-r--r--ham/qradiopredict/qradiopredict-gdal2.patch80
-rw-r--r--ham/qradiopredict/qradiopredict.SlackBuild2
2 files changed, 82 insertions, 0 deletions
diff --git a/ham/qradiopredict/qradiopredict-gdal2.patch b/ham/qradiopredict/qradiopredict-gdal2.patch
new file mode 100644
index 0000000000000..f6b55a9391096
--- /dev/null
+++ b/ham/qradiopredict/qradiopredict-gdal2.patch
@@ -0,0 +1,80 @@
+diff -u -r qradiopredict-0.8.8/QRadioPredict/shpreader.cpp qradiopredict-0.8.8-patched/QRadioPredict/shpreader.cpp
+--- qradiopredict-0.8.8/QRadioPredict/shpreader.cpp 2014-02-24 07:56:11.000000000 +0000
++++ qradiopredict-0.8.8-patched/QRadioPredict/shpreader.cpp 2016-03-20 21:04:43.097658012 +0000
+@@ -104,9 +104,15 @@
+ OGRRegisterAll();
+ QString file = name;
+ file.append(".shp");
+- OGRDataSource *poDS;
+
++#if GDAL_VERSION_MAJOR < 2
++ OGRDataSource *poDS;
+ poDS = OGRSFDriverRegistrar::Open( file.toStdString().c_str(), FALSE );
++#else
++ GDALDataset *poDS;
++ poDS = (GDALDataset*) OGROpen( file.toStdString().c_str(), FALSE, NULL );
++#endif
++
+ if( poDS == NULL )
+ {
+ qDebug() << "Shapefile opening failed: " << name;
+@@ -119,7 +125,11 @@
+ if(poLayer == NULL)
+ {
+ qDebug() << "Shapefile layer is fubar: " << poLayer->GetName();
++#if GDAL_VERSION_MAJOR < 2
+ OGRDataSource::DestroyDataSource( poDS );
++#else
++ GDALClose( (GDALDatasetH) poDS );
++#endif
+ return QString("None");
+ }
+
+@@ -171,7 +181,11 @@
+ qDebug() << "Using GEOS for: " << terrain_type;
+ delete [] buffer;
+ OGRFeature::DestroyFeature( poFeature );
++#if GDAL_VERSION_MAJOR < 2
+ OGRDataSource::DestroyDataSource( poDS );
++#else
++ GDALClose( (GDALDatasetH) poDS );
++#endif
+ return terrain_type;
+ }
+ delete[] buffer;
+@@ -233,7 +247,11 @@
+ if(poly)
+ delete poly;
+ OGRFeature::DestroyFeature( poFeature );
++#if GDAL_VERSION_MAJOR < 2
+ OGRDataSource::DestroyDataSource( poDS );
++#else
++ GDALClose( (GDALDatasetH) poDS );
++#endif
+ return terrain_type;
+ }
+
+@@ -255,7 +273,11 @@
+ {
+ //qDebug() << terrain_type;
+ OGRFeature::DestroyFeature( poFeature );
++#if GDAL_VERSION_MAJOR < 2
+ OGRDataSource::DestroyDataSource( poDS );
++#else
++ GDALClose( (GDALDatasetH) poDS );
++#endif
+ return terrain_type;
+ }
+ */
+@@ -267,7 +289,11 @@
+ OGRFeature::DestroyFeature( poFeature );
+ }
+
++#if GDAL_VERSION_MAJOR < 2
+ OGRDataSource::DestroyDataSource( poDS );
++#else
++ GDALClose( (GDALDatasetH) poDS );
++#endif
+
+ return QString("None");
+ }
diff --git a/ham/qradiopredict/qradiopredict.SlackBuild b/ham/qradiopredict/qradiopredict.SlackBuild
index 713a0dcc10fb9..f95520777cb17 100644
--- a/ham/qradiopredict/qradiopredict.SlackBuild
+++ b/ham/qradiopredict/qradiopredict.SlackBuild
@@ -66,6 +66,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/qradiopredict-gdal2.patch
+
mkdir -p build
cd build
CFLAGS="$SLKCFLAGS" \