diff options
author | Amy Winston <amynka@gentoo.org> | 2016-01-18 19:28:31 +0100 |
---|---|---|
committer | Amy Winston <amynka@gentoo.org> | 2016-01-18 19:28:31 +0100 |
commit | 469204d2eb46c95572471d9fea1b2339b334c314 (patch) | |
tree | 3617267a7bd6635fd0c29a3c1fde65c7f6c91315 /sci-geosciences | |
parent | dev-python/pygments: version bump to 2.1 (diff) | |
download | gentoo-469204d2eb46c95572471d9fea1b2339b334c314.tar.gz gentoo-469204d2eb46c95572471d9fea1b2339b334c314.tar.bz2 gentoo-469204d2eb46c95572471d9fea1b2339b334c314.zip |
sci-geosciences/merkaartor: compatibility with gdal bug #554304. By wraeth
Package-Manager: portage-2.2.24
Diffstat (limited to 'sci-geosciences')
-rw-r--r-- | sci-geosciences/merkaartor/Manifest | 1 | ||||
-rw-r--r-- | sci-geosciences/merkaartor/files/merkaartor-gdal-2-fix.patch | 212 | ||||
-rw-r--r-- | sci-geosciences/merkaartor/merkaartor-0.18.1-r2.ebuild (renamed from sci-geosciences/merkaartor/merkaartor-0.18.1-r1.ebuild) | 6 | ||||
-rw-r--r-- | sci-geosciences/merkaartor/merkaartor-0.18.1.ebuild | 69 |
4 files changed, 217 insertions, 71 deletions
diff --git a/sci-geosciences/merkaartor/Manifest b/sci-geosciences/merkaartor/Manifest index 9950ede2b132..1b431ef42fad 100644 --- a/sci-geosciences/merkaartor/Manifest +++ b/sci-geosciences/merkaartor/Manifest @@ -1,3 +1,2 @@ DIST merkaartor-0.17.2.tar.bz2 7138991 SHA256 425f4facefbf20a3dd1a09ee61ff8a8912482d1a30c957c50869d8ff59ba702a SHA512 3718131d855ad6ea17537c7879a3249f25f6f5aaaf00e2e59df10c5497a628f0877f85129a209d11dc969b5771598f9989cc6ca3a972dab4c3eaef507784d4ed WHIRLPOOL 22a07736e7da44d3799831352d0e9d323143f228dcf7693b6f90fe101a8a04c74c2c5186db15723902b7dd8aadd93a78547e4622b5238ceb7074027e987b8487 -DIST merkaartor-0.18.1.tar.bz2 5579080 SHA256 3d6a96599815d5f1c8558acd255a413ea47b93ddad8414147d11775a6f21139f SHA512 d45b25ad5a7f19b32ca3e91ad514ef1a8450024bdab9e8c215f60a5ec3fc6332a5cadfcec586a32805c7727d224588b504b01d3023120d55476660a8a394cd45 WHIRLPOOL 23327a7eaa91531a95665fe9ff647712606babf96e3843ef33b94a37f6f7ca6d1cb09576b0b31197badc32e87cfc7ca275a9e3792e57f57dd58fe0509ec1b46d DIST merkaartor-0.18.1.tar.gz 6459640 SHA256 e9fa5e30e6392c9224f73e9bb7d17b66c4eb6c023633eb2af0cf58ba8acf684f SHA512 5ccb2aca7463cd3b31790b0f231cd18f4499b38ec3eb14c3600bdaae880194a71aaf63a2c2f814af6277b1b07fd618b4393309aa5ded375940bd464d1e77d71d WHIRLPOOL fde10a93510c123f2e1065ad745c3abc7860892c55ed615e75214dd172bfbec1da6f254377cc2d6e0f1df6f9d0680d0f7878ba3224651f5b09c590c335211d9c diff --git a/sci-geosciences/merkaartor/files/merkaartor-gdal-2-fix.patch b/sci-geosciences/merkaartor/files/merkaartor-gdal-2-fix.patch new file mode 100644 index 000000000000..4197610c17f0 --- /dev/null +++ b/sci-geosciences/merkaartor/files/merkaartor-gdal-2-fix.patch @@ -0,0 +1,212 @@ +--- a/src/ImportExport/ImportExportGdal.cpp 2015-06-15 18:48:39.604575423 +0200 ++++ b/src/ImportExport/ImportExportGdal.cpp 2015-06-15 18:48:39.604575423 +0200 +@@ -21,10 +21,13 @@ + #include "ProjectionChooser.h" + #include "Global.h" + +-#include "cpl_vsi.h" ++#include <cpl_vsi.h> ++#include <gdal.h> ++#include <gdal_priv.h> + + #include <QDir> + ++ + bool parseContainer(QDomElement& e, Layer* aLayer); + + ImportExportGdal::ImportExportGdal(Document* doc) +@@ -55,6 +58,55 @@ bool ImportExportGdal::saveFile(QString) + bool ImportExportGdal::export_(const QList<Feature *>& featList) + { + const char *pszDriverName = "SQLite"; ++ QString fileName(HOMEDIR + "/test.sqlite"); ++#ifdef GDAL2 ++ GDALDriver *poDriver; ++ GDALDriverManager *driverManager = GetGDALDriverManager(); ++ GDALAllRegister(); ++ driverManager->AutoLoadDrivers(); ++ ++ poDriver = driverManager->GetDriverByName(pszDriverName); ++ if( poDriver == NULL ) ++ { ++ qDebug( "%s driver not available.", pszDriverName ); ++ return false; ++ } ++ ++ /* Create create options */ ++ char **createOptions = NULL; ++ createOptions = CSLSetNameValue( createOptions, "SPATIALITE", "YES" ); ++ ++ /* Open new dataset */ ++ GDALDataset *poDS; ++ ++ QFile::remove(fileName); ++ poDS = poDriver->Create( fileName.toUtf8().constData(), 0, 0, 0, GDT_Unknown, createOptions ); ++ if( poDS == NULL ) ++ { ++ qDebug( "Creation of output file failed." ); ++ return false; ++ } ++ poDS->ExecuteSQL("PRAGMA synchronous = OFF", NULL, NULL); ++ ++ /* Create Spatial reference object */ ++ OGRSpatialReference *poSRS; ++ poSRS = new OGRSpatialReference(); ++ poSRS->importFromEPSG(4326); ++ ++ /* Create layer options */ ++ char **layerOptions = NULL; ++ layerOptions = CSLSetNameValue( layerOptions, "FORMAT", "SPATIALITE" ); ++ layerOptions = CSLSetNameValue( layerOptions, "SPATIAL_INDEX", "YES" ); ++ ++ /* Create layer */ ++ OGRLayer *poLayer; ++ poLayer = poDS->CreateLayer( "osm", poSRS, wkbUnknown, layerOptions); ++ ++ /* Free the options */ ++ CSLDestroy( createOptions ); ++ CSLDestroy( layerOptions ); ++#else ++ /* This is legacy code, and is not tested at all */ + OGRSFDriver *poDriver; + + OGRRegisterAll(); +@@ -68,8 +120,8 @@ bool ImportExportGdal::export_(const QList<Feature *>& featList) + + OGRDataSource *poDS; + +- QFile::remove(QString(HOMEDIR + "/test.sqlite")); +- poDS = poDriver->CreateDataSource( QString(HOMEDIR + "/test.sqlite").toUtf8().constData(), NULL ); ++ QFile::remove(fileName); ++ poDS = poDriver->CreateDataSource( fileName.toUtf8().constData(), NULL ); + if( poDS == NULL ) + { + qDebug( "Creation of output file failed." ); +@@ -89,6 +141,8 @@ bool ImportExportGdal::export_(const QList<Feature *>& featList) + OGRLayer *poLayer; + poLayer = poDS->CreateLayer( "osm", poSRS, wkbUnknown, papszOptions); + CSLDestroy( papszOptions ); ++#endif ++ + + if( poLayer == NULL ) + { +@@ -142,7 +196,11 @@ bool ImportExportGdal::export_(const QList<Feature *>& featList) + } + OGRFeature::DestroyFeature( poFeature ); + } ++#ifdef GDAL2 ++ GDALClose( (GDALDatasetH) poDS ); ++#else + OGRDataSource::DestroyDataSource( poDS ); ++#endif + return true; + } + +@@ -264,7 +322,11 @@ Feature* ImportExportGdal::parseGeometry(Layer* aLayer, OGRGeometry *poGeometry) + + // import the input + +-bool ImportExportGdal::importGDALDataset(OGRDataSource* poDS, Layer* aLayer, bool confirmProjection) ++#ifndef GDAL2 ++#define GDALDataset OGRDataSource ++#endif ++bool ImportExportGdal::importGDALDataset(GDALDataset* poDS, Layer* aLayer, bool confirmProjection) ++#undef GDALDataset + { + int ogrError; + +@@ -422,11 +484,16 @@ bool ImportExportGdal::importGDALDataset(OGRDataSource* poDS, Layer* aLayer, boo + + bool ImportExportGdal::import(Layer* aLayer) + { ++#ifdef GDAL2 ++ GDALAllRegister(); ++ GDALDataset *poDS; ++ poDS = (GDALDataset *) GDALOpen( FileName.toUtf8().constData(), GA_ReadOnly ); ++#else + OGRRegisterAll(); +- +- OGRDataSource *poDS; +- ++ OGRDataSource *poDS; + poDS = OGRSFDriverRegistrar::Open( FileName.toUtf8().constData(), FALSE ); ++#endif ++ + if( poDS == NULL ) + { + qDebug( "GDAL Open failed.\n" ); +@@ -435,22 +502,26 @@ bool ImportExportGdal::import(Layer* aLayer) + + importGDALDataset(poDS, aLayer, M_PREFS->getGdalConfirmProjection()); + +- OGRDataSource::DestroyDataSource( poDS ); ++ GDALClose( (GDALDatasetH) poDS ); + + return true; + } + + bool ImportExportGdal::import(Layer* aLayer, const QByteArray& ba, bool confirmProjection) + { +- OGRRegisterAll(); +- +- OGRDataSource *poDS; +-// int ogrError; +- + GByte* content = (GByte*)(ba.constData()); + /*FILE* f = */VSIFileFromMemBuffer("/vsimem/temp", content, ba.size(), FALSE); + ++#ifdef GDAL2 ++ GDALAllRegister(); ++ GDALDataset *poDS; ++ poDS = (GDALDataset *) GDALOpen( "/vsimem/temp", GA_ReadOnly ); ++#else ++ OGRRegisterAll(); ++ OGRDataSource *poDS; + poDS = OGRSFDriverRegistrar::Open( "/vsimem/temp", FALSE ); ++#endif ++ + if( poDS == NULL ) + { + qDebug( "GDAL Open failed.\n" ); +@@ -458,7 +529,7 @@ bool ImportExportGdal::import(Layer* aLayer, const QByteArray& ba, bool confirmP + } + importGDALDataset(poDS, aLayer, confirmProjection); + +- OGRDataSource::DestroyDataSource( poDS ); ++ GDALClose( (GDALDatasetH) poDS ); + + return true; + } +--- a/src/ImportExport/ImportExportGdal.h 2015-06-15 18:50:42.884995287 +0200 ++++ b/src/ImportExport/ImportExportGdal.h 2015-06-15 18:50:42.884995287 +0200 +@@ -13,7 +13,15 @@ + #define ImportExportGDAL_H + + #include "IImportExport.h" +-#include "ogrsf_frmts.h" ++ ++#include <ogrsf_frmts.h> ++#include <gdal.h> ++#include <gdal_priv.h> ++#include <gdal_version.h> ++ ++#if GDAL_VERSION_MAJOR == 2 ++#define GDAL2 ++#endif + + class Projection; + class Layer; +@@ -52,7 +60,11 @@ class ImportExportGdal : public IImportExport + Node *nodeFor(Layer* aLayer, OGRPoint point); + Way *readWay(Layer* aLayer, OGRLineString *poRing); + +- bool importGDALDataset(OGRDataSource *poDs, Layer *aLayer, bool confirmProjection); ++#ifndef GDAL2 ++#define GDALDataset OGRDataSource ++#endif ++ bool importGDALDataset(GDALDataset *poDs, Layer *aLayer, bool confirmProjection); ++#undef GDALDataset + + private: + QHash<OGRPoint, Node*> pointHash; diff --git a/sci-geosciences/merkaartor/merkaartor-0.18.1-r1.ebuild b/sci-geosciences/merkaartor/merkaartor-0.18.1-r2.ebuild index 33f4f5458c96..211238ae8a62 100644 --- a/sci-geosciences/merkaartor/merkaartor-0.18.1-r1.ebuild +++ b/sci-geosciences/merkaartor/merkaartor-0.18.1-r2.ebuild @@ -1,4 +1,4 @@ -# Copyright 1999-2015 Gentoo Foundation +# Copyright 1999-2016 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Id$ @@ -52,6 +52,10 @@ src_prepare() { fi epatch "${FILESDIR}"/${P}-system-libs.patch + + # bug 554304 - build against gdal 2 + epatch "${FILESDIR}"/${PN}-gdal-2-fix.patch + epatch_user } diff --git a/sci-geosciences/merkaartor/merkaartor-0.18.1.ebuild b/sci-geosciences/merkaartor/merkaartor-0.18.1.ebuild deleted file mode 100644 index 97f71518ee19..000000000000 --- a/sci-geosciences/merkaartor/merkaartor-0.18.1.ebuild +++ /dev/null @@ -1,69 +0,0 @@ -# Copyright 1999-2015 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Id$ - -EAPI=4 - -REDMINE_HASH="301" - -inherit multilib qt4-r2 ${SCM_ECLASS} - -DESCRIPTION="A Qt4 based map editor for the openstreetmap.org project" -HOMEPAGE="http://www.merkaartor.be" -SRC_URI="http://merkaartor.be/attachments/download/${REDMINE_HASH}/merkaartor-${PV}.tar.bz2" - -LICENSE="GPL-2" -SLOT="0" - -# Don't move KEYWORDS on the previous line or ekeyword won't work # 399061 -KEYWORDS="~amd64 ~x86" - -IUSE="debug exif gps nls libproxy" - -QT_MINIMAL="4.7.2" -DEPEND=" - >=dev-libs/boost-1.46 - >=sci-libs/gdal-1.6.0 - >=sci-libs/proj-4.6 - >=dev-qt/qtgui-${QT_MINIMAL}:4 - >=dev-qt/qtsvg-${QT_MINIMAL}:4 - >=dev-qt/qtwebkit-${QT_MINIMAL}:4 - exif? ( media-gfx/exiv2 ) - gps? ( >=sci-geosciences/gpsd-2.92[cxx] ) - libproxy? ( net-libs/libproxy ) -" -RDEPEND="${DEPEND}" - -DOCS="AUTHORS CHANGELOG HACKING" - -PATCHES=( -# "${FILESDIR}"/0.17.2-includes.patch -# "${FILESDIR}"/0.17.2-libproxy.patch -) - -merkaartor_use() { - local useflag=${1} - [[ -z ${useflag} ]] && die "No useflag specified" - if use ${useflag}; then - echo "1" - else - echo "0" - fi -} - -src_configure() { - local myconf - myconf+=" RELEASE=1 ZBAR=0" # deps not in main tree so hard-disable - myconf+=" GEOIMAGE=$(${PN}_use exif)" - myconf+=" GPSDLIB=$(${PN}_use gps)" - myconf+=" LIBPROXY=$(${PN}_use libproxy)" - myconf+=" NODEBUG=$(use debug && echo "0" || echo "1")" # inverse logic - myconf+=" NOUSEWEBKIT=0" # fails to link if disabled, upstream needs to fix - myconf+=" TRANSDIR_MERKAARTOR=/usr/share/${PN}/translations TRANSDIR_SYSTEM=/usr/share/qt4/translations" #385671 - - if use nls; then - lrelease src/src.pro || die "lrelease failed" - fi - - eqmake4 Merkaartor.pro LIBDIR=/usr/$(get_libdir) PREFIX=/usr/ ${myconf} -} |