[31163] trunk/dports/graphics

bfulgham at macports.org bfulgham at macports.org
Fri Nov 16 23:58:04 PST 2007


Revision: 31163
          http://trac.macosforge.org/projects/macports/changeset/31163
Author:   bfulgham at macports.org
Date:     2007-11-16 23:58:03 -0800 (Fri, 16 Nov 2007)

Log Message:
-----------
Correct VTK portfile:
Alas, it uses static linking.  RPATH foo does not seem to work properly,
but perhaps using DYLD_LIBRARY_PATH would be okay for shared library use.
Fixes #11503
Fixes #10823
Fixes #3688

Added Paths:
-----------
    trunk/dports/graphics/vtk5/
    trunk/dports/graphics/vtk5/Portfile
    trunk/dports/graphics/vtk5/files/
    trunk/dports/graphics/vtk5/files/patch-Rendering-vtkCocoaRenderWindow.mm

Added: trunk/dports/graphics/vtk5/Portfile
===================================================================
--- trunk/dports/graphics/vtk5/Portfile	                        (rev 0)
+++ trunk/dports/graphics/vtk5/Portfile	2007-11-17 07:58:03 UTC (rev 31163)
@@ -0,0 +1,104 @@
+#include $Id$
+
+PortSystem 1.0
+name		vtk5
+version		5.0.3
+categories	graphics devel
+maintainers	rene.donner at mac.com
+description	3D visualization toolkit
+long_description	an open source, freely available software system  \
+	for 3D computer graphics, image processing, and visualization     \
+	used by thousands of researchers and developers around the world. \
+	VTK consists of a C++ class library, and several interpreted      \
+	interface layers including Tcl/Tk, Java, and Python.
+
+homepage	http://www.vtk.org/
+platforms	darwin freebsd
+master_sites	http://www.vtk.org/files/release/5.0/
+checksums	vtk-${version}.tar.gz md5 0148a3d3c46d0599ab63e79f7f406609 \
+	 	vtkdata-${version}.tar.gz md5 4752aa5a363eae72abf3cb5c1f0fe4d9
+
+
+depends_build	bin:cmake:cmake
+distfiles	vtk-${version}.tar.gz \
+		vtkdata-${version}.tar.gz
+distname	VTK
+
+#post-extract {
+#    set fl [open "| grep VTK_BUILD_VERSION ${worksrcpath}/CMakeLists.txt | grep 6"]
+#    set data [read $fl]
+#    close $fl
+#    if {$data != "SET(VTK_BUILD_VERSION 6)\n"} { ui_msg "$data
+#================================================================
+#Warning : the Latest VTK version is not the same as the Portfile
+#The build may still succeed but this should be reported as a bug
+#================================================================"
+#    }
+#}
+
+patchfiles	patch-Rendering-vtkCocoaRenderWindow.mm
+
+configure	{ system "cd ${worksrcpath} && ${configure.env} cmake ${configure.args} ${worksrcpath}" }
+configure.args	-DBUILD_SHARED_LIBS:BOOL=OFF \
+		-DCMAKE_LIBRARY_PATH:PATH=${prefix}/lib \
+		-DCMAKE_INCLUDE_PATH:PATH=${prefix}/include \
+		-DCMAKE_INSTALL_PREFIX:PATH=${prefix} \
+		-DCMAKE_INSTALL_NAME_DIR:STRING=${prefix}/lib \
+		-DCMAKE_EXE_LINKER_FLAGS:STRING=-rpath ${prefix}/lib \
+		-DVTK_INSTALL_PREFIX:PATH=${prefix} \
+		-DVTK_USE_HYBRID:BOOL=ON \
+		-DVTK_USE_CARBON:BOOL=OFF \
+		-DVTK_WRAP_TCL:BOOL=ON \
+		-DVTK_USE_COCOA:BOOL=ON \
+		-DVTK_DATA_ROOT:PATH=${prefix}/share/VTKData \
+		-DVTK_TCL_LIBRARY_DIR:FILEPATH=${prefix}/lib/tcl8.4 \
+		-DVTK_REQUIRED_EXE_LINKER_FLAGS:STRING=-rpath ${prefix}/lib
+
+configure.env	LDFLAGS="-L${prefix}/lib" \
+		CPPFLAGS="-I${prefix}/include"
+
+platform darwin 8 {
+	configure.env-append	CC=/usr/bin/gcc-4.0 CPP=/usr/bin/cpp-4.0 MACOSX_DEPLOYMENT_TARGET=10.4
+}
+
+platform darwin 9 {
+	configure.env-append	MACOSX_DEPLOYMENT_TARGET=10.5
+}
+
+variant x11 {
+	depends_build-append	lib:libX11:XFree86
+	configure.args-delete	"-D VTK_USE_COCOA:BOOL=ON"
+	configure.args-append	-DVTK_USE_COCOA:BOOL=OFF \
+				-DVTK_USE_X:BOOL=ON \
+				-DOPENGL_gl_LIBRARY:FILEPATH=/usr/X11R6/lib/libGL.dylib \
+				-DOPENGL_glu_LIBRARY:FILEPATH=/usr/X11R6/lib/libGLU.dylib
+}
+
+variant python {
+	depends_build-append	port:python25
+	configure.args-append	-DPYTHON_DEBUG_LIBRARY:FILEPATH=${prefix}/lib/libpython2.5.dylib \
+				-DPYTHON_EXECUTABLE:FILEPATH=${prefix}/bin/python2.5 \
+				-DPYTHON_INCLUDE_PATH:FILEPATH=${prefix}/include/python2.5 \
+				-DPYTHON_LIBRARY:FILEPATH=${prefix}/lib/libpython2.5.dylib \
+				-DVTK_WRAP_PYTHON:BOOL=ON \
+				-DVTK_PYTHON_SETUP_ARGS:STRING="--prefix=${prefix} --root=${destdir}
+}
+
+set vtkdest	${destroot}${prefix}/share/doc/${name}
+
+post-destroot {
+	xinstall -d -m 0755 ${vtkdest}
+	file copy ${worksrcpath}/README.html ${vtkdest}
+	file copy ${worksrcpath}/Copyright.txt ${vtkdest}
+	file copy ${worksrcpath}/Testing.txt ${vtkdest}
+
+	# Must set RPATH on executables
+
+	# Provide some examples
+	file copy ${worksrcpath}/Examples ${vtkdest}
+	foreach x {CommonCxxTests FilteringCxxTests GenericFilteringCxxTests GraphicsCxxTests IOCxxTests} { file copy ${worksrcpath}/bin/$x ${vtkdest}/Examples }
+	foreach x {ImagingCxxTests RenderingCxxTests TestCxxFeatures TestInstantiator VTKBenchMark VolumeRenderingCxxTests WidgetsCxxTests} { file copy ${worksrcpath}/bin/$x ${vtkdest}/Examples }
+
+	# Provide data files
+	system "tar -C ${destroot}${prefix}/share -xzvf ${distpath}/vtkdata-${version}.tar.gz"
+}

