diff --git a/gis/orfeotoolbox/Portfile b/gis/orfeotoolbox/Portfile index 1f1e51931fc4..dc5f8a52c310 100644 --- a/gis/orfeotoolbox/Portfile +++ b/gis/orfeotoolbox/Portfile @@ -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 @@ -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 @@ -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 @@ -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 @@ -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] @@ -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} @@ -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 diff --git a/gis/orfeotoolbox/files/patch-Modules-Wrappers-SWIG-src.diff b/gis/orfeotoolbox/files/patch-Modules-Wrappers-SWIG-src.diff index 746bab7d7e3f..0ff0639b8eaa 100644 --- a/gis/orfeotoolbox/files/patch-Modules-Wrappers-SWIG-src.diff +++ b/gis/orfeotoolbox/files/patch-Modules-Wrappers-SWIG-src.diff @@ -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 */ @@ -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()) diff --git a/gis/orfeotoolbox/files/patch-app.diff b/gis/orfeotoolbox/files/patch-app.diff new file mode 100644 index 000000000000..297068372310 --- /dev/null +++ b/gis/orfeotoolbox/files/patch-app.diff @@ -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 : \ + + diff --git a/gis/orfeotoolbox/files/patch-compiler-flags.diff b/gis/orfeotoolbox/files/patch-compiler-flags.diff new file mode 100644 index 000000000000..98ff7b0f3a1e --- /dev/null +++ b/gis/orfeotoolbox/files/patch-compiler-flags.diff @@ -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 + ) + diff --git a/gis/orfeotoolbox/files/patch-py-version.diff b/gis/orfeotoolbox/files/patch-py-version.diff index 4b11adb79389..1347d5abc2a9 100644 --- a/gis/orfeotoolbox/files/patch-py-version.diff +++ b/gis/orfeotoolbox/files/patch-py-version.diff @@ -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}") diff --git a/gis/orfeotoolbox/files/patch-rpath.diff b/gis/orfeotoolbox/files/patch-rpath.diff deleted file mode 100644 index b61b345fefe2..000000000000 --- a/gis/orfeotoolbox/files/patch-rpath.diff +++ /dev/null @@ -1,17 +0,0 @@ ---- Modules/Wrappers/QGIS/src/CMakeLists.txt.orig -+++ Modules/Wrappers/QGIS/src/CMakeLists.txt -@@ -17,7 +17,14 @@ - # See the License for the specific language governing permissions and - # limitations under the License. - -+ - add_executable(otbQgisDescriptor otbQgisDescriptor.cxx) -+ -+if(NOT "${CMAKE_BUILD_RPATH}" STREQUAL "") -+ set_property(TARGET otbQgisDescriptor PROPERTY BUILD_WITH_INSTALL_RPATH ON) -+endif() -+set_property(TARGET otbQgisDescriptor PROPERTY INSTALL_RPATH "${OTB_BINARY_DIR}/lib") -+ - target_link_libraries(otbQgisDescriptor ${OTBQGIS_LIBRARIES}) - otb_module_target(otbQgisDescriptor) -