[vtk6] 01/03: Add patch for GDAL 2.0 support. (Closes: #802624)

Anton Gladky gladk at moszumanska.debian.org
Sun Dec 20 17:47:30 UTC 2015


This is an automated email from the git hooks/post-receive script.

gladk pushed a commit to branch master
in repository vtk6.

commit 429f9025bc8d24ac9795d02648783e27c4881e6f
Author: Bas Couwenberg <sebastic at xs4all.nl>
Date:   Sun Dec 20 17:50:28 2015 +0100

    Add patch for GDAL 2.0 support. (Closes: #802624)
---
 debian/patches/90_gdal-2.0.patch | 43 ++++++++++++++++++++++++++++++++++++++++
 debian/patches/series            |  1 +
 2 files changed, 44 insertions(+)

diff --git a/debian/patches/90_gdal-2.0.patch b/debian/patches/90_gdal-2.0.patch
new file mode 100644
index 0000000..15d3c58
--- /dev/null
+++ b/debian/patches/90_gdal-2.0.patch
@@ -0,0 +1,43 @@
+Description: Fix GDAL 2.0 compatibility.
+ Based on gdal2.patch from ArchLinux, improved to support both GDAL 1.x & 2.x.
+Origin: https://projects.archlinux.org/svntogit/community.git/tree/trunk/gdal2.patch?h=packages/vtk
+Bug: http://www.vtk.org/Bug/view.php?id=15692
+
+--- a/IO/GDAL/vtkGDALVectorReader.cxx
++++ b/IO/GDAL/vtkGDALVectorReader.cxx
+@@ -44,7 +44,11 @@ class vtkGDALVectorReader::Internal
+ public:
+   Internal( const char* srcName, int srcMode, int appendFeatures, int addFeatIds )
+     {
++#if GDAL_VERSION_MAJOR < 2
+     this->Source = OGRSFDriverRegistrar::Open( srcName, srcMode, &this->Driver );
++#else
++    this->Source = (GDALDataset*) OGROpen( srcName, srcMode, NULL );
++#endif
+     if ( ! this->Source )
+       {
+       this->LastError = CPLGetLastErrorMsg();
+@@ -61,7 +65,11 @@ public:
+     {
+     if ( this->Source )
+       {
++#if GDAL_VERSION_MAJOR < 2
+       OGRDataSource::DestroyDataSource( this->Source );
++#else
++      GDALClose( (GDALDatasetH) this->Source );
++#endif
+       }
+     }
+ 
+@@ -307,7 +315,11 @@ public:
+     return nCells;
+     }
+ 
++#if GDAL_VERSION_MAJOR < 2
+   OGRDataSource* Source;
++#else
++  GDALDataset* Source;
++#endif
+   OGRSFDriver* Driver;
+   const char* LastError;
+   int LayerIdx;
diff --git a/debian/patches/series b/debian/patches/series
index 0428c1d..b9f2a86 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -6,3 +6,4 @@
 60_use_system_mpi4py.patch
 70_fix_ftbfs_gcc49.patch
 80_fix_arm_compilation.patch
+90_gdal-2.0.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/vtk6.git



More information about the debian-science-commits mailing list