Index: Portfile
===================================================================
--- Portfile	(revision 153825)
+++ Portfile	(working copy)
@@ -5,8 +5,7 @@
 PortGroup           github 1.0
 PortGroup           gobject_introspection 1.0
 
-github.setup        engla keybinder 0.3.0 v
-revision            1
+github.setup        engla keybinder 0.3.1 v
 categories          gnome devel
 platforms           darwin
 maintainers         ryandesign openmaintainer
@@ -15,22 +14,28 @@
 description         library for global keyboard shortcuts in GTK applications
 
 long_description    ${name} is a library for registering global keyboard \
-                    shortcuts in GTK-based applications using the X Window \
+                    shortcuts in GTK2-based applications using the X Window \
                     System.
 
-master_sites        http://kaizer.se/publicfiles/keybinder/
+checksums           rmd160  5540b349f193c49413e5e443c40dec2291a715c9 \
+                    sha256  3c4636965a228902ef70fb8df34e3cc11036b82c2c3be45819d0780f34345b7b
 
-checksums           rmd160  2f2e25860fa116f7872bbdb2850b75e3e43958cf \
-                    sha256  42863ca0174d568a8c02c6fb243fee1681823825e8bcb1718c51611d8e9793bb
+depends_build       port:pkgconfig \
+                    port:autoconf \
+                    port:automake \
+                    port:libtool \
+                    port:gnome-common \
+                    port:gtk-doc
 
-depends_build       port:pkgconfig
-
 depends_lib         port:gtk2
 
-patchfiles          patch_python-keybinder_Makefile.in.diff
+patchfiles          patch-configure.ac.diff \
+                    patch_python-keybinder_Makefile.am.diff
 
+configure.cmd       ./autogen.sh
+
 configure.args      --disable-silent-rules \
-                    --disable-gtk-doc \
+                    --enable-gtk-doc \
                     --disable-lua
 
 if {${name} eq ${subport}} {
@@ -38,7 +43,7 @@
     gobject_introspection yes
 }
 
