[48149] trunk/dports/graphics/vtk5/Portfile

takeshi at macports.org takeshi at macports.org
Sun Mar 15 03:00:33 PDT 2009


Revision: 48149
          http://trac.macports.org/changeset/48149
Author:   takeshi at macports.org
Date:     2009-03-15 03:00:31 -0700 (Sun, 15 Mar 2009)
Log Message:
-----------
2009-03-15 Takeshi Enomoto <takeshi at macports.org>
* configure.args: enabled shared libraries 
	-DBUILD_SHARED_LIBS:BOOL=ON
* configure.args: Set RPATH with the following CMAKE options
        -DVTK_USE_RPATH:BOOL=ON \
        -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=ON \
        -DCMAKE_INSTALL_RPATH:STRING=${prefix}/lib/vtk-5.2 \
        -DCMAKE_INSTALL_NAME_DIR:STRING=${prefix}/lib/vtk-5.2 \
        -DCMAKE_INSTALL_RPATH_USE_LINK_PATH:BOOL=ON ?\194?\165
* build.env: DYLD_LIBRARY_PATH needs to be set to find libraries with -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=ON. This CMake option is required to write RPATH in python modules
* default variant: x11, python. Some Tcl examples wm withdraw . does not work with Cocoa. Left x11 and python variants to allows user to turn off them as required.
* variant python: Prevent invoking setup.py install since args are not passed correctly through CMake
	-DVTK_INSTALL_NO_PYTHON:BOOL=ON
* post-destroot: Python modules are installed manually here.

Modified Paths:
--------------
    trunk/dports/graphics/vtk5/Portfile

Modified: trunk/dports/graphics/vtk5/Portfile
===================================================================
--- trunk/dports/graphics/vtk5/Portfile	2009-03-15 08:52:11 UTC (rev 48148)
+++ trunk/dports/graphics/vtk5/Portfile	2009-03-15 10:00:31 UTC (rev 48149)
@@ -3,21 +3,22 @@
 
 PortSystem 1.0
 
-name		vtk5
-version		5.2.1
-set branch	[join [lrange [split ${version} .] 0 1] .]
-categories	graphics devel
-maintainers	nomaintainer
-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.
+name        vtk5
+version     5.2.1
+revision    1
+set branch  [join [lrange [split ${version} .] 0 1] .]
+categories  graphics devel
+maintainers nomaintainer
+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/${branch}/
+homepage    http://www.vtk.org/
+platforms   darwin freebsd
+master_sites    http://www.vtk.org/files/release/${branch}/
 checksums vtk-${version}.tar.gz md5 d59520d5f6c49c8b4e3b9227e341b19f \
           vtk-${version}.tar.gz sha1 e08ee5c9d738c2fe774fdb3111818b9899a7b751 \
           vtk-${version}.tar.gz rmd160 c6cdee0c76e243d21d802690f138faab1c6eb863\
@@ -25,96 +26,107 @@
       vtkdata-${version}.tar.gz sha1 a625f4934d0fbaad2242ae2bc920084775438933 \
       vtkdata-${version}.tar.gz rmd160 5628fec27673d99426922dcd32b8d66a0d86c9ec
 
-depends_build	bin:cmake:cmake \
-		port:readline
-distfiles	vtk-${version}.tar.gz \
-		vtkdata-${version}.tar.gz
-distname	VTK
+depends_build   bin:cmake:cmake \
+        port:readline
+distfiles   vtk-${version}.tar.gz \
+        vtkdata-${version}.tar.gz
+distname    VTK
 
+use_parallel_build yes
+
 post-extract {
-	delete ${worksrcpath}/Utilities/vtktiff/tif_fax3sm.c
-#    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
-#================================================================"
-#    }
+    delete ${worksrcpath}/Utilities/vtktiff/tif_fax3sm.c
 }
 
