[107921] trunk/dports/gis/orfeotoolbox
stromnov at macports.org
stromnov at macports.org
Tue Jul 9 01:56:22 PDT 2013
Revision: 107921
https://trac.macports.org/changeset/107921
Author: stromnov at macports.org
Date: 2013-07-09 01:56:22 -0700 (Tue, 09 Jul 2013)
Log Message:
-----------
orfeotoolbox: fix python bindings (#39671)
Modified Paths:
--------------
trunk/dports/gis/orfeotoolbox/Portfile
Added Paths:
-----------
trunk/dports/gis/orfeotoolbox/files/
trunk/dports/gis/orfeotoolbox/files/patch-Code-Wrappers-SWIG-CMakeLists.txt.diff
trunk/dports/gis/orfeotoolbox/files/patch-Code-Wrappers-SWIG-__init__.py.in.diff
Modified: trunk/dports/gis/orfeotoolbox/Portfile
===================================================================
--- trunk/dports/gis/orfeotoolbox/Portfile 2013-07-09 08:53:35 UTC (rev 107920)
+++ trunk/dports/gis/orfeotoolbox/Portfile 2013-07-09 08:56:22 UTC (rev 107921)
@@ -7,7 +7,7 @@
name orfeotoolbox
version 3.18.0
-revision 0
+revision 1
categories gis graphics
platforms darwin
license CeCILL
@@ -33,6 +33,7 @@
sha256 01a866844f7bc1306b52db9584c3f39b19e57fca9a3e30c9c7d82a722689c189
worksrcdir ${worksrcdir}/build
+patch.dir ${workpath}/${distname}
depends_lib-append port:tiff \
port:jpeg \
@@ -111,6 +112,10 @@
depends_lib-append port:python27 \
port:swig \
port:swig-python
+
+ patchfiles-append patch-Code-Wrappers-SWIG-__init__.py.in.diff \
+ patch-Code-Wrappers-SWIG-CMakeLists.txt.diff
+
configure.args-append -DOTB_WRAP_PYTHON=ON \
-DPYTHON_EXECUTABLE=${prefix}/bin/python2.7 \
-DOTB_INSTALL_PYTHON_DIR=${frameworks_dir}/Python.framework/Versions/2.7/lib/python2.7/site-packages
Added: trunk/dports/gis/orfeotoolbox/files/patch-Code-Wrappers-SWIG-CMakeLists.txt.diff
===================================================================
--- trunk/dports/gis/orfeotoolbox/files/patch-Code-Wrappers-SWIG-CMakeLists.txt.diff (rev 0)
+++ trunk/dports/gis/orfeotoolbox/files/patch-Code-Wrappers-SWIG-CMakeLists.txt.diff 2013-07-09 08:56:22 UTC (rev 107921)
@@ -0,0 +1,35 @@
+--- Code/Wrappers/SWIG/CMakeLists.txt.orig 2013-07-08 22:56:43.000000000 +0400
++++ Code/Wrappers/SWIG/CMakeLists.txt 2013-07-09 01:39:44.000000000 +0400
+@@ -56,22 +56,27 @@
+ SWIG_link_libraries ( otbApplication ${PYTHON_LIBRARIES} OTBApplicationEngine)
+ set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/otbApplicationPYTHON_wrap.cxx COMPILE_FLAGS "-w")
+
++ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/__init__.py.in __init__.py @ONLY)
++
+ # byte-compile the resulting python file
+ add_custom_command(
+ TARGET _otbApplication
+ POST_BUILD
+- COMMAND ${CMAKE_COMMAND} -E echo "Byte-compiling otbApplication.py"
+- COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/CMake/PythonCompile.py otbApplication.py
++ COMMAND ${CMAKE_COMMAND} -E echo "Byte-compiling python files"
++ COMMAND ${PYTHON_EXECUTABLE} -m py_compile __init__.py
++ COMMAND ${PYTHON_EXECUTABLE} -m py_compile otbApplication.py
+ DEPENDS _otbApplication
+ )
+
+ install( TARGETS _otbApplication
+- DESTINATION ${OTB_INSTALL_PYTHON_DIR}
++ DESTINATION ${OTB_INSTALL_PYTHON_DIR}/otbApplication
+ COMPONENT RuntimeLibraries )
+
+- install( FILES ${CMAKE_CURRENT_BINARY_DIR}/otbApplication.py
++ install( FILES ${CMAKE_CURRENT_BINARY_DIR}/__init__.py
++ ${CMAKE_CURRENT_BINARY_DIR}/__init__.pyc
++ ${CMAKE_CURRENT_BINARY_DIR}/otbApplication.py
+ ${CMAKE_CURRENT_BINARY_DIR}/otbApplication.pyc
+- DESTINATION ${OTB_INSTALL_PYTHON_DIR}
++ DESTINATION ${OTB_INSTALL_PYTHON_DIR}/otbApplication
+ COMPONENT RuntimeLibraries )
+
+ endif()
Added: trunk/dports/gis/orfeotoolbox/files/patch-Code-Wrappers-SWIG-__init__.py.in.diff
===================================================================
--- trunk/dports/gis/orfeotoolbox/files/patch-Code-Wrappers-SWIG-__init__.py.in.diff (rev 0)
+++ trunk/dports/gis/orfeotoolbox/files/patch-Code-Wrappers-SWIG-__init__.py.in.diff 2013-07-09 08:56:22 UTC (rev 107921)
@@ -0,0 +1,16 @@
+--- /dev/null 2013-07-09 01:31:11.000000000 +0400
++++ Code/Wrappers/SWIG/__init__.py.in 2013-07-09 01:31:50.000000000 +0400
+@@ -0,0 +1,13 @@
++# -*- coding: utf-8 -*-
++
++# Add application plugin path to ITK_AUTOLOAD_PATH automatically
++import os
++app_env_var="ITK_AUTOLOAD_PATH"
++app_path="@CMAKE_INSTALL_PREFIX@/@OTB_INSTALL_APP_DIR@"
++if app_env_var not in os.environ:
++ os.environ[app_env_var] = app_path
++elif app_path not in os.environ[app_env_var].split(":"):
++ os.environ[app_env_var] += ":%s" % app_path
++del os
++
++from otbApplication import *
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20130709/b693af85/attachment-0001.html>
More information about the macports-changes
mailing list