--- Portfile.orig	2011-08-06 22:30:20.000000000 +0200
+++ Portfile	2011-09-26 20:17:39.000000000 +0200
@@ -4,8 +4,8 @@
 PortSystem          1.0
 
 name                gtkpod
-version             1.0.0
-revision            3
+version             2.0.2
+revision            0
 categories          multimedia gnome
 platforms           darwin
 maintainers         rmstonecipher openmaintainer
@@ -13,12 +13,12 @@
 long_description    ${description} It supports the first to fifth Generation including the iPod mini, iPod Photo, iPod Shuffle, iPod nano, and iPod Video.
 homepage            http://www.gtkpod.org/
 master_sites        sourceforge:gtkpod
-checksums           md5     cadd402dcd1cfbedda0357bf24965a7c \
-                    sha1    77b768663458069a414c59b7aad285020c93a035 \
-                    rmd160  271e9aeb25493b89933f203ebce4c004ce0da573
+checksums           rmd160  0810947c013c137f57599a999f63d07d6710b6c7 \
+                    sha256  2c5dd3d193cd73ba107ccb158e48198768f1dd26724834f8f5ab804281ea4648
 depends_build       port:pkgconfig \
                     port:intltool
 depends_lib         port:autoconf \
+                    port:anjuta \
                     port:flex \
                     path:lib/pkgconfig/glib-2.0.pc:glib2 \
                     port:libglade2 \
@@ -26,27 +26,61 @@
                     port:libid3tag \
                     port:mp4v2
 
+use_autoreconf      yes
+
 # python-related tweaks 
-set python.branch   2.7
-set python.prefix   ${frameworks_dir}/Python.framework/Versions/${python.branch}
-set python.bin      ${python.prefix}/bin/python${python.branch}
-configure.args-append  --prefix=${python.prefix}
-configure.env-append    PYGOBJECT_CODEGEN=${python.prefix}/bin/pygobject-codegen-2.0
-configure.pkg_config_path  ${python.prefix}/lib/pkgconfig
-options         python.link_binaries python.link_binaries_suffix
-default python.link_binaries yes
-default python.link_binaries_suffix {-${python.branch}}
-post-destroot {
-    if {${python.link_binaries}} {
-        foreach bin [glob -nocomplain -tails -directory "${destroot}${python.prefix}/bin" *] {
-            if {[catch {file type "${destroot}${prefix}/bin/${bin}${python.link_binaries_suffix}"}]} {
-                ln -s "${python.prefix}/bin/${bin}" "${destroot}${prefix}/bin/${bin}${python.link_binaries_suffix}"
+if {![variant_isset python27] && ![variant_isset python26]} {
+    default_variants +python27
+}
+variant python27 conflicts python26 description {Build using Python 2.7} {
+    global python.branch python.prefix
+    set python.branch   2.7
+    depends_lib-append  port:python27
+    set python.prefix   ${frameworks_dir}/Python.framework/Versions/${python.branch}
+    set python.bin      ${python.prefix}/bin/python${python.branch}
+    configure.args-append  --prefix=${python.prefix}
+    configure.env-append    PYGOBJECT_CODEGEN=${python.prefix}/bin/pygobject-codegen-2.0
+    configure.pkg_config_path  ${python.prefix}/lib/pkgconfig
+    options         python.link_binaries python.link_binaries_suffix
+    default python.link_binaries yes
+    default python.link_binaries_suffix {-${python.branch}}
+    post-destroot {
+        if {${python.link_binaries}} {
+            foreach bin [glob -nocomplain -tails -directory "${destroot}${python.prefix}/bin" *] {
+                if {[catch {file type "${destroot}${prefix}/bin/${bin}${python.link_binaries_suffix}"}]} {
+                    ln -s "${python.prefix}/bin/${bin}" "${destroot}${prefix}/bin/${bin}${python.link_binaries_suffix}"
+                }
+            }
+        }
+    }
+}
+
+variant python26 conflicts python27 description {Build using Python 2.6} {
+    global python.branch python.prefix
+    set python.branch   2.6
+    depends_lib-append  port:python26
+    set python.prefix   ${frameworks_dir}/Python.framework/Versions/${python.branch}
+    set python.bin      ${python.prefix}/bin/python${python.branch}
+    configure.args-append  --prefix=${python.prefix}
+    configure.env-append    PYGOBJECT_CODEGEN=${python.prefix}/bin/pygobject-codegen-2.0
+    configure.pkg_config_path  ${python.prefix}/lib/pkgconfig
+    options         python.link_binaries python.link_binaries_suffix
+    default python.link_binaries yes
+    default python.link_binaries_suffix {-${python.branch}}
+    post-destroot {
+        if {${python.link_binaries}} {
+            foreach bin [glob -nocomplain -tails -directory "${destroot}${python.prefix}/bin" *] {
+                if {[catch {file type "${destroot}${prefix}/bin/${bin}${python.link_binaries_suffix}"}]} {
+                    ln -s "${python.prefix}/bin/${bin}" "${destroot}${prefix}/bin/${bin}${python.link_binaries_suffix}"
+                }
             }
         }
     }
 }
 
-patchfiles          patch-src-mp4file.c.diff
+patchfiles          patch-configure.ac.diff \
+                    patch-use_extern.diff \
+                    patch-mp4file.c.diff
 
 livecheck.type      regex
 livecheck.url       http://sourceforge.net/projects/gtkpod/files/gtkpod/
