Index: files/patch-config-VIGRA_ADD_NUMPY_MODULE.cmake.diff
===================================================================
--- files/patch-config-VIGRA_ADD_NUMPY_MODULE.cmake.diff	(revision 0)
+++ files/patch-config-VIGRA_ADD_NUMPY_MODULE.cmake.diff	(revision 0)
@@ -0,0 +1,11 @@
+--- config/VIGRA_ADD_NUMPY_MODULE.cmake.orig	2011-01-26 10:26:08.000000000 -0500
++++ config/VIGRA_ADD_NUMPY_MODULE.cmake	2011-01-26 10:27:02.000000000 -0500
+@@ -78,7 +78,7 @@
+         SET_TARGET_PROPERTIES(${TARGET_NAME} PROPERTIES OUTPUT_NAME "${LIBRARY_NAME}" 
+                                                            PREFIX "" SUFFIX  ".pyd")
+     ELSEIF(MACOSX)
+-        SET_TARGET_PROPERTIES(${TARGET_NAME} PROPERTIES OUTPUT_NAME "${LIBRARY_NAME}" PREFIX "" SUFFIX ".so")
++        SET_TARGET_PROPERTIES(${TARGET_NAME} PROPERTIES OUTPUT_NAME "${LIBRARY_NAME}" PREFIX "" SUFFIX ".so" INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/${VIGRANUMPY_INSTALL_DIR}/vigra")
+     ELSE()
+         SET_TARGET_PROPERTIES(${TARGET_NAME} PROPERTIES OUTPUT_NAME "${LIBRARY_NAME}" 
+                                                            PREFIX "")
Index: Portfile
===================================================================
--- Portfile	(revision 75483)
+++ Portfile	(working copy)
@@ -1,3 +1,4 @@
+# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
 # $Id$
 
 PortSystem          1.0
@@ -3,6 +4,5 @@
 
 name                vigra
-version             1.6.0
-revision            4
+version             1.7.1
 categories          graphics
 platforms           darwin
@@ -16,32 +16,117 @@
                     those in the C++ Standard Template Library, you can \
                     easily adapt any VIGRA component to the needs of your \
                     application, without thereby giving up execution speed.
-homepage            http://kogs-www.informatik.uni-hamburg.de/~koethe/vigra/
+homepage            http://hci.iwr.uni-heidelberg.de/vigra/
 master_sites        ${homepage}
-distname            ${name}${version}
+distname            ${name}-${version}-src
 use_parallel_build  yes
-universal_variant   no
+#universal_variant   no
+worksrcdir          ${name}-${version}
 
-checksums           md5 d62650a6f908e85643e557a236ea989c \
-                    sha1 9714a0c4efb77726a1140329e98e5db057f9a69f \
-                    rmd160 cc9f6626801182a0ee71ec9eb8fa34c38f8777a7
+checksums           md5 2bde208e0fd7626770169dd4fa097282 \
+                    sha1 f90f54da31a6544057c25df7dbcc6954604de079 \
+                    rmd160 67a27b11f3d844b01fd8f2b0d2fe761099f8170b
 
 depends_lib         port:jpeg \
                     port:tiff \
                     port:libpng \
                     port:zlib \
                     port:fftw-3 \
-                    port:doxygen
+                    port:hdf5-18
 
-configure.args      --docdir=\\\${prefix}/share/doc/${name}-${version} \
-                    --with-jpeg \
-                    --with-tiff \
-                    --with-png \
-                    --with-zlib \
-                    --with-fftw
+# correct the INSTALL_NAME_DIR for Python .so modules
+patchfiles          patch-config-VIGRA_ADD_NUMPY_MODULE.cmake.diff
 
-destroot.destdir    prefix=${destroot}${prefix}
+configure.cmd       cmake
 
+configure.args      -DSKIP_BUILD_RPATH=TRUE \
+					-DCMAKE_VERBOSE_MAKEFILE=ON \
+                    -DCMAKE_BUILD_TYPE=Release \
+                    -DCMAKE_SYSTEM_PREFIX_PATH=\"${prefix}\;/usr\" \
+                    -DCMAKE_INSTALL_PREFIX=${prefix} \
+                    -DCMAKE_INSTALL_NAME_DIR=${prefix}/lib \
+                    -DCMAKE_INCLUDE_PATH=${prefix}/include \
+                    -DCMAKE_LIBRARY_PATH=${prefix}/lib \
+                    -DJPEG_INCLUDE_DIR=${prefix}/include \
+                    -DPNG_PNG_INCLUDE_DIR=${prefix}/include \
+                    -DTIFF_INCLUDE_DIR=${prefix}/include \
+                    -Wno-dev \
+                    -DBUILD_SHARED_LIBS=ON
+configure.post_args .
+
+destroot.env-append DESTDIR=${destroot}
+
+post-destroot {
+    # fix location of documentation to include version.
+    # remove documentation if no variant is set.
+    # for now since NumPy variant does not work, just
+    # move what can be moved and delete the rest.
+    if {[variant_isset docs]} {
+        # move documentation to a versioned directory
+        xinstall -m 755 -d ${destroot}${prefix}/share/doc
+        move ${destroot}${prefix}/doc/${name} \
+            ${destroot}${prefix}/share/doc/${name}-${version}
+    }
+    # delete whatever is left in the doc directory
+    delete ${destroot}${prefix}/doc
+}
+
+variant docs description "Build documentation" {}
+if {[variant_isset docs]} {
+    depends_lib-append port:doxygen
+} else {
+    configure.args-append \
+        -DBUILD_doc=OFF \
+        -DDOXYGEN_DOT_EXECUTABLE= \
+        -DDOXYGEN_DOT_PATH= \
+        -DDOXYGEN_EXECUTABLE=
+}
+
+variant valgrind description "Include support for VALGRIND" {}
+if {[variant_isset valgrind]} {
+    depends_lib-append port:valgrind
+} else {
+    configure.args-append -DWITH_VALGRIND=NO
+}
+
+set python_version ""
+# figure out if Boost::Python exists,
+# and if so what Python version
+set boost_python_lib [exec find /opt/local/lib \
+                              -name "lib*boost*python*mt*dylib" \
+                              -type f -maxdepth 1 | \
+                           awk "{ print \$1 }"]
+if {${boost_python_lib} != ""} {
+    set python_version [exec otool -L ${boost_python_lib} | \
+                            grep Python | awk "{ print \$1 }" | \
+                            sed -e "s@.*Versions/\\(.*\\)/Python@\\1@"]
+}
+
+if { ${python_version} == ""} {
+
+    # just disable NUMPY bindings via a CMake flag
+    configure.args-append -DWITH_VIGRANUMPY=NO
+
+} else {
+    # yes: allow for +numpy variant
+    variant numpy description \
+        "Include support for NUMPY (requires BOOST::Python)" {}
+
+    if {[variant_isset numpy]} {
+        # append cmake flags
+        configure.args-append \
+            -DPYTHON_EXECUTABLE=${prefix}/bin/python${python_version} \
+            -DPYTHON_SPHINX=${prefix}/bin/sphinx-build-${python_version}
+
+        # make sure dependencies are installed
+        set python_version_join [join [split ${python_version} "."] ""]
+        depends_lib-append port:boost \
+            port:python${python_version_join} \
+            port:py${python_version_join}-numpy \
+            port:py${python_version_join}-sphinx
+    }
+}
+
 livecheck.type      regex
 livecheck.url       ${homepage}
-livecheck.regex     ${name}(\[0-9.\]+)\\.tar
+livecheck.regex     ${name}-(\[0-9.\]+)-src\\.tar
