--- prod/net/wireshark-devel/Portfile	2015-08-07 23:31:13.000000000 -0400
+++ stable/net/wireshark-devel/Portfile	2015-08-09 11:55:15.000000000 -0400
@@ -1,19 +1,19 @@
 # -*- 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: Portfile 139229 2015-08-08 03:10:35Z jeremyhu@macports.org $
+# $Id: Portfile 131578 2015-01-15 00:14:59Z larryv@macports.org $
 
 PortSystem 1.0
 
 name            wireshark-devel
 epoch           2
-version         1.9.0
-revision        4
-patchfiles      patch-configure.diff
+version         1.99.8
+revision        0
 categories      net
 license         {GPL-2 GPL-3}
 maintainers     gmail.com:hsivank
 description     Graphical network analyzer and capture tool
 homepage        http://wireshark.org/
 platforms       darwin
+
 distname        wireshark-${version}
 dist_subdir     wireshark
 
@@ -25,133 +25,200 @@
 master_sites    http://www.wireshark.org/download/src/ \
                 http://www.wireshark.org/download/src/all-versions/
 
-use_bzip2       yes
-
-checksums       rmd160  56f62e9a1bc2dfedcbd1856dd06c42869a2cdde2 \
-                sha256  0a21aa84e78de2ae2f758e5f21edf2ec5c26a372fbfbb30a53a9b67a128e4538
+checksums       md5     1d15377bfc363e46cd7acf479c989075 \
+                sha1    b4eb673f580c0e2f0e9f2a834c3df2e973cce991 \
+                rmd160  06100e0e858bbfea74f5badac8b354b79dd347f2
 
-conflicts       wireshark
+use_bzip2       yes
 
-depends_build   port:pkgconfig
+conflicts       wireshark-devel
 
-depends_lib     port:c-ares \
-                path:lib/pkgconfig/glib-2.0.pc:glib2 \
-                port:gtk2 \
-                path:lib/libssl.dylib:openssl \
-                port:libpcap \
-                port:kerberos5 \
-                port:zlib
+depends_build       \
+        port:pkgconfig
+depends_lib         \
+        port:c-ares \
+        port:gettext \
+        port:libcomerr \
+        port:libgpg-error \
+        path:lib/pkgconfig/glib-2.0.pc:glib2 \
+        port:libpcap \
+        port:zlib
 
 configure.args  \
-                --disable-usr-local \
-                --without-adns \
-                --with-c-ares=${prefix} \
-                --without-pcre \
-                --disable-ipv6 \
-                --with-pcap=${prefix} \
-                --with-ssl=${prefix} \
-                --with-zlib=${prefix} \
-                --mandir=\\\${prefix}/share/man \
-                --infodir=\\\${prefix}/share/info \
-                --without-portaudio \
-                --disable-warnings-as-errors \
-                --with-krb5=${prefix} \
-                --without-gnutls \
-                --without-python
+        --disable-usr-local \
+        --disable-warnings-as-errors \
+        --without-adns \
+        --with-c-ares=${prefix} \
+        --without-geoip \
+        --without-gnutls \
+        --with-gcrypt=no \
+        --without-libsmi \
+        --without-lua \
+        --disable-ipv6 \
+        --with-pcap=${prefix} \
+        --with-zlib=${prefix} \
+        --mandir=\\\${prefix}/share/man \
+        --infodir=\\\${prefix}/share/info \
+        --without-portaudio \
+        --without-krb5 \
+        --without-ssl \
+        --disable-wireshark
+
 
 configure.ldflags-append "-Wl,-search_paths_first"
 
-variant adns description {use adns library for async. dns resolution instead of the default c-ares library} {
-        configure.args-delete   --without-adns \
-                                --with-c-ares=${prefix}
-        configure.args-append   --with-adns=${prefix} \
-                                --without-c-ares
-        depends_lib-delete      port:c-ares
-        depends_lib-append      port:adns
-}
+default_variants +gnutls +libgcrypt +ipv6 +krb5 +lua +libsmi +geoip +rtp +ssl
 
