Ticket #14426: Portfile

File Portfile, 4.1 KB (added by ajb78@…, 16 years ago)

Update to fix python library issues (from fink)

Line 
1# $Id: Portfile 31356 2007-11-21 03:46:08Z ryandesign@macports.org $
2
3PortSystem 1.0
4
5name            vtk5
6version         5.0.4
7categories      graphics devel
8maintainers     rene.donner@mac.com
9description     3D visualization toolkit
10long_description        an open source, freely available software system  \
11        for 3D computer graphics, image processing, and visualization     \
12        used by thousands of researchers and developers around the world. \
13        VTK consists of a C++ class library, and several interpreted      \
14        interface layers including Tcl/Tk, Java, and Python.
15
16homepage        http://www.vtk.org/
17platforms       darwin freebsd
18master_sites    http://www.vtk.org/files/release/5.0/
19checksums       vtk-${version}.tar.gz md5 1e353886bbd6559633e31436d88a1f03 \
20                vtkdata-${version}.tar.gz md5 95dced81c2c16687dc4e571a3d82092c
21
22
23depends_build   bin:cmake:cmake port:tcl
24distfiles       vtk-${version}.tar.gz \
25                vtkdata-${version}.tar.gz
26distname        VTK
27
28#post-extract {
29#    set fl [open "| grep VTK_BUILD_VERSION ${worksrcpath}/CMakeLists.txt | grep 6"]
30#    set data [read $fl]
31#    close $fl
32#    if {$data != "SET(VTK_BUILD_VERSION 6)\n"} { ui_msg "$data
33#================================================================
34#Warning : the Latest VTK version is not the same as the Portfile
35#The build may still succeed but this should be reported as a bug
36#================================================================"
37#    }
38#}
39
40patchfiles      patch-Rendering-vtkCocoaRenderWindow.mm \
41            vtk-5.0-install.patch
42
43configure       { system "cd ${worksrcpath} && ${configure.env} cmake ${configure.args} ${worksrcpath}" }
44configure.args  -DBUILD_SHARED_LIBS:BOOL=ON \
45                -DCMAKE_LIBRARY_PATH:PATH=${prefix}/lib \
46                -DCMAKE_INCLUDE_PATH:PATH=${prefix}/include \
47                -DCMAKE_INSTALL_PREFIX:PATH=${prefix} \
48                -DCMAKE_INSTALL_NAME_DIR:STRING=${prefix}/lib \
49        -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=ON \
50        -DVTK_USE_RPATH=ON \
51                -DCMAKE_EXE_LINKER_FLAGS:STRING=-rpath ${prefix}/lib \
52                -DVTK_INSTALL_PREFIX:PATH=${prefix} \
53                -DVTK_USE_HYBRID:BOOL=ON \
54                -DVTK_USE_CARBON:BOOL=OFF \
55                -DVTK_WRAP_TCL:BOOL=ON \
56                -DVTK_USE_COCOA:BOOL=ON \
57                -DVTK_DATA_ROOT:PATH=${prefix}/share/VTKData \
58        -DTCL_INCLUDE_PATH:PATH=${prefix}/include \
59                -DVTK_TCL_LIBRARY_DIR:FILEPATH=${prefix}/lib/tcl8.5 \
60        -DVTK_USE_PARALLEL:BOOL=ON \
61        -DVTK_USE_PARALLEL:BOOL=ON
62
63configure.env   LDFLAGS="-L${prefix}/lib" \
64                CPPFLAGS="-I${prefix}/include"
65
66platform darwin 8 {
67        configure.env-append    CC=/usr/bin/gcc-4.0 CPP=/usr/bin/cpp-4.0 MACOSX_DEPLOYMENT_TARGET=10.4
68}
69
70platform darwin 9 {
71        configure.env-append    MACOSX_DEPLOYMENT_TARGET=10.5
72}
73
74variant x11 {
75        depends_build-append    lib:libX11:XFree86
76        configure.args-delete   "-DVTK_USE_COCOA:BOOL=ON"
77        configure.args-append   -DVTK_USE_COCOA:BOOL=OFF \
78                                -DVTK_USE_X:BOOL=ON \
79                                -DOPENGL_gl_LIBRARY:FILEPATH=/usr/X11R6/lib/libGL.dylib \
80                                -DOPENGL_glu_LIBRARY:FILEPATH=/usr/X11R6/lib/libGLU.dylib
81}
82
83variant python {
84        depends_build-append    port:python25
85        configure.args-append   -DPYTHON_DEBUG_LIBRARY:FILEPATH=${prefix}/lib/libpython2.5.dylib \
86                                -DPYTHON_EXECUTABLE:FILEPATH=${prefix}/bin/python2.5 \
87                                -DPYTHON_INCLUDE_PATH:FILEPATH=${prefix}/include/python2.5 \
88                                -DPYTHON_LIBRARY:FILEPATH=${prefix}/lib/libpython2.5.dylib \
89                                -DVTK_WRAP_PYTHON:BOOL=ON
90        pre-configure {
91            system "echo \"VTK_PYTHON_SETUP_ARGS:STRING=--prefix=${prefix} --root=${destroot}\" >> CMakeCache.txt"
92        }
93}
94
95set vtkdest     ${destroot}${prefix}/share/doc/${name}
96
97post-destroot {
98        xinstall -d -m 0755 ${vtkdest}
99        file copy ${worksrcpath}/README.html ${vtkdest}
100        file copy ${worksrcpath}/Copyright.txt ${vtkdest}
101        file copy ${worksrcpath}/Testing.txt ${vtkdest}
102
103        # Must set RPATH on executables
104
105        # Provide some examples
106        file copy ${worksrcpath}/Examples ${vtkdest}
107        foreach x {CommonCxxTests FilteringCxxTests GenericFilteringCxxTests GraphicsCxxTests IOCxxTests} { file copy ${worksrcpath}/bin/$x ${vtkdest}/Examples }
108        foreach x {ImagingCxxTests RenderingCxxTests TestCxxFeatures TestInstantiator VTKBenchMark VolumeRenderingCxxTests WidgetsCxxTests} { file copy ${worksrcpath}/bin/$x ${vtkdest}/Examples }
109
110        # Provide data files
111        system "tar -C ${destroot}${prefix}/share -xzvf ${distpath}/vtkdata-${version}.tar.gz"
112}