[50870] trunk/dports/graphics/vtk-devel/Portfile

dweber at macports.org dweber at macports.org
Mon May 11 18:59:14 PDT 2009


Revision: 50870
          http://trac.macports.org/changeset/50870
Author:   dweber at macports.org
Date:     2009-05-11 18:59:13 -0700 (Mon, 11 May 2009)
Log Message:
-----------
bug-fix for py26 library path; currently working on database support

Modified Paths:
--------------
    trunk/dports/graphics/vtk-devel/Portfile

Modified: trunk/dports/graphics/vtk-devel/Portfile
===================================================================
--- trunk/dports/graphics/vtk-devel/Portfile	2009-05-12 01:57:43 UTC (rev 50869)
+++ trunk/dports/graphics/vtk-devel/Portfile	2009-05-12 01:59:13 UTC (rev 50870)
@@ -38,7 +38,7 @@
 build.type      gnu
 build.dir       ${workpath}/${distname}-build
 
-# Using this dummy stage to inspect MacPorts variables (using 'port -d fetch vtk-devel')
+# Using this dummy stage to inspect macport variables (using 'port -d fetch vtk-devel')
 #fetch { system "echo ${distfiles} && echo ${checksums}" }
 
 post-extract {
@@ -344,11 +344,11 @@
 
 # --- Language wrappers: java, python, tcl
 #
-# VTK has its own language parser, it doesn't depend on swig or cableswig (as
+# VTK has it's own language parser, it doesn't depend on swig or cableswig (as
 # of May 2009).  Since the VTK CVS repository and source distributions include
 # the output of byacc and flex, there is no need for a dependency on these
 # to build VTK.  If that were to change at some point, use byacc and not bison,
-# i.e.: depends_build-append port:byacc port:flex
+# ie: depends_build-append port:byacc port:flex
 
 
 variant java description {java wrapper} {
@@ -358,7 +358,7 @@
         -DVTK_WRAP_JAVA:BOOL=ON
     #
     # All of the following were detected automatically by cmake.  They use the
-    # system java framework.  To replace them with a MacPorts java, reset
+    # system java framework.  To replace them with a macports java, reset
     # these variables and add the required dependencies.
     #
     #JAVA_ARCHIVE:FILEPATH=/usr/bin/jar
@@ -376,7 +376,7 @@
 # that may require separate ports because the build and install process for vtk
 # can only work with one at a time.  The build is a lengthy process and there
 # may be no easy way to short-circuit it with a dependency on a prior binary
-# install of vtk.  If there are separate ports of vtk for different versions of
+# install of vtk.  If there are seperate ports of vtk for different versions of
 # python, each port will incur a lengthy build process.  Moreover, it's not
 # clear that the install process can be specifically selected for python only,
 # without also installing all of vtk.  For that reason, it may be best to avoid
@@ -387,6 +387,16 @@
 # py25 variant could disappear.  Likewise py26 could disappear if vtk works in
 # python 3.x
 
+# Note: currently vtkpython depends on libutil and finds it in:
+# // Utility library needed for vtkpython
+# PYTHON_UTIL_LIBRARY:FILEPATH=/usr/lib/libutil.dylib
+# I don't see a macport for libutil.  If one arises, it should become a
+# dependency for any python variant.
+#
+#// Extra libraries to link when linking to python (such as "z" for zlib).  Separate multiple libraries with semicolons.
+#PYTHON_EXTRA_LIBS:STRING=
+#
+
 variant py25 conflicts py26 requires shared description {python 2.5 wrapper} {
     set pyver        2.5
     set python       python${pyver}
@@ -444,7 +454,7 @@
     configure.args-append \
         -DVTK_WRAP_PYTHON:BOOL=ON \
         -DVTK_NO_PYTHON_THREADS:BOOL=OFF \
-        -DPYTHON_INCLUDE_PATH:FILEPATH=${prefix}/Library/Frameworks/Python.framework/Headers \
+        -DPYTHON_INCLUDE_PATH:FILEPATH=${prefix}/Library/Frameworks/Python.framework/Versions/${pyver}/Headers \
         -DPYTHON_LIBRARY:FILEPATH=${prefix}/lib/lib${python}.dylib \
         -DPYTHON_DEBUG_LIBRARY:FILEPATH=${prefix}/lib/lib${python}.dylib \
         -DPYTHON_EXECUTABLE:FILEPATH=${prefix}/bin/${python} \
@@ -518,35 +528,67 @@
 
 # --- Database variants
 
-#
-#variant mysql description {build the MySQL driver for vtkSQLDatabase} {
-#    depends_lib-append \
-#        port:mysql5
-#    configure.args-append \
-#        -DVTK_USE_MYSQL:BOOL=ON
-#        #MYSQL_INCLUDE_DIRECTORIES
-#        #MYSQL_LIBRARY
-#}
-#
-#
-#variant pgsql description {build the PostgreSQL driver for vtkSQLDatabase} {
-#    depends_lib-append \
-#        port:libpqxx
-#    configure.args-append \
-#        -DVTK_USE_POSTGRES:BOOL=ON
-#        #POSTGRES_INCLUDE_DIRECTORIES
-#        #POSTGRES_LIBRARIES
-#}
-#
-#
-#variant odbc description {build the ODBC database interface} {
-#    depends_lib-append \
-#        port:unixODBC
-#    configure.args-append \
-#        -DVTK_USE_ODBC:BOOL=ON
-#}
 
+variant mysql5 description {build the MySQL driver for vtkSQLDatabase} {
+    # Find the directory containing mysql.h
+    set includePath [exec ${prefix}/bin/mysql_config5 --include]
+    set includePath [exec ${prefix}/bin/mysql_config5 --include]
+    set includePath [string trim ${includePath} -I ]
+    #if [ exec find $includePath -name "mysql.h" ]
+    set libs [exec ${prefix}/bin/mysql_config5 --libs] 
+    set libIdx [lsearch -regex $libs "${prefix}/lib/mysql"]
+    set libPath [lindex $libs $libIdx]
+    set libPath [string trim ${libPath} -L ]
+    set libFile [exec find ${libPath} -name "libmysqlclient.dylib"]
+    depends_build-append \
+        path:bin/mysql_config5:mysql5
+    depends_lib-append \
+        port:mysql5 \
+        port:zlib
+    configure.args-append \
+        -DVTK_USE_MYSQL:BOOL=ON \
+        -DMYSQL_INCLUDE_DIRECTORIES:PATH=${includePath} \
+        -DMYSQL_LIBRARY:FILEPATH=${libFile} \
+        -DMYSQL_EXTRA_LIBRARIES:FILEPATH=${prefix}/lib/libz.dylib
+        # A URL for a MySQL server of the form
+        # mysql://[[username[:password]@]hostname[:port]]/[dbname]
+        #VTK_MYSQL_TEST_URL:STRING=
+}
 
+
+variant pgsql83 description {build the PostgreSQL 8.3 driver for vtkSQLDatabase} {
+    set pgconf [exec ${prefix}/lib/postgresql83/bin/pg_config ]
+    set includeIdx [lsearch -regex ${pgconf} "^INCLUDEDIR"]
+    set includePath [lindex ${pgconf} [expr ${includeIdx} + 2]]
+    set libIdx [lsearch -regex $pgconf "^LIBDIR"] 
+    set libPath [lindex $pgconf [expr $libIdx + 2]]
+    set libFile [exec find ${libPath} -name "libpq.dylib"]
+    depends_build-append \
+        path:lib/postgresql83/bin/pg_config:postgresql83
+    depends_lib-append \
+        port:postgresql83
+    configure.args-append \
+        -DVTK_USE_POSTGRES:BOOL=ON \
+        -DPOSTGRES_INCLUDE_DIRECTORIES:PATH=${includePath} \
+        -DPOSTGRES_LIBRARIES:FILEPATH=${libFile}
+        #// A URL for a PostgreSQL server of the form
+        #// psql://[[username[:password]@]hostname[:port]]/[dbname]
+        #VTK_PSQL_TEST_URL:STRING=
+}
+
+
+variant odbc description {build the ODBC database interface} {
+    depends_lib-append \
+        port:unixODBC
+    configure.args-append \
+        -DVTK_USE_ODBC:BOOL=ON \
+        -DODBC_INCLUDE_DIRECTORIES:PATH=/opt/local/include \
+        -DODBC_LIBRARY:FILEPATH=/opt/local/lib/libodbc.dylib
+        #// A data source name (DSN) for an ODBC database connection to use for testing.
+        #-DVTK_ODBC_TEST_DSN:STRING=
+}
+
+
 # --- Miscellaneous variants
 
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20090511/90171a15/attachment.html>


More information about the macports-changes mailing list