Added: trunk/dports/graphics/vtk5/files/patch-Rendering-vtkCocoaRenderWindow.mm
===================================================================
--- trunk/dports/graphics/vtk5/files/patch-Rendering-vtkCocoaRenderWindow.mm	                        (rev 0)
+++ trunk/dports/graphics/vtk5/files/patch-Rendering-vtkCocoaRenderWindow.mm	2007-11-17 07:58:03 UTC (rev 31163)
@@ -0,0 +1,29 @@
+--- Rendering/vtkCocoaRenderWindow.mm.orig	2007-11-10 20:48:38.000000000 -0800
++++ Rendering/vtkCocoaRenderWindow.mm	2007-11-10 20:54:33.000000000 -0800
+@@ -220,7 +220,7 @@
+   // pertinent settings.
+   NSOpenGLPixelFormat* pixelFormat = (NSOpenGLPixelFormat*)this->PixelFormat;
+   strm << "PixelFormat Descriptor:" << endl;
+-  long pfd;
++  GLint pfd;
+   [pixelFormat getValues: &pfd forAttribute: NSOpenGLPFAColorSize forVirtualScreen: currentScreen];
+   strm  << "  colorSize:  " << pfd << endl;
+ 
+@@ -265,7 +265,7 @@
+   int currentScreen = [context currentVirtualScreen];
+ 
+   NSOpenGLPixelFormat* pixelFormat = (NSOpenGLPixelFormat*)this->PixelFormat;
+-  long pfd;
++  GLint pfd;
+   [pixelFormat getValues: &pfd forAttribute: NSOpenGLPFACompliant forVirtualScreen: currentScreen];
+ 
+   return (pfd == YES ? 1 : 0);
+@@ -284,7 +284,7 @@
+   int currentScreen = [context currentVirtualScreen];
+ 
+   NSOpenGLPixelFormat* pixelFormat = (NSOpenGLPixelFormat*)this->PixelFormat;
+-  long pfd;
++  GLint pfd;
+   [pixelFormat getValues: &pfd forAttribute: NSOpenGLPFAFullScreen forVirtualScreen: currentScreen];
+ 
+   return (pfd == YES ? 1 : 0);

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-changes/attachments/20071116/0f9a9642/attachment-0001.html


More information about the macports-changes mailing list