--- Portfile.orig	2016-03-02 15:28:57.000000000 -0500
+++ Portfile	2016-03-02 15:58:03.000000000 -0500
@@ -5,7 +5,7 @@
 PortGroup python    1.0
 
 name                py-pmw
-version             1.3.3a
+version             2.0.0
 maintainers         nomaintainer
 platforms           darwin
 license             MIT
@@ -16,16 +16,22 @@
 
 homepage            http://pmw.sourceforge.net/
 master_sites        sourceforge:pmw
-distname            Pmw_[string map {. _} ${version}]
+distname            Pmw-${version}
 
-checksums           rmd160  8646f857f20615671422d6275ed2b8126cc1d0ea \
-                    sha256  46abf4f0ac3c51e3b65e350543e08bb92f4ac93bd47d23e3d072bc9d5f7a815b
+patchfiles          pmw2.diff
+patch.pre_args      -p1
+
+checksums           rmd160  2a76186192f13eb22c373b3e0e60ce65cba506fe \
+                    sha256  2babb2855feaabeea1003c6908b61c9d39cff606d418685f0559952714c680bb
 
 supported_archs     noarch
 
-python.versions     27
+python.versions     27 34 35
 
-worksrcdir          Pmw
+post-patch {
+	reinplace "s|format|fmt|g" ${worksrcpath}/Pmw/Pmw_2_0_0/demos/Counter.py
+	system "cd ${worksrcpath}; /usr/bin/find . -type f -name '*.py' -print0 | xargs -0 perl -pi -e 's|/usr/bin/env python|${prefix}/bin/python${python.branch}|g'"
+	}
 
 if {${name} ne ${subport}} {
     depends_lib-append  port:py${python.version}-tkinter