-set python.versions {26 27}
+set python.versions {27}
  
 foreach v ${python.versions} {
     set python.version  ${v}
@@ -49,10 +54,11 @@
     subport py${python.version}-keybinder {
         depends_lib-append      port:${name} \
                                 port:python${python.version} \
+                                port:py${python.version}-gobject \
                                 port:py${python.version}-pygtk
 
         configure.args-append   --enable-python \
-                                ac_cv_path_PYGTK_CODEGEN=${prefix}/bin/pygtk-codegen-2.0-${python.branch}
+                                PYGOBJECT_CODEGEN=${python.prefix}/bin/pygtk-codegen-2.0
 
         configure.python        ${python.bin}
         configure.pkg_config_path   ${python.prefix}/lib/pkgconfig
Index: files/patch-configure.ac.diff
===================================================================
--- files/patch-configure.ac.diff	(nonexistent)
+++ files/patch-configure.ac.diff	(working copy)
@@ -0,0 +1,32 @@
+--- configure.ac.orig	2016-10-12 11:42:01.000000000 -0700
++++ configure.ac	2016-10-12 11:47:28.000000000 -0700
+@@ -21,7 +21,9 @@
+ AC_SUBST(LT_REVISION)
+ AC_SUBST(LT_AGE)
+ 
+-GNOME_COMMON_INIT
++dnl long deprecated GNOME_COMMON_INIT removed in gnome-common 3.18.0
++dnl https://git.gnome.org/browse/gnome-common/commit/?id=6684e2fa5d5a4c72c9bf116f74688c0b47f350cf
++dnl GNOME_COMMON_INIT
+ 
+ AM_MAINTAINER_MODE
+ AM_DISABLE_STATIC
+@@ -115,6 +117,18 @@
+ 	dnl ****************************************************************************
+ 	have_python="yes"
+ 	AM_PATH_PYTHON(2.5)
++
++	dnl Override standard python locations with MacPorts version specific ones
++
++	AC_SUBST([PYTHON_PREFIX], [`$PYTHON -c 'import sys; print(sys.prefix);'`])
++	AC_SUBST([PYTHON_EXEC_PREFIX], [`$PYTHON -c 'import sys; print(sys.exec_prefix)'`])
++
++	am_cv_python_pythondir=$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages
++	am_cv_python_pyexecdir=$PYTHON_EXEC_PREFIX/lib/python$PYTHON_VERSION/site-packages
++
++	AC_SUBST([pythondir], [$am_cv_python_pythondir])
++	AC_SUBST([pyexecdir], [$am_cv_python_pyexecdir])
++
+ 	AM_CHECK_PYTHON_HEADERS(,[AC_MSG_ERROR(could not find Python headers)])
+ 
+ 	PKG_CHECK_MODULES(PYGTK,
Index: files/patch_python-keybinder_Makefile.am.diff
===================================================================
--- files/patch_python-keybinder_Makefile.am.diff	(nonexistent)
+++ files/patch_python-keybinder_Makefile.am.diff	(working copy)
@@ -0,0 +1,11 @@
+--- python-keybinder/Makefile.am.orig	2015-11-06 07:08:46.000000000 -0800
++++ python-keybinder/Makefile.am	2016-10-12 08:08:43.000000000 -0700
+@@ -6,7 +6,7 @@
+ _keybinder_LTLIBRARIES = _keybinder.la
+ _keybinder_la_CPPFLAGS = $(AM_CPPFLAGS) $(X_CFLAGS) $(PYEXTRAFLAGS)
+ _keybinder_la_LDFLAGS = -module -avoid-version -export-symbols-regex init_keybinder $(X_LDFLAGS)
+-_keybinder_la_LIBADD = ../libkeybinder/libkeybinder.la $(PYGTK_LIBS)
++_keybinder_la_LIBADD = $(LIBDIR)/libkeybinder.dylib $(PYGTK_LIBS)
+ _keybinder_la_SOURCES = _keybindermodule.c
+ 
+ nodist__keybinder_la_SOURCES = _keybinder.c
Index: files/patch_python-keybinder_Makefile.in.diff
===================================================================
--- files/patch_python-keybinder_Makefile.in.diff	(revision 153825)
+++ files/patch_python-keybinder_Makefile.in.diff	(nonexistent)
@@ -1,20 +0,0 @@
---- python-keybinder/Makefile.in.orig	2012-06-17 11:25:51.000000000 -0500
-+++ python-keybinder/Makefile.in	2013-12-09 09:34:22.000000000 -0600
-@@ -97,7 +97,7 @@
- 	"$(DESTDIR)$(_keybinderdir)"
- LTLIBRARIES = $(_keybinder_LTLIBRARIES)
- am__DEPENDENCIES_1 =
--_keybinder_la_DEPENDENCIES = ../libkeybinder/libkeybinder.la \
-+_keybinder_la_DEPENDENCIES = $(LIBDIR)/libkeybinder.dylib \
- 	$(am__DEPENDENCIES_1)
- am__keybinder_la_OBJECTS = _keybinder_la-_keybindermodule.lo
- nodist__keybinder_la_OBJECTS = _keybinder_la-_keybinder.lo
-@@ -314,7 +314,7 @@
- _keybinder_LTLIBRARIES = _keybinder.la
- _keybinder_la_CPPFLAGS = $(X_CFLAGS) $(PYEXTRAFLAGS)
- _keybinder_la_LDFLAGS = -module -avoid-version -export-symbols-regex init_keybinder $(X_LDFLAGS)
--_keybinder_la_LIBADD = ../libkeybinder/libkeybinder.la $(PYGTK_LIBS)
-+_keybinder_la_LIBADD = $(LIBDIR)/libkeybinder.dylib $(PYGTK_LIBS)
- _keybinder_la_SOURCES = _keybindermodule.c
- nodist__keybinder_la_SOURCES = _keybinder.c
- _keybinder_PYTHON = \
