[SCM] osgearth branch, jessie, updated. debian/2.4-5-8-gc9136c4

Bas Couwenberg sebastic at xs4all.nl
Wed Oct 9 03:52:25 UTC 2013


The following commit has been merged in the jessie branch:
commit c9136c449cb627cfebfb46dadd538da5eac1700c
Author: Bas Couwenberg <sebastic at xs4all.nl>
Date:   Wed Oct 9 03:11:06 2013 +0200

    Add patch to support libminizip as installed by the libkml package.

diff --git a/debian/changelog b/debian/changelog
index bfe70a8..0536781 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -7,6 +7,8 @@ osgearth (2.4.0+dfsg-6) unstable; urgency=low
     (closes: #725383)
   * Add patch to use thr_self syscall on kFreeBSD.
     Thanks Petr Salinger, Robert Millan and Ed Maste for the advice.
+  * Add patch to support libminizip as installed by the libkml package, but
+    don't include KMZ support yet. 
 
  -- Bas Couwenberg <sebastic at xs4all.nl>  Tue, 24 Sep 2013 16:59:37 +0200
 
diff --git a/debian/control b/debian/control
index 933e037..31c8314 100644
--- a/debian/control
+++ b/debian/control
@@ -13,7 +13,8 @@ Build-Depends: debhelper (>= 9),
                libgeos-dev,
                libexpat1-dev,
                libcurl4-gnutls-dev,
-               libzip-dev,
+               zlib1g-dev,
+               libkml-dev (>= 1.3.0~r864-1),
                libsqlite3-dev,
                libqt4-dev,
                libqt4-opengl-dev,
diff --git a/debian/patches/cmake-FindMiniZip.patch b/debian/patches/cmake-FindMiniZip.patch
new file mode 100644
index 0000000..a195fc2
--- /dev/null
+++ b/debian/patches/cmake-FindMiniZip.patch
@@ -0,0 +1,146 @@
+Description: Support libminizip path as used by the libkml-dev package.
+Author: Bas Couwenberg <sebastic at xs4all.nl>
+Last-Update: 2013-10-09
+--- a/CMakeModules/FindMiniZip.cmake
++++ b/CMakeModules/FindMiniZip.cmake
+@@ -15,6 +15,7 @@ FIND_PATH(MINIZIP_INCLUDE_DIR zip.h
+     ~/Library/Frameworks
+     /Library/Frameworks
+     /usr/local/include
++    /usr/include/minizip
+     /usr/include
+     /sw/include # Fink
+     /opt/local/include # DarwinPorts
+@@ -36,6 +37,7 @@ FIND_LIBRARY(MINIZIP_LIBRARY
+     ~/Library/Frameworks
+     /Library/Frameworks
+     /usr/local/lib
++    /usr/lib/${DEB_HOST_MULTIARCH}
+     /usr/lib
+     /sw/lib
+     /opt/local/lib
+@@ -51,4 +53,7 @@ IF(MINIZIP_LIBRARY AND MINIZIP_INCLUDE_D
+     ADD_DEFINITIONS(-DOSGEARTH_HAVE_MINIZIP)
+ ENDIF(MINIZIP_LIBRARY AND MINIZIP_INCLUDE_DIR)
+ 
++INCLUDE(FindPackageHandleStandardArgs)
++FIND_PACKAGE_HANDLE_STANDARD_ARGS(MiniZip DEFAULT_MSG MINIZIP_LIBRARY MINIZIP_INCLUDE_DIR)
++MARK_AS_ADVANCED(MINIZIP_LIBRARY MINIZIP_INCLUDE_DIR)
+ 
+--- a/src/osgEarthDrivers/kml/KMZArchive
++++ b/src/osgEarthDrivers/kml/KMZArchive
+@@ -27,7 +27,7 @@
+ 
+ #include <osgDB/Archive>
+ #include <osgEarth/URI>
+-#include "unzip.h"  // minizip
++#include "minizip/unzip.h"  // minizip
+ 
+ using namespace osgEarth;
+ 
+--- a/src/osgEarthDrivers/kml/KMZArchive.cpp
++++ b/src/osgEarthDrivers/kml/KMZArchive.cpp
+@@ -83,7 +83,7 @@ _bufsize( 1024000 )
+         localURI = downloadToCache( archiveURI );
+     }
+ 
+-    _uf = unzOpen( localURI.full().c_str() );
++    _uf = libkml_unzOpen( localURI.full().c_str() );
+     _buf = (void*)new char[_bufsize];
+ }
+ 
+@@ -169,9 +169,9 @@ KMZArchive::readToBuffer( const std::str
+     {
+         // special case; first try the master file (doc.kml), then failing that, look
+         // for the first KML file in the archive.
+-        if ( unzLocateFile( _uf, "doc.kml", 0 ) != 0 )
++        if ( libkml_unzLocateFile( _uf, "doc.kml", 0 ) != 0 )
+         {
+-            if ( unzGoToFirstFile( _uf ) != UNZ_OK )
++            if ( libkml_unzGoToFirstFile( _uf ) != UNZ_OK )
+             {
+                 OE_WARN << LC << "Archive is empty" << std::endl;
+                 return false;
+@@ -179,7 +179,7 @@ KMZArchive::readToBuffer( const std::str
+ 
+             while( err == UNZ_OK )
+             {
+-                if ( unzGetCurrentFileInfo( _uf, &file_info, filename_inzip, sizeof(filename_inzip), 0L, 0, 0L, 0) )
++                if ( libkml_unzGetCurrentFileInfo( _uf, &file_info, filename_inzip, sizeof(filename_inzip), 0L, 0, 0L, 0) )
+                 {
+                     OE_WARN << LC << "Error with zipfile " << _archiveURI.base() << std::endl;
+                     return false;
+@@ -192,7 +192,7 @@ KMZArchive::readToBuffer( const std::str
+                     break;
+                 }
+ 
+-                err = unzGoToNextFile( _uf );
++                err = libkml_unzGoToNextFile( _uf );
+             }
+ 
+             if ( err != UNZ_OK )
+@@ -203,7 +203,7 @@ KMZArchive::readToBuffer( const std::str
+         }
+     }
+ 
+-    else if ( unzLocateFile( _uf, fileInZip.c_str(), 0 ) )
++    else if ( libkml_unzLocateFile( _uf, fileInZip.c_str(), 0 ) )
+     {
+         OE_WARN << LC << "Failed to locate '" << fileInZip << "' in '" << _archiveURI.base() << "'" << std::endl;
+         return false;
+@@ -211,26 +211,26 @@ KMZArchive::readToBuffer( const std::str
+ 
+     if ( !got_file_info )
+     {
+-        if ( unzGetCurrentFileInfo( _uf, &file_info, filename_inzip, sizeof(filename_inzip), 0L, 0, 0L, 0) )
++        if ( libkml_unzGetCurrentFileInfo( _uf, &file_info, filename_inzip, sizeof(filename_inzip), 0L, 0, 0L, 0) )
+         {
+             OE_WARN << LC << "Error with zipfile " << _archiveURI.base() << std::endl;
+             return false;
+         }
+     }
+ 
+-    err = unzOpenCurrentFilePassword( _uf, 0L );
++    err = libkml_unzOpenCurrentFilePassword( _uf, 0L );
+     if ( err != UNZ_OK )
+     {
+-        OE_WARN << LC << "unzOpenCurrentFilePassword failed" << std::endl;
++        OE_WARN << LC << "libkml_unzOpenCurrentFilePassword failed" << std::endl;
+         return false;
+     }
+ 
+     do
+     {
+-        err = unzReadCurrentFile( _uf, _buf, _bufsize );
++        err = libkml_unzReadCurrentFile( _uf, _buf, _bufsize );
+         if ( err < 0 )
+         {
+-            OE_WARN << LC << "Error in unzReadCurrentFile" << std::endl;
++            OE_WARN << LC << "Error in libkml_unzReadCurrentFile" << std::endl;
+             break;
+         }
+         if ( err > 0 )
+@@ -243,7 +243,7 @@ KMZArchive::readToBuffer( const std::str
+     }
+     while( err > 0 );
+ 
+-    err = unzCloseCurrentFile( _uf );
++    err = libkml_unzCloseCurrentFile( _uf );
+     if ( err != UNZ_OK )
+     {
+         //ignore it...
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -123,9 +123,9 @@ IF (WITH_EXTERNAL_TINYXML)
+     FIND_PACKAGE(TinyXML)
+ ENDIF (WITH_EXTERNAL_TINYXML)
+ 
+-IF (ZLIB_FOUND)
+-    FIND_PACKAGE(MiniZip)
+-ENDIF (ZLIB_FOUND)
++#IF (ZLIB_FOUND)
++#    FIND_PACKAGE(MiniZip)
++#ENDIF (ZLIB_FOUND)
+ 
+ IF(UNIX)
+     # Not sure what this will do on Cygwin and Msys
diff --git a/debian/patches/series b/debian/patches/series
index 2779e52..d083043 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -3,3 +3,4 @@ MPGeometry-OpenSceneGraph-3.1.8.patch
 becuase-typo.patch
 fallback-getCurrentThreadId.patch
 kfreebsd-getCurrentThreadId.patch
+cmake-FindMiniZip.patch
diff --git a/debian/rules b/debian/rules
index 80d1917..4c26426 100755
--- a/debian/rules
+++ b/debian/rules
@@ -6,6 +6,8 @@
 # This has to be exported to make some magic below work.
 export DH_OPTIONS
 
+DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
+
 ifneq (,$(filter parallel=%,$(subst $(COMMA), ,$(DEB_BUILD_OPTIONS))))
 	NJOBS := -j $(subst parallel=,,$(filter parallel=%,$(subst $(COMMA), ,$(DEB_BUILD_OPTIONS))))
 endif
@@ -31,7 +33,7 @@ override_dh_clean:
 	-$(RM) -rf build/
 
 override_dh_auto_configure:
-	mkdir -p build && cd build && cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr -DLIB_POSTFIX=""
+	mkdir -p build && cd build && cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr -DLIB_POSTFIX="" -DDEB_HOST_MULTIARCH=$(DEB_HOST_MULTIARCH)
 
 override_dh_auto_build:
 	# Create man pages from DocBook XML

-- 
osgEarth terrain rendering toolkit



More information about the Pkg-grass-devel mailing list