[otb] 01/01: Add upstream patches to support OSSIM 2.2.0.

Bas Couwenberg sebastic at debian.org
Sun Dec 17 13:41:56 UTC 2017


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

sebastic pushed a commit to branch master
in repository otb.

commit 5c840dbfe8445a0c6cd930e7d2373015d7fdc6cd
Author: Bas Couwenberg <sebastic at xs4all.nl>
Date:   Sun Dec 17 14:40:31 2017 +0100

    Add upstream patches to support OSSIM 2.2.0.
---
 debian/changelog                                   |  1 +
 ...1499-add-a-if-else-to-support-ossimRpcSol.patch | 54 +++++++++++++++++++++
 ...UG-Mantis-1499-detect-Ossim-version-2.2.0.patch | 56 ++++++++++++++++++++++
 debian/patches/series                              |  2 +
 4 files changed, 113 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 350d2af..155dc8c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -5,6 +5,7 @@ otb (6.2.0+dfsg-2) UNRELEASED; urgency=medium
   * Drop libproj-dev build dependency, not directly required and alreadyu
     pulled in via libgdal-dev.
   * Bump Standards-Version to 4.1.2, no changes.
+  * Add upstream patches to support OSSIM 2.2.0.
 
  -- Bas Couwenberg <sebastic at debian.org>  Mon, 13 Nov 2017 23:03:39 +0100
 
