Skip to content

Commit

Permalink
orfeotoolbox, py-orfeotoolbox: update to version 9.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
nilason committed Mar 21, 2024
1 parent 93accb9 commit a99be3c
Show file tree
Hide file tree
Showing 6 changed files with 117 additions and 50 deletions.
62 changes: 42 additions & 20 deletions gis/orfeotoolbox/Portfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ PortGroup cmake 1.1
PortGroup boost 1.0

name orfeotoolbox
version 8.1.2
revision 3
version 9.0.0
revision 0
categories gis graphics
license Apache-2

Expand All @@ -29,9 +29,9 @@ distname OTB-${version}
use_xz yes
extract.mkdir yes

checksums rmd160 08a7f65dd40aead733905a977b06d265628f9f16 \
sha256 557408fe6ba5710b78252f4c4e4e30a19720fa4534cbd1c22f136ed150df0ed7 \
size 750674188
checksums rmd160 ffddd0e8ed8c0b70e9d4bb16931aec78bf47b1eb \
sha256 29d52a23fce6156651467787510f6c3c1bf885d271547a736d70b840d2ca2c30 \
size 754108528

boost.version 1.76

Expand All @@ -56,13 +56,15 @@ depends_lib-append port:curl \
port:muparser \
port:muparserx \
port:${opencv} \
port:shark \
port:tiff \
port:tinyxml \
port:zlib

patchfiles-append patch-neural.diff \
patch-FindOpenCV.diff \
patch-rpath.diff
patch-app.diff \
patch-compiler-flags.diff

