aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/vtk.rb
diff options
context:
space:
mode:
authorSamuel John2011-04-14 19:45:06 +0200
committerAdam Vandenberg2011-04-15 09:22:38 -0700
commit992335813859ad2ae772233dd984f3e407f36207 (patch)
tree4d84ab8458eb216d8418d961b0c08e41767228c5 /Library/Formula/vtk.rb
parent93ca1977d13c620190801672334a92619127419f (diff)
downloadhomebrew-992335813859ad2ae772233dd984f3e407f36207.tar.bz2
vtk: Fixed RPATH issues in libs and python wrapper libs.
* Added --qt-extern to support non brewd Qt. Signed-off-by: Adam Vandenberg <flangy@gmail.com>
Diffstat (limited to 'Library/Formula/vtk.rb')
-rw-r--r--Library/Formula/vtk.rb25
1 files changed, 15 insertions, 10 deletions
diff --git a/Library/Formula/vtk.rb b/Library/Formula/vtk.rb
index 9b61e5446..23a7c8724 100644
--- a/Library/Formula/vtk.rb
+++ b/Library/Formula/vtk.rb
@@ -12,46 +12,51 @@ class Vtk < Formula
[
['--python', "Enable python wrapping."],
['--qt', "Enable Qt extension."],
+ ['--qt-extern', "Enable Qt extension (via external Qt)"],
['--tcl', "Enable Tcl wrapping."],
]
end
def install
- args = [ "#{std_cmake_parameters}",
+ args = std_cmake_parameters.split + [
"-DVTK_REQUIRED_OBJCXX_FLAGS:STRING=''",
"-DVTK_USE_CARBON:BOOL=OFF",
"-DVTK_USE_COCOA:BOOL=ON",
"-DBUILD_TESTING:BOOL=OFF",
"-DBUILD_EXAMPLES:BOOL=OFF",
"-DBUILD_SHARED_LIBS:BOOL=ON",
- "-DVTK_USE_RPATH:BOOL=ON" ]
+ "-DCMAKE_INSTALL_RPATH:STRING='#{lib}/vtk-5.6'",
+ "-DCMAKE_INSTALL_NAME_DIR:STRING='#{lib}/vtk-5.6'"]
if ARGV.include? '--python'
- python_version = `python -V 2>&1`.match('Python (\d+\.\d+)').captures.at(0)
- ENV.append 'PYTHONPATH', ':', '#{lib}/python#{python_version}/site-packages'
+ python_prefix = `python-config --prefix`.strip
+ # Install to global python site-packages
+ args << "-DVTK_PYTHON_SETUP_ARGS:STRING='--prefix=#{python_prefix}'"
+ # Python is actually a library. The libpythonX.Y.dylib points to this lib, too.
+ args << "-DPYTHON_LIBRARY='#{python_prefix}/Python'"
args << "-DVTK_WRAP_PYTHON:BOOL=ON"
end
- if ARGV.include? '--qt'
+ if ARGV.include? '--qt' or ARGV.include? '--qt-extern'
args << "-DVTK_USE_GUISUPPORT:BOOL=ON"
args << "-DVTK_USE_QT:BOOL=ON"
args << "-DVTK_USE_QVTK:BOOL=ON"
- args << "-DDESIRED_QT_VERSION=4"
- args << "-DVTK_USE_QVTK_OPENGL:BOOL=ON"
end
if ARGV.include? '--tcl'
args << "-DVTK_WRAP_TCL:BOOL=ON"
end
- args << "-DCMAKE_INSTALL_RPATH:STRING='${CMAKE_INSTALL_PREFIX}/lib/vtk-5.6'"
- args << "-DCMAKE_INSTALL_NAME_DIR:STRING='${CMAKE_INSTALL_PREFIX}/lib/vtk-5.6'"
+ # Hack suggested at http://www.vtk.org/pipermail/vtk-developers/2006-February/003983.html
+ # to get the right RPATH in the python libraries (the .so files in the vtk egg).
+ # Also readable: http://vtk.1045678.n5.nabble.com/VTK-Python-Wrappers-on-Red-Hat-td1246159.html
+ args << "-DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=ON"
+ ENV['DYLD_LIBRARY_PATH'] = `pwd`.strip + "/build/bin"
system "mkdir build"
args << ".."
Dir.chdir 'build' do
system "cmake", *args
- system "make"
system "make install"
end
end