diff --git a/debian/patches/0001-BUG-Mantis-1499-add-a-if-else-to-support-ossimRpcSol.patch b/debian/patches/0001-BUG-Mantis-1499-add-a-if-else-to-support-ossimRpcSol.patch
new file mode 100644
index 0000000..2fdeac0
--- /dev/null
+++ b/debian/patches/0001-BUG-Mantis-1499-add-a-if-else-to-support-ossimRpcSol.patch
@@ -0,0 +1,54 @@
+From 8cad2e5d8265563ad8e03b044398a578a20bf7cf Mon Sep 17 00:00:00 2001
+From: Guillaume Pasero <guillaume.pasero at c-s.fr>
+Date: Fri, 15 Dec 2017 17:15:41 +0100
+Subject: BUG: Mantis-1499: add a if-else to support
+ ossimRpcSolver::getRpcModel()
+
+---
+ Modules/Adapters/OSSIMAdapters/src/CMakeLists.txt          | 11 ++++++++++-
+ Modules/Adapters/OSSIMAdapters/src/otbRPCSolverAdapter.cxx |  4 ++++
+ Modules/ThirdParty/Ossim/otb-module-init.cmake             |  2 ++
+ 3 files changed, 16 insertions(+), 1 deletion(-)
+
+--- a/Modules/Adapters/OSSIMAdapters/src/CMakeLists.txt
++++ b/Modules/Adapters/OSSIMAdapters/src/CMakeLists.txt
+@@ -41,7 +41,16 @@ target_link_libraries(OTBOSSIMAdapters
+   ${OTBOssim_LIBRARIES}
+   ${OTBOssimPlugins_LIBRARIES}
+   ${OTBOpenThreads_LIBRARIES}
+-
+   )
+ 
+ otb_module_target(OTBOSSIMAdapters)
++
++# add the OTB_OSSIM_VERSION definition
++get_target_property(_OTBOSSIMAdapters_COMP_DEF OTBOSSIMAdapters COMPILE_DEFINITIONS)
++if(_OTBOSSIMAdapters_COMP_DEF)
++  set_target_properties(OTBOSSIMAdapters
++    PROPERTIES COMPILE_DEFINITIONS "${_OTBOSSIMAdapters_COMP_DEF};OTB_OSSIM_VERSION=${OTB_OSSIM_VERSION}")
++else()
++  set_target_properties(OTBOSSIMAdapters
++    PROPERTIES COMPILE_DEFINITIONS "OTB_OSSIM_VERSION=${OTB_OSSIM_VERSION}")
++endif()
+--- a/Modules/Adapters/OSSIMAdapters/src/otbRPCSolverAdapter.cxx
++++ b/Modules/Adapters/OSSIMAdapters/src/otbRPCSolverAdapter.cxx
+@@ -112,7 +112,11 @@ RPCSolverAdapter::Solve(const GCPsContai
+   rmsError = rpcSolver->getRmsError();
+ 
+   // Retrieve the output RPC projection
++#if OTB_OSSIM_VERSION < 20200
+   ossimRefPtr<ossimRpcProjection> rpcProjection = dynamic_cast<ossimRpcProjection*>(rpcSolver->createRpcProjection()->getProjection());
++#else
++  ossimRefPtr<ossimRpcModel> rpcProjection = rpcSolver->getRpcModel();
++#endif
+ 
+   // Export the sensor model in an ossimKeywordlist
+   ossimKeywordlist geom_kwl;
+--- a/Modules/ThirdParty/Ossim/otb-module-init.cmake
++++ b/Modules/ThirdParty/Ossim/otb-module-init.cmake
+@@ -19,3 +19,5 @@
+ #
+ 
+ find_package ( Ossim REQUIRED )
++
++set(OTB_OSSIM_VERSION ${OSSIM_VERSION_NUMBER} CACHE INTERNAL "Ossim version detected by OTB" FORCE)
diff --git a/debian/patches/0001-BUG-Mantis-1499-detect-Ossim-version-2.2.0.patch b/debian/patches/0001-BUG-Mantis-1499-detect-Ossim-version-2.2.0.patch
new file mode 100644
index 0000000..7195cf4
--- /dev/null
+++ b/debian/patches/0001-BUG-Mantis-1499-detect-Ossim-version-2.2.0.patch
@@ -0,0 +1,56 @@
+From 85d25812fef825c2e095e8dad064fd94453ea0da Mon Sep 17 00:00:00 2001
+From: Guillaume Pasero <guillaume.pasero at c-s.fr>
+Date: Fri, 15 Dec 2017 17:13:31 +0100
+Subject: BUG: Mantis-1499: detect Ossim version 2.2.0
+
+---
+ CMake/FindOssim.cmake | 28 +++++++++++++++++++++++-----
+ 1 file changed, 23 insertions(+), 5 deletions(-)
+
+--- a/CMake/FindOssim.cmake
++++ b/CMake/FindOssim.cmake
+@@ -35,14 +35,10 @@ find_path( OSSIM_INCLUDE_DIR
+            NAMES ossim/init/ossimInit.h )
+ 
+ # Version checking
++set(OSSIM_VERSION)
+ if(EXISTS "${OSSIM_INCLUDE_DIR}/ossim/ossimVersion.h")
+   file(READ "${OSSIM_INCLUDE_DIR}/ossim/ossimVersion.h" _ossim_version_h_CONTENTS)
+   string(REGEX REPLACE ".*# *define OSSIM_VERSION *\"([0-9.]+)\".*" "\\1" OSSIM_VERSION "${_ossim_version_h_CONTENTS}")
+-  string(REGEX REPLACE "([0-9]+)\\.([0-9]+)\\.([0-9]+)" "\\1" OSSIM_MAJOR_VERSION_NUMBER "${OSSIM_VERSION}")
+-  string(REGEX REPLACE "([0-9]+)\\.([0-9]+)\\.([0-9]+)" "\\2" OSSIM_MINOR_VERSION_NUMBER "${OSSIM_VERSION}")
+-  string(REGEX REPLACE "([0-9]+)\\.([0-9]+)\\.([0-9]+)" "\\3" OSSIM_PATCH_VERSION_NUMBER "${OSSIM_VERSION}")
+-  math(EXPR OSSIM_VERSION_NUMBER
+-    "((${OSSIM_MAJOR_VERSION_NUMBER})*100+${OSSIM_MINOR_VERSION_NUMBER})*100+${OSSIM_PATCH_VERSION_NUMBER}")
+   if("${OSSIM_VERSION}" VERSION_LESS "1.8.20")
+     message(WARNING "The OSSIM include directory detected by OTB is: '${OSSIM_INCLUDE_DIR}'."
+       "This version (${OSSIM_VERSION}) is not fully compatible with OTB."
+@@ -67,6 +63,28 @@ else()
+   endif()
+ endif()
+ 
++# Hack to detect version 2.2.0, without ossimVersion.h
++if(EXISTS "${OSSIM_INCLUDE_DIR}/ossim/projection/ossimRpcSolver.h")
++  file(STRINGS "${OSSIM_INCLUDE_DIR}/ossim/projection/ossimRpcSolver.h" _ossim_rpc_solv_content)
++  if(_ossim_rpc_solv_content MATCHES "const +ossimRefPtr<ossimRpcModel> +getRpcModel\\(\\)")
++    if((NOT OSSIM_VERSION) OR (OSSIM_VERSION VERSION_LESS "2.2.0"))
++      set(OSSIM_VERSION "2.2.0")
++    endif()
++  endif()
++endif()
++
++if(OSSIM_VERSION)
++  string(REGEX REPLACE "([0-9]+)\\.([0-9]+)\\.([0-9]+)" "\\1" OSSIM_MAJOR_VERSION_NUMBER "${OSSIM_VERSION}")
++  string(REGEX REPLACE "([0-9]+)\\.([0-9]+)\\.([0-9]+)" "\\2" OSSIM_MINOR_VERSION_NUMBER "${OSSIM_VERSION}")
++  string(REGEX REPLACE "([0-9]+)\\.([0-9]+)\\.([0-9]+)" "\\3" OSSIM_PATCH_VERSION_NUMBER "${OSSIM_VERSION}")
++  math(EXPR OSSIM_VERSION_NUMBER
++    "((${OSSIM_MAJOR_VERSION_NUMBER})*100+${OSSIM_MINOR_VERSION_NUMBER})*100+${OSSIM_PATCH_VERSION_NUMBER}")
++else()
++  # Unknown version : default to 0
++  set(OSSIM_VERSION_NUMBER 0)
++endif()
++
++# Look for the library
+ find_library(OSSIM_LIBRARY
+              NAMES ossim)
+ 
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..1cd3b3f
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1,2 @@
+0001-BUG-Mantis-1499-detect-Ossim-version-2.2.0.patch
+0001-BUG-Mantis-1499-add-a-if-else-to-support-ossimRpcSol.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-grass/otb.git



More information about the Pkg-grass-devel mailing list