-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_WRAP_PYTHON:BOOL=OFF \
-		-DVTK_REQUIRED_EXE_LINKER_FLAGS:STRING=-rpath ${prefix}/lib
+configure   { system "cd ${worksrcpath} && ${configure.env} cmake ${configure.args} ${worksrcpath}" }
+configure.args  \
+        -DBUILD_SHARED_LIBS:BOOL=ON \
+        -DVTK_USE_RPATH:BOOL=ON \
+        -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=ON \
+        -DCMAKE_INSTALL_RPATH:STRING=${prefix}/lib/vtk-5.2 \
+        -DCMAKE_INSTALL_NAME_DIR:STRING=${prefix}/lib/vtk-5.2 \
+        -DCMAKE_INSTALL_RPATH_USE_LINK_PATH:BOOL=ON \
+        -DCMAKE_LIBRARY_PATH:PATH=${prefix}/lib \
+        -DCMAKE_INCLUDE_PATH:PATH=${prefix}/include \
+        -DCMAKE_INSTALL_PREFIX:PATH=${prefix} \
+        -DVTK_INSTALL_PREFIX:PATH=${prefix} \
+        -DVTK_USE_HYBRID:BOOL=ON \
+        -DVTK_WRAP_TCL:BOOL=ON \
+        -DTCL_INCLUDE_PATH=${prefix}/include \
+        -DTCL_LIBRARY=${prefix}/lib/libtcl.dylib \
+        -DTK_INCLUDE_PATH=${prefix}/include \
+        -DTK_LIBRARY=${prefix}/lib/libtk.dylib \
+        -DVTK_USE_CARBON:BOOL=OFF \
+        -DVTK_USE_COCOA:BOOL=ON \
+        -DVTK_DATA_ROOT:PATH=${prefix}/share/VTKData \
+        -DVTK_USE_GL2PS:BOOL=ON \
+        -DVTK_WRAP_PYTHON:BOOL=OFF
 
-configure.env	LDFLAGS="-L${prefix}/lib" \
-		CPPFLAGS="-I${prefix}/include"
+configure.env   \
+        LDFLAGS="-L${prefix}/lib" \
+        CPPFLAGS="-I${prefix}/include"
 
 post-configure {
-    reinplace "s|c++|c++ -L${prefix}/lib |"	\
+    reinplace "s|c++|c++ -L${prefix}/lib |" \
     ${worksrcpath}/Infovis/Testing/Cxx/CMakeFiles/InfovisCxxTests.dir/link.txt \
     ${worksrcpath}/IO/Testing/Cxx/CMakeFiles/IOCxxTests.dir/link.txt \
     ${worksrcpath}/Views/Testing/Cxx/CMakeFiles/ViewsCxxTests.dir/link.txt \
     ${worksrcpath}/Wrapping/Tcl/CMakeFiles/vtk.dir/link.txt
 }
 
+build.env-append DYLD_LIBRARY_PATH=${worksrcpath}/bin
+
 platform darwin 8 {
-	configure.env-append	CC=/usr/bin/gcc-4.0 CPP=/usr/bin/cpp-4.0 MACOSX_DEPLOYMENT_TARGET=10.4
+    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
+    configure.env-append    MACOSX_DEPLOYMENT_TARGET=10.5
 }
 
-variant x11 {
-	depends_build-append	port:xorg-libs
-	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=${x11prefix}/lib/libGL.dylib \
-				-DOPENGL_glu_LIBRARY:FILEPATH=${x11prefix}/lib/libGLU.dylib
+default_variants +x11 +python
+
+variant x11 description {use X11} {
+    depends_build-append    port:xorg-libs
+    configure.args-delete   -DVTK_USE_COCOA:BOOL=ON
+    configure.args-append   \
+        -DVTK_USE_COCOA:BOOL=OFF \
+        -DVTK_USE_X:BOOL=ON \
+        -DOPENGL_gl_LIBRARY:FILEPATH=${x11prefix}/lib/libGL.dylib \
+        -DOPENGL_glu_LIBRARY:FILEPATH=${x11prefix}/lib/libGLU.dylib
 }
 
 variant python description {builds python wrappers} {
-	depends_build-append	port:python25
-	configure.args-delete	-DVTK_WRAP_PYTHON:BOOL=OFF
-	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"}
+    depends_build-append    port:python25
+    configure.args-delete   \
+        -DVTK_WRAP_PYTHON:BOOL=OFF
+    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_INSTALL_NO_PYTHON:BOOL=ON
 }
 
-set vtkdest	${destroot}${prefix}/share/doc/${name}
+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}
+    if {[variant_isset python]} {
+        file mkdir ${destroot}${prefix}/lib/python2.5/site-packages
+        system "cd ${worksrcpath}/Wrapping/Python; ${prefix}/bin/python2.5 setup.py install --prefix=${prefix} --root=${destroot}"
+    }
 
-	# Must set RPATH on executables
+    xinstall -d -m 0755 ${vtkdest}
+    file copy ${worksrcpath}/README.html ${vtkdest}
+    file copy ${worksrcpath}/Copyright.txt ${vtkdest}
+    file copy ${worksrcpath}/Testing.txt ${vtkdest}
 
-	# 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 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"
+    # Provide data files
+    system "tar -C ${destroot}${prefix}/share -xzvf ${distpath}/vtkdata-${version}.tar.gz"
 }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20090315/067bb8aa/attachment.html>


More information about the macports-changes mailing list