--- /opt/local/var/macports/sources/svn.macports.org/trunk/dports/graphics/poppler/Portfile	2016-03-11 11:37:37.000000000 +0100
+++ /opt/local/site-ports/graphics/poppler/Portfile	2016-03-11 12:58:21.000000000 +0100
@@ -1,5 +1,5 @@
 # -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:filetype=tcl:et:sw=4:ts=4:sts=4
-# $Id: Portfile 145844 2016-02-18 23:56:08Z devans@macports.org $
+# $Id: Portfile 133752 2015-03-10 20:34:42Z devans@macports.org $
 
 PortSystem          1.0
 PortGroup           compiler_blacklist_versions 1.0
@@ -40,7 +40,8 @@
                     port:openjpeg15 \
                     port:poppler-data \
                     port:tiff \
-                    port:zlib
+                    port:zlib \
+                    port:curl
 
 gobject_introspection yes
 
@@ -65,15 +66,21 @@
 }
 
 # TODO:
-# add subport poppler-qt4-x11 when qt4-x11 builds and port group qt4 allows
-# add subport poppler-qt5-mac when various qt5 build issues are resolved (#47025)
+# add subport for poppler-qt4-x11 when qt4-x11 builds and port group qt4 allows
 
 subport poppler-qt4-mac {
     PortGroup qt4 1.0
-
+    configure.env-append    MOCQT4=${qt_bins_dir}/moc
     configure.args-delete   --disable-poppler-qt4
 }
 
+subport poppler-qt5-mac {
+    PortGroup qt5 1.0
+
+    configure.env-append    MOCQT5=${qt_bins_dir}/moc
+    configure.args-delete   --disable-poppler-qt5
+}
+
 if {${subport} ne ${name}} {
     depends_extract-append  port:git
 
@@ -82,14 +89,14 @@
     post-extract {
         system -W ${workpath} "${prefix}/bin/git clone --depth=1 http://anongit.freedesktop.org/git/poppler/test"
     }
-    
+
     configure.args-append   --disable-cairo-output \
                             --disable-poppler-glib \
                             --disable-poppler-cpp \
                             --disable-utils
 
 # currently poppler only provides unit tests for the Qt wrappers
-    
+
     test.run    yes
     test.target check
 
@@ -97,13 +104,12 @@
         foreach dot_h [glob -nocomplain -directory ${destroot}${prefix}/include/poppler *.h] {
             delete $dot_h
         }
+        foreach l [glob -nocomplain ${destroot}${prefix}/lib/libpoppler.*] {
+            delete ${l}
+        }
         delete  ${destroot}${prefix}/include/poppler/fofi \
                 ${destroot}${prefix}/include/poppler/goo \
                 ${destroot}${prefix}/include/poppler/splash \
-                ${destroot}${prefix}/lib/libpoppler.58.dylib \
-                ${destroot}${prefix}/lib/libpoppler.a \
-                ${destroot}${prefix}/lib/libpoppler.dylib \
-                ${destroot}${prefix}/lib/libpoppler.la \
                 ${destroot}${prefix}/lib/pkgconfig/poppler-splash.pc \
                 ${destroot}${prefix}/lib/pkgconfig/poppler.pc
     }