post-patch {
reinplace "s|@OPENCV@|${opencv}|" ${worksrcpath}/CMake/FindOpenCV.cmake
Expand All @@ -75,21 +77,29 @@ configure.args-append \
-DBUILD_EXAMPLES=OFF \
-DBUILD_SHARED_LIBS=ON \
-DBUILD_TESTING=OFF \
-DOTB_USE_6S:BOOL=OFF \
-DOTBGroup_Core=ON \
-DOTBGroup_FeaturesExtraction=ON \
-DOTBGroup_Hyperspectral=ON \
-DOTBGroup_Learning=ON \
-DOTBGroup_Miscellaneous=ON \
-DOTBGroup_Remote=ON \
-DOTBGroup_SAR=ON \
-DOTBGroup_Segmentation=ON \
-DOTBGroup_StereoProcessing=ON \
-DOTBGroup_ThirdParty=ON \
-DOTB_USE_6S=ON \
-DOTB_USE_CURL=ON \
-DOTB_USE_GSL=OFF \
-DOTB_USE_LIBKML=ON \
-DOTB_USE_LIBSVM=ON \
-DOTB_USE_SIFTFAST=ON \
-DOTB_USE_OPENCV=ON \
-DOTB_USE_OPENGL=OFF \
-DOTB_USE_MUPARSER=ON \
-DOTB_USE_MUPARSERX=ON \
-DOTB_USE_OPENCV=ON \
-DOTB_USE_SHARK=ON \
-DOTB_USE_SIFTFAST=ON \
-DOTB_USE_SIFTFAST=ON \
-DOTB_WRAP_PYTHON=OFF \
-DOTB_USE_QT=OFF \
-DOTB_USE_QWT=OFF \
-DOTB_WRAP_QGIS=ON \
-DOpenCV_DIR=${prefix}
-DOTB_WRAP_QGIS=ON

# The default installation path for library is ${prefix}/lib/otb
# But the cmake PortGroup is using rpath and CMAKE_INSTALL_NAME_DIR=${prefix}/lib
Expand All @@ -100,13 +110,8 @@ configure.args-replace \
configure.args-append \
-DCMAKE_BUILD_RPATH=${cmake.build_dir}/lib

post-destroot {
system -W ${destroot}${prefix} \
"install_name_tool -rpath ${cmake.build_dir}/lib ${prefix}/lib ./bin/otbQgisDescriptor"
}

# Create Python subports
set python_versions {310 311}
set python_versions {310 311 312}
foreach v ${python_versions} {
subport py${v}-${name} {
set py_dot_ver [string index ${v} 0].[string range ${v} 1 end]
Expand Down Expand Up @@ -142,6 +147,8 @@ foreach v ${python_versions} {
delete ${destroot}${prefix}/lib
delete ${destroot}${prefix}/share/doc
delete ${destroot}${prefix}/share/otb/description
delete ${destroot}${prefix}/LICENSE
delete ${destroot}${prefix}/README
file rename ${destroot}${prefix}/share/otb/swig \
${destroot}${prefix}/share/otb/swig-py${v}

Expand All @@ -151,10 +158,25 @@ foreach v ${python_versions} {
reinplace "s|@PREFIX@|${prefix}|" \
${destroot}/${py_pkgd}/otbApplication/__init__.py
}

livecheck.type none
}
}

post-destroot {
delete ${destroot}${prefix}/tools
delete ${destroot}${prefix}/recompile_bindings.sh
delete ${destroot}${prefix}/otbenv.profile
delete ${destroot}${prefix}/share/otb/swig
}

if {${subport} eq ${name}} {
post-destroot {
file rename ${destroot}${prefix}/share/doc/otb ${destroot}${prefix}/share/otb/doc
file rename ${destroot}${prefix}/LICENSE ${destroot}${prefix}/share/otb/doc/LICENSE
file rename ${destroot}${prefix}/README ${destroot}${prefix}/share/otb/doc/README
}

notes-append "
To enable the OrfeoToolbox provider plugin in QGIS (version <3.36):
set in 'Preferences > Processing > Providers > OTB' the entries
Expand Down
8 changes: 4 additions & 4 deletions gis/orfeotoolbox/files/patch-Modules-Wrappers-SWIG-src.diff
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--- Modules/Wrappers/SWIG/src/otbPythonLogOutput.i.orig
+++ Modules/Wrappers/SWIG/src/otbPythonLogOutput.i
--- Modules/Core/Wrappers/SWIG/src/otbPythonLogOutput.i.orig
+++ Modules/Core/Wrappers/SWIG/src/otbPythonLogOutput.i
@@ -105,7 +105,7 @@
/** Create the required objects for logging. Logger.Instance() is reset in
* order to replace the itkStdStreamLogOutput by a PythonLogOutput */
Expand All @@ -11,8 +11,8 @@
Logger.Instance().ResetOutputs()


--- Modules/Wrappers/SWIG/src/otbApplication.i.orig
+++ Modules/Wrappers/SWIG/src/otbApplication.i
--- Modules/Core/Wrappers/SWIG/src/otbApplication.i.orig
+++ Modules/Core/Wrappers/SWIG/src/otbApplication.i
@@ -229,7 +229,7 @@
logger = self.GetLogger()
logger.AddLogOutput(_libraryLogOutput.GetPointer())
Expand Down
52 changes: 52 additions & 0 deletions gis/orfeotoolbox/files/patch-app.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
--- Modules/Learning/Applications/app/CMakeLists.txt.orig
+++ Modules/Learning/Applications/app/CMakeLists.txt
@@ -131,4 +131,4 @@
LINK_LIBRARIES ${${otb-module}_LIBRARIES})

# Mantis-1427 : temporary fix
-add_dependencies(${otb-module}-all otbapp_ImageEnvelope)
\ No newline at end of file
+# add_dependencies(${otb-module}-all otbapp_ImageEnvelope)
\ No newline at end of file


--- CMake/OTBApplicationMacros.cmake.orig
+++ CMake/OTBApplicationMacros.cmake
@@ -42,6 +42,9 @@
# Remove the usual 'lib' prefix to make it clear it is a plugin
# and not a shared library to link against
set_property(TARGET ${APPLICATION_TARGET_NAME} PROPERTY PREFIX "")
+ if (APPLE)
+ set_property(TARGET ${APPLICATION_TARGET_NAME} PROPERTY SUFFIX ".dylib")
+ endif()

# When called from the OTB build system, use OTB_INSTALL_APP_DIR
if (NOT APPLICATION_INSTALL_PATH AND OTB_INSTALL_APP_DIR)



--- Modules/ThirdParty/6S/src/main.c.orig
+++ Modules/ThirdParty/6S/src/main.c
@@ -108,7 +108,7 @@
static integer c__9 = 9;

/*< program ssssss >*/
-/* Main program */ MAIN__()
+int /* Main program */ MAIN__(void)
{
/* Initialized data */


--- Modules/ThirdParty/6S/src/otb_main6S_program_call_function.c.orig
+++ Modules/ThirdParty/6S/src/otb_main6S_program_call_function.c
@@ -18,7 +18,7 @@
static integer c__3 = 3;

/*< program call6Sv1_0b >*/
-/* Main program */ OTB_6S_MAIN__()
+int /* Main program */ OTB_6S_MAIN__(void)
{
/* Format strings */
static char fmt_100[] = "(10x,\002 -----> atmospheric reflectance : \


10 changes: 10 additions & 0 deletions gis/orfeotoolbox/files/patch-compiler-flags.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
--- CMake/OTBSetStandardCompilerFlags.cmake.orig
+++ CMake/OTBSetStandardCompilerFlags.cmake
@@ -142,7 +142,6 @@
-Wpointer-arith
-Wunused
-Wwrite-strings
- -funit-at-a-time
-Wno-strict-overflow
)

18 changes: 9 additions & 9 deletions gis/orfeotoolbox/files/patch-py-version.diff
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
--- CMakeLists.txt.orig
+++ CMakeLists.txt
@@ -121,7 +121,7 @@
if(WIN32)
set(Python_ROOT_DIR "C:/tools/Python37-x64")
endif()
- find_package(Python REQUIRED COMPONENTS Interpreter Development)
+ find_package(Python @PYVER@ EXACT REQUIRED COMPONENTS Interpreter Development)
if(Python_FOUND)
message(STATUS "Python Library directory : ${Python_LIBRARY_DIRS}")
message(STATUS "Python Headers directory : ${Python_INCLUDE_DIRS}")
@@ -90,7 +90,7 @@
repository_status(${PROJECT_SOURCE_DIR} OTB_GIT_STATUS_MESSAGE)

if(OTB_WRAP_PYTHON)
- find_package(Python REQUIRED COMPONENTS Interpreter Development)
+ find_package(Python @PYVER@ EXACT REQUIRED COMPONENTS Interpreter Development)
if(Python_FOUND)
message(STATUS "Python Library directory : ${Python_LIBRARY_DIRS}")
message(STATUS "Python Headers directory : ${Python_INCLUDE_DIRS}")
17 changes: 0 additions & 17 deletions gis/orfeotoolbox/files/patch-rpath.diff

This file was deleted.

0 comments on commit a99be3c

Please sign in to comment.