Index: Portfile
===================================================================
--- Portfile	(revision 75331)
+++ 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,147 @@
                     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:fftw-3
 
-configure.args      --docdir=\\\${prefix}/share/doc/${name}-${version} \
-                    --with-jpeg \
-                    --with-tiff \
-                    --with-png \
-                    --with-zlib \
-                    --with-fftw
+configure.cmd       cmake
+configure.args      -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON \
+                    -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.destdir    prefix=${destroot}${prefix}
+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 hdf5 description {Include support for HDF5} {}
+# set default variant
+if {![variant_isset hdf5]} {
+   default_variants +hdf5
+}
+# see if user specified -hdf5
+if {[variant_isset hdf5]} {
+   depends_lib-append port:hdf5-18
+} else {
+   configure.args-append -DWITH_HDF5=NO
+}
+
+variant valgrind description {Include support for VALGRIND} {}
+# set default variant
+if {![variant_isset valgrind]} {
+   default_variants +valgrind
+}
+# see if user specified -valgrind
+if {[variant_isset valgrind]} {
+   depends_lib-append port:valgrind
+} else {
+   configure.args-append -DWITH_VALGRIND=NO
+}
+
+variant python25 conflicts python26 python27 \
+description "Use Python 2.5" {}
+
+variant python26 conflicts python25 python27 \
+description "Use Python 2.6" {}
+
+variant python27 conflicts python25 python26 \
+description "Use Python 2.7" {}
+
+# set default variant, if no others set
+if { ![variant_isset python25] && \
+     ![variant_isset python26] && \
+     ![variant_isset python27] } {
+     default_variants +python26
+}
+
+# check to make sure -some- Python variant is active
+if { ![variant_isset python25] && \
+     ![variant_isset python26] && \
+     ![variant_isset python27] } {
+     ui_error "${name} requires some variant of Python."
+}
+
+set python_version ""
+if {[variant_isset python25]} {
+   set python_version "2.5"
+} elseif {[variant_isset python26]} {
+   set python_version "2.6"
+} elseif {[variant_isset python27]} {
+   set python_version "2.7"
+}
+
+configure.args-append -DPYTHON_EXECUTABLE=${prefix}/bin/python${python_version}
+
+#  -DPYTHON_INCLUDE_DIR=${frameworks_dir}/Python.framework/Headers
+
+set python_version_join [join [split ${python_version} "."] ""]
+depends_lib-append port:python${python_version_join}
+
+# disable NUMPY -- requires Boost::Python.
+configure.args-append -DWITH_VIGRANUMPY=NO
+
+# variant numpy description {Include support for NUMPY} {}
+# set default variant
+# if {![variant_isset numpy]} {
+#   default_variants +numpy
+#}
+# see if user specified -numpy
+#if {[variant_isset numpy]} {
+#   depends_lib-append port:py${python_version_join}-numpy
+#   		      port:py${python_version_join}-sphinx
+#} else {
+#   configure.args-append -DWITH_VIGRANUMPY=NO
+#}
+
 livecheck.type      regex
 livecheck.url       ${homepage}
-livecheck.regex     ${name}(\[0-9.\]+)\\.tar
+livecheck.regex     ${name}-(\[0-9.\]+)-src\\.tar