-variant gnutls {
-        configure.args-append   --with-gnutls=yes
-        depends_lib-append      port:gnutls
+if {![variant_isset qt] && ![variant_isset x11] && ![variant_isset gtk3]} {
+    default_variants    +qt5
 }
 
-variant libgcrypt {
-        configure.args-append   --with-libgcrypt-prefix=${prefix}
-        depends_lib-append      port:libgcrypt
+pre-destroot {
+    xinstall -d ${destroot}${prefix}/include/wireshark/epan/crypt/
+    xinstall -d ${destroot}${prefix}/include/wireshark/epan/dfilter/
+    xinstall -d ${destroot}${prefix}/include/wireshark/epan/dissectors/
+    xinstall -d ${destroot}${prefix}/include/wireshark/epan/ftypes/
+    xinstall -d ${destroot}${prefix}/include/wireshark/wiretap/
+    xinstall -m 644 -W ${worksrcpath}/ color.h config.h register.h ${destroot}${prefix}/include/wireshark/
+    xinstall -m 644 {*}[glob ${worksrcpath}/epan/*.h] ${destroot}${prefix}/include/wireshark/epan/
+    xinstall -m 644 {*}[glob ${worksrcpath}/epan/crypt/*.h] ${destroot}${prefix}/include/wireshark/epan/crypt/
+    xinstall -m 644 {*}[glob ${worksrcpath}/epan/dfilter/*.h] ${destroot}${prefix}/include/wireshark/epan/dfilter/
+    xinstall -m 644 {*}[glob ${worksrcpath}/epan/dissectors/*.h] ${destroot}${prefix}/include/wireshark/epan/dissectors/
+    xinstall -m 644 {*}[glob ${worksrcpath}/epan/ftypes/*.h] ${destroot}${prefix}/include/wireshark/epan/ftypes/
+    xinstall -m 644 {*}[glob ${worksrcpath}/wiretap/*.h] ${destroot}${prefix}/include/wireshark/wiretap/
+}
+
+if {[string match *llvm-gcc-4.2* ${configure.compiler}]} {
+    # see #32386
+    configure.cflags -fno-var-tracking
 }
 
-variant ipv6 {
-        configure.args-append   --enable-ipv6
-        configure.args-delete   --disable-ipv6
+variant adns description {use adns library for async. dns resolution instead of the default c-ares library} {
+    configure.args-delete   --without-adns \
+                            --with-c-ares=${prefix}
+    configure.args-append   --with-adns=${prefix} \
+                            --without-c-ares
+    depends_lib-append  port:adns
+    depends_lib-delete  port:c-ares
 }
 
-variant lua {
-        configure.args-append   --with-lua=${prefix}
-        depends_lib-append      port:lua
+variant gnutls {
+    configure.args-delete   --without-gnutls
+    configure.args-append   --with-gnutls=yes
+    depends_lib-append      port:gnutls
 }
 
-variant pcre {
-        configure.args-append   --with-pcre=${prefix}
-        configure.args-delete   --without-pcre
-        depends_lib-append      port:pcre
+variant krb5 {
+    configure.args-delete   --without-krb5
+    configure.args-append   --with-krb5=${prefix}
+    depends_lib-append      port:kerberos5
 }
 
-variant rtp description {add rtp support with portaudio} {
-        configure.args-append   --with-portaudio=${prefix}
-        configure.args-delete   --without-portaudio
-        depends_lib-append      port:portaudio
+variant libgcrypt {
+    configure.args-delete   --with-gcrypt=no
+    configure.args-append   --with-libgcrypt-prefix=${prefix}
+    depends_lib-append      port:libgcrypt
 }
 
-variant no_ssl {
-        configure.args-append --without-ssl
-        depends_lib-delete      path:lib/libssl.dylib:openssl
+variant ipv6 {
+    configure.args-delete   --disable-ipv6
+    configure.args-append   --enable-ipv6
 }
 
-variant no_gui description {Disable GTK GUI} {
-        depends_lib-delete      port:gtk2
-        configure.args-delete   --disable-gtk2
-        configure.args-append   --disable-wireshark
+variant lua {
+    configure.args-delete   --without-lua
+    configure.args-append   --with-lua=${prefix}
+    depends_lib-append      port:lua
 }
 
 variant libsmi {
-        depends_lib-append port:libsmi
-        configure.args-append --with-libsmi
-}
-
-# TODO: Remove after 2016-01-04.
-variant python25 requires python27 description {Legacy variant} {}
-variant python26 requires python27 description {Legacy variant} {}
-
-variant python27 description {use python27 for the experimental python interface} {
-        configure.python        ${prefix}/bin/python2.7
-        depends_lib-append      port:python27
-}
-
-pre-configure {
-        if {[variant_isset python27]} {
-                configure.args-append   --with-python
-                configure.args-delete   --without-python
-                reinplace "s|python-config|python2.7-config|g" ${worksrcpath}/configure
-        }
-}
-
-pre-destroot {
-        if {[variant_isset python27]} {
-                 reinplace "s|libwireshark.dylib|${prefix}/lib/libwireshark.dylib|g" ${worksrcpath}/epan/wspython/wspy_libws.py
-        }
-}
-
-post-destroot {
-        xinstall -d ${destroot}${prefix}/include/wireshark/epan/crypt/ \
-                    ${destroot}${prefix}/include/wireshark/epan/dfilter/ \
-                    ${destroot}${prefix}/include/wireshark/epan/dissectors/ \
-                    ${destroot}${prefix}/include/wireshark/epan/ftypes/ \
-                    ${destroot}${prefix}/include/wireshark/wiretap/
-        xinstall -m 644 -W ${worksrcpath}/ color.h config.h register.h ${destroot}${prefix}/include/wireshark/
-        eval xinstall -m 644 [glob ${worksrcpath}/epan/*.h] ${destroot}${prefix}/include/wireshark/epan/
-        eval xinstall -m 644 [glob ${worksrcpath}/epan/crypt/*.h] ${destroot}${prefix}/include/wireshark/epan/crypt/
-        eval xinstall -m 644 [glob ${worksrcpath}/epan/dfilter/*.h] ${destroot}${prefix}/include/wireshark/epan/dfilter/
-        eval xinstall -m 644 [glob ${worksrcpath}/epan/dissectors/*.h] ${destroot}${prefix}/include/wireshark/epan/dissectors/
-        eval xinstall -m 644 [glob ${worksrcpath}/epan/ftypes/*.h] ${destroot}${prefix}/include/wireshark/epan/ftypes/
-        eval xinstall -m 644 [glob ${worksrcpath}/wiretap/*.h] ${destroot}${prefix}/include/wireshark/wiretap/
-}
+    configure.args-delete   --without-libsmi
+    configure.args-append   --with-libsmi=${prefix}
+    depends_lib-append      port:libsmi
+}
+
+variant geoip {
+    configure.args-delete   --without-geoip
+    configure.args-append   --with-geoip=${prefix}
+    depends_lib-append      port:libgeoip
+}
+
+variant qt description {use qt4 for the GUI} conflicts x11 gtk3 qt5 {
+    depends_lib-append      port:qt4-mac
+    configure.args-delete   --disable-wireshark
+    configure.args-append   --with-qt=4
+    configure.args-append   --with-gtk2=no
+    configure.args-append   --with-gtk3=no
+}
+
+variant qt5 description {use qt5 for the GUI} conflicts x11 gtk3 qt {
+    depends_lib-append      port:qt5-mac
+    configure.args-delete   --disable-wireshark
+    configure.args-append   --with-qt=5
+    configure.args-append   --with-gtk2=no
+    configure.args-append   --with-gtk3=no
+
+    configure.pkg_config_path   ${configure.pkg_config_path}:${prefix}/libexec/qt5-mac/lib/pkgconfig
+    configure.env-append        PATH=$env(PATH):${prefix}/libexec/qt5-mac/bin
+    build.env-append            PATH=$env(PATH):${prefix}/libexec/qt5-mac/bin
+    destroot.env-append         PKG_CONFIG_PATH=${configure.pkg_config_path}
+}
+
+variant rtp description {add rtp support} {
+    configure.args-delete   --without-portaudio
+    configure.args-append   --with-portaudio=${prefix}
+    depends_lib-append      port:portaudio
+}
+
+variant ssl {
+    configure.args-delete   --without-ssl
+    configure.args-append   --with-ssl=${prefix}
+    depends_lib-append      path:lib/libssl.dylib:openssl
+}
+
+variant x11 description {use X11 (gtk2) for GUI} conflicts qt qt5 gtk3  {
+    depends_lib-append      port:gtk2 \
+                            port:atk \
+                            path:lib/pkgconfig/cairo.pc:cairo \
+                            port:fontconfig \
+                            port:freetype \
+                            port:gdk-pixbuf2 \
+                            path:lib/pkgconfig/pango.pc:pango \
+                            port:xorg-libX11 \
+                            port:xorg-libXcomposite \
+                            port:xorg-libXcursor \
+                            port:xorg-libXdamage \
+                            port:xorg-libXext \
+                            port:xorg-libXfixes \
+                            port:xorg-libXi \
+                            port:xorg-libXinerama \
+                            port:xorg-libXrandr \
+                            port:xrender
+
+    configure.args-delete   --disable-wireshark
+    configure.args-append   --with-qt=no
+    configure.args-append   --with-gtk2=yes
+    configure.args-append   --with-gtk3=no
+}
+
+variant gtk3 description {use X11 (gtk3) for GUI} conflicts qt qt5 x11  {
+    depends_lib-append      port:gtk3 \
+                            port:adwaita-icon-theme
+
+    configure.args-delete   --disable-wireshark
+    configure.args-append   --with-qt=no
+    configure.args-append   --with-gtk2=no
+    configure.args-append   --with-gtk3=yes
+}
+
+platform macosx {
+    if { [variant_isset qt] || [variant_isset qt5] || [variant_isset x11] || [variant_isset gtk3] } {
+        patchfiles-append       patch-osxapp.diff
+        destroot.target-append  osx-install
+        destroot.env-append     APPLICATIONS_DIR=${applications_dir}
+    }
+}
+
+livecheck.type  regex
+livecheck.url   ${homepage}download.html
+livecheck.regex "Development Release \\((\\d+(?:\\.\\d+)*)"
