[39275] trunk/dports/science/gdal

landonf at macports.org landonf at macports.org
Fri Aug 15 00:50:10 PDT 2008


Revision: 39275
          http://trac.macosforge.org/projects/macports/changeset/39275
Author:   landonf at macports.org
Date:     2008-08-15 00:50:10 -0700 (Fri, 15 Aug 2008)
Log Message:
-----------
Add a variant for MrSID file format support.

Modified Paths:
--------------
    trunk/dports/science/gdal/Portfile

Added Paths:
-----------
    trunk/dports/science/gdal/files/patch-frmts_mrsid_mrsiddataset.cpp
    trunk/dports/science/gdal/files/patch-mrsid-configure

Modified: trunk/dports/science/gdal/Portfile
===================================================================
--- trunk/dports/science/gdal/Portfile	2008-08-15 06:43:45 UTC (rev 39274)
+++ trunk/dports/science/gdal/Portfile	2008-08-15 07:50:10 UTC (rev 39275)
@@ -3,6 +3,7 @@
 PortSystem 1.0
 name		gdal
 version		1.5.1
+revision	1
 maintainers	seanasy at gmail.com
 platforms	darwin
 description	GDAL - Geospatial Data Abstraction Library
@@ -32,6 +33,15 @@
 # Set target to none
 build.target
 
+variant mrsid {
+	depends_lib-append		port:geoexpress-sdk
+	configure.args-append		--with-mrsid=${prefix}/share/Geo_DSDK
+
+	# Fixes for Geo_DSDK 7.x - http://trac.osgeo.org/gdal/ticket/2410
+	patchfiles-append		patch-frmts_mrsid_mrsiddataset.cpp \
+					patch-mrsid-configure
+}
+
 variant python24 {
 	depends_lib-append		port:python24 \
 					port:py-numpy

Added: trunk/dports/science/gdal/files/patch-frmts_mrsid_mrsiddataset.cpp
===================================================================
--- trunk/dports/science/gdal/files/patch-frmts_mrsid_mrsiddataset.cpp	                        (rev 0)
+++ trunk/dports/science/gdal/files/patch-frmts_mrsid_mrsiddataset.cpp	2008-08-15 07:50:10 UTC (rev 39275)
@@ -0,0 +1,76 @@
+--- frmts/mrsid/mrsiddataset.cpp.orig	2008-08-14 23:59:18.000000000 -0700
++++ frmts/mrsid/mrsiddataset.cpp	2008-08-15 00:05:20.000000000 -0700
+@@ -1,5 +1,5 @@
+ /******************************************************************************
+- * $Id: mrsiddataset.cpp 12686 2007-11-09 19:31:29Z warmerdam $
++ * $Id$
+  *
+  * Project:  Multi-resolution Seamless Image Database (MrSID)
+  * Purpose:  Read/write LizardTech's MrSID file format - Version 4+ SDK.
+@@ -37,7 +37,7 @@
+ #include <geo_normalize.h>
+ #include <geovalues.h>
+ 
+-CPL_CVSID("$Id: mrsiddataset.cpp 12686 2007-11-09 19:31:29Z warmerdam $");
++CPL_CVSID("$Id$");
+ 
+ CPL_C_START
+ double GTIFAngleToDD( double dfAngle, int nUOMAngle );
+@@ -161,7 +161,11 @@
+ {
+     friend class MrSIDRasterBand;
+ 
++#if defined(LTI_SDK_MAJOR) && LTI_SDK_MAJOR >= 7
++    MrSIDImageReader    *poImageReader;
++#else
+     LTIImageReader      *poImageReader;
++#endif
+ 
+ #ifdef MRSID_ESDK
+     LTIGeoFileImageWriter *poImageWriter;
+@@ -690,7 +694,14 @@
+     if ( poLTINav )
+         delete poLTINav;
+     if ( poImageReader && !bIsOverview )
++#if defined(LTI_SDK_MAJOR) && LTI_SDK_MAJOR >= 7
++    {
++        poImageReader->release();
++        poImageReader = NULL;
++    }
++#else
+         delete poImageReader;
++#endif
+ 
+     if ( pszProjection )
+         CPLFree( pszProjection );
+@@ -1250,6 +1261,7 @@
+ /* -------------------------------------------------------------------- */
+     MrSIDDataset        *poDS;
+     const LTFileSpec    oFileSpec( poOpenInfo->pszFilename );
++    LT_STATUS           eStat;
+ 
+     poDS = new MrSIDDataset();
+ #ifdef MRSID_J2K
+@@ -1257,9 +1269,21 @@
+         poDS->poImageReader = new LTIDLLReader<J2KImageReader>( oFileSpec, true );
+     else
+ #endif
++#if defined(LTI_SDK_MAJOR) && LTI_SDK_MAJOR >= 7
++    {
++        poDS->poImageReader = MrSIDImageReader::create();
++    }
++
++    eStat = poDS->poImageReader->initialize( oFileSpec, true );
++#else
++    {
+         poDS->poImageReader = new LTIDLLReader<MrSIDImageReader>( oFileSpec, false );
++    }
++
++    eStat = poDS->poImageReader->initialize();
++#endif
+ 
+-    if ( !LT_SUCCESS( poDS->poImageReader->initialize() ) )
++    if ( !LT_SUCCESS(eStat) )
+     {
+         delete poDS;
+         CPLError( CE_Failure, CPLE_AppDefined,

Added: trunk/dports/science/gdal/files/patch-mrsid-configure
===================================================================
--- trunk/dports/science/gdal/files/patch-mrsid-configure	                        (rev 0)
+++ trunk/dports/science/gdal/files/patch-mrsid-configure	2008-08-15 07:50:10 UTC (rev 39275)
@@ -0,0 +1,17 @@
+--- configure.orig	2008-08-15 00:00:41.000000000 -0700
++++ configure	2008-08-15 00:01:24.000000000 -0700
+@@ -23184,12 +23184,12 @@
+ 
+   { echo "$as_me:$LINENO: checking for lt_base.h in $with_mrsid/include/support" >&5
+ echo $ECHO_N "checking for lt_base.h in $with_mrsid/include/support... $ECHO_C" >&6; }
+-  if test -r "$with_mrsid/include/support/lt_base.h" ; then
++  if test -r "$with_mrsid/include/lt_base.h" ; then
+     { echo "$as_me:$LINENO: result: found MrSID DSDK version 4.x or newer." >&5
+ echo "${ECHO_T}found MrSID DSDK version 4.x or newer." >&6; }
+ 
+     HAVE_MRSID=yes
+-    MRSID_INCLUDE="-I$with_mrsid/include/base -I$with_mrsid/include/metadata -I$with_mrsid/include/mrsid_readers -I$with_mrsid/include/j2k_readers -I$with_mrsid/include/support"
++    MRSID_INCLUDE="-I$with_mrsid/include"
+     MRSID_LIBS="-lltidsdk -lpthread"
+ 
+     { echo "$as_me:$LINENO: checking for MG3ImageWriter.h in $with_mrsid/include/mrsid_writers" >&5
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-changes/attachments/20080815/bd7deb88/attachment.html 


More information about the macports-changes mailing list