diff --git a/multimedia/VLC/Portfile b/multimedia/VLC/Portfile
index 7f74bf6..bea4d12 100644
--- a/multimedia/VLC/Portfile
+++ b/multimedia/VLC/Portfile
@@ -5,6 +5,14 @@ PortGroup               compiler_blacklist_versions 1.0
 PortGroup               active_variants 1.1
 PortGroup               conflicts_build 1.0
 
+if {[file exists ${prefix}/etc/macports/locales.tcl]} {
+    # experimental feature to cut down the NLS/locale files, which take up over 50% of
+    # the install footprint for VLC. This feature loads the locale_select PortGroup
+    # if its configuration file exist; a variant is then added which prunes all translations from
+    # ${destroot}${prefix}/share/locale except those whitelisted in etc/macports/locales.tcl .
+    PortGroup           locale_select 1.0
+}
+
 name                    VLC
 
 categories              multimedia devel
@@ -29,8 +37,12 @@ subport lib${name} {
     homepage            http://www.videolan.org/vlc/libvlc.html
 }
 
-subport ffmpeg-VLC {}
-set FFMPEG_VLC_PREFIX   ${prefix}/lib/vlc/ffmpeg
+set use_ffmpeg_VLC      no
+
+if {[tbool use_ffmpeg_VLC]} {
+    subport ffmpeg-VLC {}
+    set FFMPEG_VLC_PREFIX   ${prefix}/lib/vlc/ffmpeg
+}
 
 if {${subport} eq ${name}} {
     conflicts           lib${name} libVLC-devel VLC-devel
@@ -44,8 +56,7 @@ supported_archs         x86_64
 ###################  ports VLC and libVLC  ###################
 ##
 if {(${subport} eq ${name}) || (${subport} eq "lib${name}")} {
-    version             2.2.4
-    revision            8
+    version             2.2.6
     license             GPL-2
 
     platforms           darwin
@@ -54,8 +65,8 @@ if {(${subport} eq ${name}) || (${subport} eq "lib${name}")} {
     distname            vlc-${version}
     use_xz              yes
 
-    checksums           rmd160  2fe178bb9a4b2ad5ca0294d3e52ceb992b22e8ee \
-                        sha256  1632e91d2a0087e0ef4c3fb4c95c3c2890f7715a9d1d43ffd46329f428cf53be
+    checksums           rmd160  b2727834bcbbf0d274e3a0b4a3317f3b914f9ad4 \
+                        sha256  c403d3accd9a400eb2181c958f3e7bc5524fe5738425f4253d42883b425a42a8
 
     if {[info exist ::env(MACPORTS_COMPRESS_WORKDIR)] && $::env(MACPORTS_COMPRESS_WORKDIR)} {
         # Enable HFS compression.
@@ -67,8 +78,11 @@ if {(${subport} eq ${name}) || (${subport} eq "lib${name}")} {
 
     depends_build       port:pkgconfig
 
-    depends_lib         port:ffmpeg-VLC \
-                        port:a52dec \
+    if {[tbool use_ffmpeg_VLC]} {
+        depends_lib-append \
+                        port:ffmpeg-FFMPEG_VLC_PREFIX
+    }
+    depends_lib-append  port:a52dec \
                         port:avahi \
                         port:bzip2 \
                         port:faad2 \
@@ -189,44 +203,51 @@ if {(${subport} eq ${name}) || (${subport} eq "lib${name}")} {
                         static_assert.patch \
                         no-sparkle.patch \
                         patch-vlc-no-O4.diff \
-                        patch-ffmpegVLC.diff \
                         patch-soundfont-path.diff
+    if {[tbool use_ffmpeg_VLC]} {
+        patchfiles-append \
+                        patch-ffmpegVLC.diff
+    } else {
+        patchfiles-append \
+                        patch-ffmpeg3-compat.diff
+    }
 
     post-patch {
         if {[string match *clang* ${configure.cxx}] && ${configure.cxx_stdlib} == "libc++"} {
             reinplace "s:-lstdc\+\+:-lc++:" \
-                ${worksrcpath}/configure.ac \
                 ${worksrcpath}/modules/access/Makefile.am
         }
 
         reinplace "s|@PREFIX@|${prefix}|g" ${worksrcpath}/modules/codec/fluidsynth.c
 
-        # patch source using ffmpeg to use the correct header file locations
-        foreach dir {libavcodec libavformat libavresample libavutil libpostproc libswresample libswscale} {
-            foreach module {access codec/avcodec demux/avformat hw/vdpau packetizer video_chroma} {
-                foreach cf [glob -nocomplain ${worksrcpath}/modules/${module}/*.c] {
-                    reinplace "s|${dir}/|${dir}-VLC/|g" ${cf}
-                }
-                foreach cf [glob -nocomplain ${worksrcpath}/modules/${module}/*.h] {
-                    reinplace "s|${dir}/|${dir}-VLC/|g" ${cf}
+        if {[tbool use_ffmpeg_VLC]} {
+            # patch source using ffmpeg to use the correct header file locations
+            foreach dir {libavcodec libavformat libavresample libavutil libpostproc libswresample libswscale} {
+                foreach module {access codec/avcodec demux/avformat hw/vdpau packetizer video_chroma} {
+                    foreach cf [glob -nocomplain ${worksrcpath}/modules/${module}/*.c] {
+                        reinplace "s|${dir}/|${dir}-VLC/|g" ${cf}
+                    }
+                    foreach cf [glob -nocomplain ${worksrcpath}/modules/${module}/*.h] {
+                        reinplace "s|${dir}/|${dir}-VLC/|g" ${cf}
+                    }
                 }
+                reinplace "s|${dir}/|${dir}-VLC/|g" ${worksrcpath}/configure.ac ${worksrcpath}/configure
             }
-            reinplace "s|${dir}/|${dir}-VLC/|g" ${worksrcpath}/configure.ac ${worksrcpath}/configure
-        }
-        reinplace "s|postproc/|postproc-VLC/|g" ${worksrcpath}/configure.ac ${worksrcpath}/configure
-        reinplace "s|libpostproc/|libpostproc-VLC/|g" ${worksrcpath}/modules/video_filter/postproc.c
-        reinplace "s|HAVE_LIBAVUTIL_AV|HAVE_LIBAVUTIL_VLC_AV|g" \
+            reinplace "s|postproc/|postproc-VLC/|g" ${worksrcpath}/configure.ac ${worksrcpath}/configure
+            reinplace "s|libpostproc/|libpostproc-VLC/|g" ${worksrcpath}/modules/video_filter/postproc.c
+            reinplace "s|HAVE_LIBAVUTIL_AV|HAVE_LIBAVUTIL_VLC_AV|g" \
                 ${worksrcpath}/modules/codec/avcodec/avcommon.h \
                 ${worksrcpath}/modules/codec/avcodec/avcommon_compat.h
-        reinplace "s|HAVE_LIBAVFORMAT_AV|HAVE_LIBAVFORMAT_VLC_AV|g" \
+            reinplace "s|HAVE_LIBAVFORMAT_AV|HAVE_LIBAVFORMAT_VLC_AV|g" \
                 ${worksrcpath}/modules/codec/avcodec/avcommon.h \
                 ${worksrcpath}/modules/codec/avcodec/avcommon_compat.h
-        reinplace "s|HAVE_LIBAVCODEC_AV|HAVE_LIBAVCODEC_VLC_AV|g" \
+            reinplace "s|HAVE_LIBAVCODEC_AV|HAVE_LIBAVCODEC_VLC_AV|g" \
                 ${worksrcpath}/modules/codec/avcodec/avcommon.h \
                 ${worksrcpath}/modules/codec/avcodec/avcommon_compat.h
-        reinplace "s|HAVE_LIBSWSCALE_SW|HAVE_LIBSWSCALE_VLC_SW|g" \
+            reinplace "s|HAVE_LIBSWSCALE_SW|HAVE_LIBSWSCALE_VLC_SW|g" \
                 ${worksrcpath}/modules/codec/avcodec/avcommon.h \
                 ${worksrcpath}/modules/codec/avcodec/avcommon_compat.h
+        }
     }
     post-configure {
         system -W ${worksrcpath} "patch -Np0 -i ${filespath}/patch-static_assert.diff"
@@ -240,9 +261,11 @@ if {(${subport} eq ${name}) || (${subport} eq "lib${name}")} {
 
     configure.env-append \
                         CXXCPP="${configure.cxx} -E"
-    # splice in ffmpeg-VLC's pkgconfig path, hoping that PKG_CONFIG_PATH hasn't been set by anyone else
-    configure.env-append \
+    if {[tbool use_ffmpeg_VLC]} {
+        # splice in ffmpeg-VLC's pkgconfig path, hoping that PKG_CONFIG_PATH hasn't been set by anyone else
+        configure.env-append \
                         PKG_CONFIG_PATH=${FFMPEG_VLC_PREFIX}/lib/pkgconfig
+    }
     build.args-append   DESTDIR=${worksrcpath}/dest_ignore V=1
 
     # gl.c:121:3: error: Platform not recognized.
@@ -439,8 +462,8 @@ if {(${subport} eq ${name}) || (${subport} eq "lib${name}")} {
             description {Enable all variants (except freerdp, currently)} {}
     }
 
-    # this patchfile can probably go with VLC 2.2.2, or should be reviewed then.
-    # update 2.2.2 : lua 5.3 gives compiler syntax errors so we stick with 5.2 for now.
+#     # this patchfile can probably go with VLC 2.2.2, or should be reviewed then.
+#     # update 2.2.2 : lua 5.3 gives compiler syntax errors so we stick with 5.2 for now.
     patchfiles-append           patch-for-lua52.diff
 
     # make 10.12 and later ignore all QTKit code in modules/gui/macosx/open.m
@@ -452,14 +475,9 @@ if {(${subport} eq ${name}) || (${subport} eq "lib${name}")} {
             default_variants-append +qtkit
         }
 
-        configure.args-replace  --disable-macosx-eyetv --enable-macosx-eyetv
-
-        if {${subport} ne "lib${name}"} {
-            configure.args-replace  --disable-macosx-vlc-app --enable-macosx-vlc-app
-        }
+        patchfiles-append       patch-use-NSGetEnviron.diff
 
         post-patch {
-            reinplace "s/Appkit/AppKit/" ${worksrcpath}/configure.ac
             reinplace "/Sparkle.framework/d" \
                 ${worksrcpath}/extras/package/macosx/vlc.xcodeproj/project.pbxproj
             reinplace "/SDKROOT/d" \
@@ -470,14 +488,6 @@ if {(${subport} eq ${name}) || (${subport} eq "lib${name}")} {
             reinplace "s:LD_LIBRARY_PATH:DYLD_LIBRARY_PATH:g" \
                 ${worksrcpath}/Makefile.am
 
-            reinplace "/argv/s/environ/*_NSGetEnviron()/" \
-                ${worksrcpath}/modules/misc/inhibit/xdg.c \
-                ${worksrcpath}/modules/stream_filter/decomp.c
-
-            reinplace "s/extern char \\*\\*environ;/#include <crt_externs.h>/" \
-                ${worksrcpath}/modules/misc/inhibit/xdg.c \
-                ${worksrcpath}/modules/stream_filter/decomp.c
-
             if {![file exists ${worksrcpath}/contrib/BGHUDAppKit.framework]} {
                 ln -s ${frameworks_dir}/BGHUDAppKit.framework ${worksrcpath}/contrib/BGHUDAppKit.framework
             }
@@ -486,6 +496,12 @@ if {(${subport} eq ${name}) || (${subport} eq "lib${name}")} {
             file mkdir "${worksrcpath}/contrib/lib"
         }
 
+        configure.args-replace  --disable-macosx-eyetv --enable-macosx-eyetv
+
+        if {${subport} ne "lib${name}"} {
+            configure.args-replace  --disable-macosx-vlc-app --enable-macosx-vlc-app
+        }
+
         post-destroot {
             eval file delete [glob ${destroot}${prefix}/lib/vlc/plugins/*/*.la]
 
@@ -505,10 +521,20 @@ if {(${subport} eq ${name}) || (${subport} eq "lib${name}")} {
                     delete ${destroot}${applications_dir}/VLC.app/Contents/MacOS/share/lua
 
                     # http://trac.macports.org/ticket/35131
-                    ln -s ${prefix}/lib ${destroot}${applications_dir}/VLC.app/Contents/MacOS/lib
+                    xinstall -m 755 -d ${destroot}${applications_dir}/VLC.app/Contents/MacOS/lib
+                    foreach l [glob -nocomplain ${destroot}${prefix}/lib/*] {
+                        ln -s ${prefix}/lib/[file tail ${l}] ${destroot}${applications_dir}/VLC.app/Contents/MacOS/lib
+                    }
                     ln -s ${prefix}/lib/vlc/plugins ${destroot}${applications_dir}/VLC.app/Contents/MacOS/plugins
                     ln -s ${prefix}/lib/vlc/lua ${destroot}${applications_dir}/VLC.app/Contents/MacOS/share/lua
-                    ln -s ${prefix}/share/locale ${destroot}${applications_dir}/VLC.app/Contents/MacOS/share/locale
+                    foreach d [glob -nocomplain ${destroot}${prefix}/share/locale/*] {
+                        set locale [file tail ${d}]
+                        set ldir ${destroot}${applications_dir}/VLC.app/Contents/MacOS/share/locale/${locale}/LC_MESSAGES
+                        xinstall -m 755 -d ${ldir}
+                        foreach m [glob -nocomplain ${d}/LC_MESSAGES/*] {
+                            ln -s ${prefix}/share/locale/${locale}/LC_MESSAGES/[file tail ${m}] ${ldir}/
+                        }
+                    }
 
                     # the vlc executable needs to be started with a full path to the app bundle executable
                     # or else the Mac OS X interface will hang beyond even a ^C or ^\ :
@@ -529,179 +555,18 @@ if {(${subport} eq ${name}) || (${subport} eq "lib${name}")} {
             system "${prefix}/lib/vlc/vlc-cache-gen -f ${prefix}/lib/vlc"
         }
     }
-# outcomment when the port:fluid-soundfont* ports have been made available
-#     notes-append "MIDI support requires installing one or more SoundFont files,\
-#         in ${prefix}/share/sounds/sf2, for instance from one of the port:fluid-soundfont-* ports"
+    notes-append "MIDI support requires installing one or more SoundFont files,\
+        in ${prefix}/share/sounds/sf2, for instance from port:generaluser-soundfont."
 }
 
 ##
 #################  support port ffmpeg-VLC  ##################
 ##
 if {${subport} eq "ffmpeg-VLC"} {
-    PortGroup           xcodeversion 1.0
-
-    version             2.8.6
-    revision            1
-    license             LGPL-2.1+
-    categories          multimedia
-    maintainers         gmail.com:rjvbertin openmaintainer
-
-    description         Custom FFMpeg 2.8.6 build for port:VLC and port:libVLC.
-    long_description    Custom FFMpeg build for VLC and libVLC v2.2.x . It installs \
-                        a private copy of FFMpeg v2.8.6 .
-
-    platforms           darwin
-    homepage            http://www.ffmpeg.org/
-    master_sites        http://www.ffmpeg.org/releases/
-
-    use_bzip2           yes
-    distname            ffmpeg-${version}
-
-    checksums           rmd160  5b61b6b0521d39ca31dcfb7fff1dfa26d9e7667a \
-                        sha256  40611e329bc354592c6f8f1deb033c31b91f80e91f5707ca4f9afceca78d8e62
-
-    depends_build       port:pkgconfig \
-                        port:gmake
-
-    # libvpx is static only so can be considered a build dependency (#47934)
-
-    depends_build-append \
-                        port:libvpx
-
-    depends_lib         port:lame \
-                        port:libiconv \
-                        port:openjpeg15 \
-                        port:xz \
-                        port:zlib
-
-    build.cmd           ${prefix}/bin/gmake
-    build.env-append    V=1
-
-    #
-    # enable auto configure of asm optimizations
-    # requires Xcode 3.1 or better on Leopard
-    #
-    minimum_xcodeversions {9 3.1}
-
-    if {[lsearch [get_canonical_archs] i386] != -1} {
-        # clang-3.1 hits https://trac.macports.org/ticket/30137 (<rdar://problem/11542429>)
-        # clang-139 hits https://trac.macports.org/ticket/38141
-        compiler.blacklist-append {clang < 422.1.7}
-    }
-
-    configure.cflags-append -DHAVE_LRINTF ${configure.cppflags}
-    configure.args      --prefix=${FFMPEG_VLC_PREFIX} \
-                        --progs-suffix=-VLC \
-                        --build-suffix=-VLC \
-                        --disable-doc \
-                        --disable-encoder=vorbis \
-                        --enable-libopenjpeg \
-                        --disable-debug \
-                        --disable-avdevice \
-                        --disable-devices \
-                        --disable-avfilter \
-                        --disable-filters \
-                        --disable-protocol=concat \
-                        --disable-bsfs \
-                        --disable-bzlib \
-                        --enable-avresample \
-                        --enable-libmp3lame \
-                        --enable-libvpx \
-                        --disable-libbluray \
-                        --disable-sdl \
-                        --disable-libxcb --disable-libxcb-shm --disable-libxcb-xfixes --disable-libxcb-shape \
-                        --enable-shared --disable-static --enable-pthreads \
-                        --enable-rpath \
-                        --disable-stripping \
-                        --cc=${configure.cc}
-
-    # this is the old gpl2 variant. VLC is GPL2'ed, so we can just as well build ffmpeg
-    # with these components.
-    configure.args-append \
-                        --enable-gpl \
-                        --enable-postproc
-
-    configure.args-append \
-                        --arch=${configure.build_arch}
-    configure.env-append \
-                        ASFLAGS='[get_canonical_archflags]'
-    if {${build_arch} eq "x86_64"} {
-        depends_build-append \
-                        port:yasm
-        configure.args-append \
-                        --enable-yasm
+    if {[catch {source "${portpath}/Portfile.ffmpeg.tcl"} err]} {
+        puts stderr "Error reading Portfile.ffmpeg.tcl: $err"
+        return 1;
     }
-
-    platform darwin {
-        if {${os.major} < 9} {
-            configure.args-append --disable-asm
-        }
-
-        # VDA (video hardware acceleration, mostly H264) is only supported on 10.6.3+ up to (excluding) 10.11.
-        #if {(${os.major} > 10 || (${os.major} == 10 && ${os.minor} >= 3)) && (${os.major} < 15)}
-        # Due to a bug in ffmpeg(?), we have to enable VDA on 10.11 as well, even though it shouldn't be supported.
-        # More information: https://github.com/mpv-player/mpv/issues/2299
-        if {${os.major} > 10 || (${os.major} == 10 && ${os.minor} >= 3)} {
-            configure.args-delete --disable-vda
-            configure.args-append --enable-vda
-        }
-
-        # VideotoolBox, a new hardware acceleration framework, is supported on 10.8+ and "here to stay".
-        # It provides support for H264, H263, MPEG1, MPEG2 and MPEG4.
-        if {${os.major} > 11} {
-            configure.args-delete --disable-videotoolbox
-            configure.args-append --enable-videotoolbox
-        }
-
-        # Apple GCC has problems with SIMD intrinsics and -Werror=no-missing-prototypes.
-        if {${os.major} < 11} {
-            patchfiles-append patch-configure-no-error-on-missing-prototypes.diff
-        }
-
-        # kCVPixelFormatType_OneComponent8 used in avfoundation indev is only available on 10.8+
-        if {${os.major} < 12} {
-            configure.args-append --disable-indev=avfoundation
-        }
-    }
-
-    #
-    # configure isn't autoconf and they do use a dep cache
-    #
-
-    platform darwin 8 {
-        post-patch {
-            reinplace "s:,-compatibility_version,$\(LIBMAJOR\)::" ${worksrcpath}/configure
-        }
-    }
-
-    destroot.target     install-libs install-headers
-
-    post-destroot {
-        file delete -force ${destroot}${prefix}/share/examples
-        # We need to make sure that the linker will use our libraries and not one
-        # from a location like ${prefix}/lib . That's why we use --build-suffix, but
-        # that still requires us to provide pkg-config files with the standard names:
-        foreach pc [glob ${destroot}${FFMPEG_VLC_PREFIX}/lib/pkgconfig/*.pc] {
-            set standardname [strsed ${pc} "s/-VLC.pc/.pc/"]
-            ln -s [file tail ${pc}] ${standardname}
-        }
-        # oblige dependent code to include files from our own renamed header file directories, so it
-        # cannot include mismatching headers by accident (e.g. those from ffmpeg 3.x).
-        foreach dir {libavcodec libavformat libavresample libavutil libpostproc libswresample libswscale} {
-            file rename ${destroot}${FFMPEG_VLC_PREFIX}/include/${dir} ${destroot}${FFMPEG_VLC_PREFIX}/include/${dir}-VLC
-        }
-        foreach dir {libavcodec libavformat libavresample libavutil libpostproc libswresample libswscale} {
-            foreach header [glob -nocomplain ${destroot}${FFMPEG_VLC_PREFIX}/include/*/*.h] {
-                reinplace "s|${dir}/|${dir}-VLC/|g" ${header}
-            }
-        }
-        # packageable: ${destroot}${FFMPEG_VLC_PREFIX}/{include,lib/lib*VLC.dylib,lib/pkgconfig}
-    }
-
-    livecheck.type      regex
-    livecheck.url       ${master_sites}
-    livecheck.regex     "ffmpeg-(\\d+(?:\\.\\d+)*)${extract.suffix}"
-
 }
 
 # kate: backspace-indents true; indent-pasted-text true; indent-width 4; keep-extra-spaces true; remove-trailing-spaces modified; replace-tabs true; replace-tabs-save true; syntax Tcl/Tk; tab-indents true; tab-width 4;
diff --git a/multimedia/VLC/files/files/PR-34741-no__clang_version__.patch b/multimedia/VLC/files/files/PR-34741-no__clang_version__.patch
new file mode 100644
index 0000000..97a51a4
--- /dev/null
+++ b/multimedia/VLC/files/files/PR-34741-no__clang_version__.patch
@@ -0,0 +1,19 @@
+--- modules/gui/macosx/about.m.orig	2014-02-25 11:36:09.000000000 -0800
++++ modules/gui/macosx/about.m	2014-02-25 12:06:29.000000000 -0800
+@@ -101,10 +101,14 @@ static VLAboutBox *_o_sharedInstance = n
+ 
+         /* setup the creator / revision field */
+         NSString *compiler;
+-#ifdef __clang__
++#ifdef __clang_version__
+         compiler = [NSString stringWithFormat:@"clang %s", __clang_version__];
+-#else
++#elif defined(__clang__)
++        compiler = [NSString stringWithFormat:@"clang"];
++#elif defined(__llvm__)
+         compiler = [NSString stringWithFormat:@"llvm-gcc %s", __VERSION__];
++#else
++        compiler = [NSString stringWithFormat:@"gcc %s", __VERSION__];
+ #endif
+         [o_revision_field setStringValue: [NSString stringWithFormat: _NS("Compiled by %s with %@"), VLC_CompileBy(), compiler]];
+ 
diff --git a/multimedia/VLC/files/files/buildfix-package.mak.patch b/multimedia/VLC/files/files/buildfix-package.mak.patch
new file mode 100644
index 0000000..18f118c
--- /dev/null
+++ b/multimedia/VLC/files/files/buildfix-package.mak.patch
@@ -0,0 +1,26 @@
+diff --git extras/package/macosx/package.mak extras/package/macosx/package.mak
+index 40e4fe5..0f381dd 100644
+--- extras/package/macosx/package.mak
++++ extras/package/macosx/package.mak
+@@ -26,10 +26,10 @@ VLC.app: VLC-tmp
+ 
+ 
+ VLC-tmp: vlc
++	rm -Rf "$(top_builddir)/tmp" "$@"
+ 	$(AM_V_GEN)for i in src lib share; do \
+-		(cd $$i && $(MAKE) $(AM_MAKEFLAGS) install $(silentstd)); \
++		(cd $$i && $(MAKE) $(AM_MAKEFLAGS) install $(silentstd) DESTDIR=$(abs_top_builddir)/tmp/destdir); \
+ 	done
+-	rm -Rf "$(top_builddir)/tmp" "$@"
+ 	mkdir -p "$(top_builddir)/tmp/extras/package/macosx"
+ 	cd $(srcdir)/extras/package/macosx; cp -R Resources README.MacOSX.rtf $(abs_top_builddir)/tmp/extras/package/macosx/
+ 	mkdir -p $(abs_top_builddir)/tmp/extras/package/macosx/vlc.xcodeproj/
+@@ -49,7 +49,7 @@ VLC-tmp: vlc
+ 	cp -R $(top_builddir)/tmp/build/Default/VLC.bundle $@
+ 	mkdir -p $@/Contents/Frameworks && cp -R $(CONTRIB_DIR)/Growl.framework $@/Contents/Frameworks/
+ 	mkdir -p $@/Contents/MacOS/share/locale/
+-	cp -r "$(prefix)/lib/vlc/lua" "$(prefix)/share/vlc/lua" $@/Contents/MacOS/share/
++	cp -r "$(top_builddir)/tmp/destdir$(prefix)/lib/vlc/lua" "$(top_builddir)/tmp/destdir$(prefix)/share/vlc/lua" $@/Contents/MacOS/share/
+ 	mkdir -p $@/Contents/MacOS/include/
+ 	(cd "$(prefix)/include" && $(AMTAR) -c --exclude "plugins" vlc) | $(AMTAR) -x -C $@/Contents/MacOS/include/
+ 	$(INSTALL) -m 644 $(srcdir)/share/vlc512x512.png $@/Contents/MacOS/share/vlc512x512.png
diff --git a/multimedia/VLC/files/files/configure.ac-no-arch.patch b/multimedia/VLC/files/files/configure.ac-no-arch.patch
new file mode 100644
index 0000000..f1e7d28
--- /dev/null
+++ b/multimedia/VLC/files/files/configure.ac-no-arch.patch
@@ -0,0 +1,43 @@
+diff --git configure.ac configure.ac
+index 318cad4..9350f90 100644
+--- configure.ac
++++ configure.ac
+@@ -144,22 +144,11 @@ case "${host_os}" in
+     SYS=dragonfly
+     ;;
+   darwin*)
+-
+-    dnl Force gcc "-arch" flag
+-    ARCH_flag=""
+     case "${host}" in
+       i?86*)
+-        ARCH_flag="-arch i386"
+         YASMFLAGS="-f macho32"
+       ;;
+-      ppc64*)
+-        ARCH_flag="-arch ppc64"
+-      ;;
+-      ppc*)
+-        ARCH_flag="-arch ppc"
+-      ;;
+       x86_64*)
+-        ARCH_flag="-arch x86_64"
+         YASMFLAGS="-f macho64"
+       ;;
+       arm*)
+@@ -169,11 +158,10 @@ case "${host_os}" in
+     esac
+ 
+     SYS=darwin
+-    CFLAGS="${CFLAGS} -D_INTL_REDIRECT_MACROS ${ARCH_flag}"
+-    CXXFLAGS="${CXXFLAGS} -D_INTL_REDIRECT_MACROS ${ARCH_flag}"
+-    CPPFLAGS="${CPPFLAGS} ${ARCH_flag}"
+-    OBJCFLAGS="${OBJCFLAGS} -D_INTL_REDIRECT_MACROS -std=gnu99 ${ARCH_flag}"
+-    LDFLAGS="${LDFLAGS} -Wl,-headerpad_max_install_names ${ARCH_flag}"
++    CFLAGS="${CFLAGS} -D_INTL_REDIRECT_MACROS"
++    CXXFLAGS="${CXXFLAGS} -D_INTL_REDIRECT_MACROS"
++    OBJCFLAGS="${OBJCFLAGS} -D_INTL_REDIRECT_MACROS -std=gnu99"
++    LDFLAGS="${LDFLAGS} -Wl,-headerpad_max_install_names"
+     VLC_ADD_LIBS([libvlc vlc],[-Wl,-undefined,dynamic_lookup,-framework,AppKit])
+     VLC_ADD_LIBS([libvlccore],[-Wl,-framework,CoreFoundation,-framework,CoreServices])
+ 
diff --git a/multimedia/VLC/files/files/ffmpeg/patch-configure-no-error-on-missing-prototypes.diff b/multimedia/VLC/files/files/ffmpeg/patch-configure-no-error-on-missing-prototypes.diff
new file mode 100644
index 0000000..61a4335
--- /dev/null
+++ b/multimedia/VLC/files/files/ffmpeg/patch-configure-no-error-on-missing-prototypes.diff
@@ -0,0 +1,10 @@
+--- configure.old	2015-09-27 18:43:30.000000000 +0200
++++ configure	2015-09-27 18:44:18.000000000 +0200
+@@ -5683,7 +5683,6 @@
+     check_optflags -fno-tree-vectorize
+     check_cflags -Werror=format-security
+     check_cflags -Werror=implicit-function-declaration
+-    check_cflags -Werror=missing-prototypes
+     check_cflags -Werror=return-type
+     check_cflags -Werror=vla
+     check_cflags -Wformat
diff --git a/multimedia/VLC/files/files/no-sparkle.patch b/multimedia/VLC/files/files/no-sparkle.patch
new file mode 100644
index 0000000..395ade6
--- /dev/null
+++ b/multimedia/VLC/files/files/no-sparkle.patch
@@ -0,0 +1,189 @@
+diff --git configure.ac configure.ac
+index 318cad4..7c4e53f 100644
+--- configure.ac
++++ configure.ac
+@@ -3850,13 +3850,6 @@ then
+ 
+   VLC_ADD_LIBS([macosx], [-Wl,-framework,QTKit -Wl,-framework,IOKit -Wl,-framework,AddressBook -Wl,-framework,WebKit -Wl,-framework,CoreAudio -Wl,-framework,SystemConfiguration -Wl,-framework,ScriptingBridge])
+ 
+-  if test ! -d ${CONTRIB_DIR}/Sparkle.framework
+-  then
+-    AC_MSG_ERROR([Sparkle framework is required and was not found in ${CONTRIB_DIR}])
+-  fi
+-  VLC_ADD_LIBS([macosx], [-F${CONTRIB_DIR} -Wl,-framework,Sparkle])
+-  VLC_ADD_OBJCFLAGS([macosx], [-F${CONTRIB_DIR}])
+-
+   if test ! -d ${CONTRIB_DIR}/BGHUDAppKit.framework
+   then
+     AC_MSG_ERROR([BGHUDAppKit framework is required and was not found in ${CONTRIB_DIR}])
+diff --git extras/package/macosx/Resources/English.lproj/MainMenu.xib extras/package/macosx/Resources/English.lproj/MainMenu.xib
+index 1c880c9..08b3b9d 100644
+--- extras/package/macosx/Resources/English.lproj/MainMenu.xib
++++ extras/package/macosx/Resources/English.lproj/MainMenu.xib
+@@ -2106,9 +2106,6 @@
+       <object class="NSCustomObject" id="651263286">
+         <string key="NSClassName">VLCMainMenu</string>
+       </object>
+-      <object class="NSCustomObject" id="1040926652">
+-        <string key="NSClassName">SUUpdater</string>
+-      </object>
+       <object class="NSCustomView" id="560875128">
+         <reference key="NSNextResponder"/>
+         <int key="NSvFlags">268</int>
+@@ -2635,14 +2632,6 @@
+           <int key="connectionID">2817</int>
+         </object>
+         <object class="IBConnectionRecord">
+-          <object class="IBActionConnection" key="connection">
+-            <string key="label">checkForUpdates:</string>
+-            <reference key="source" ref="1040926652"/>
+-            <reference key="destination" ref="354414928"/>
+-          </object>
+-          <int key="connectionID">4371</int>
+-        </object>
+-        <object class="IBConnectionRecord">
+           <object class="IBOutletConnection" key="connection">
+             <string key="label">o_dmi_mute</string>
+             <reference key="source" ref="651263286"/>
+@@ -5466,11 +5455,6 @@
+             <string key="objectName">Application</string>
+           </object>
+           <object class="IBObjectRecord">
+-            <int key="objectID">4370</int>
+-            <reference key="object" ref="1040926652"/>
+-            <reference key="parent" ref="0"/>
+-          </object>
+-          <object class="IBObjectRecord">
+             <int key="objectID">4397</int>
+             <reference key="object" ref="629699013"/>
+             <object class="NSMutableArray" key="children">
+diff --git modules/gui/macosx/simple_prefs.m modules/gui/macosx/simple_prefs.m
+index 98f315d..0074c64 100644
+--- modules/gui/macosx/simple_prefs.m
++++ modules/gui/macosx/simple_prefs.m
+@@ -38,8 +38,6 @@
+ #import "AppleRemote.h"
+ #import "CoreInteraction.h"
+ 
+-#import <Sparkle/Sparkle.h>                        //for o_intf_last_update_lbl
+-
+ static const char *const ppsz_language[] =
+ {
+     "auto",
+@@ -383,7 +381,6 @@ create_toolbar_item(NSString * o_itemIdent, NSString * o_name, NSString * o_desc
+     [o_intf_mediakeys_ckb setTitle: _NS("Control playback with media keys")];
+     [o_intf_art_ckb setTitle: _NS("Allow metadata network access")];
+     [o_intf_update_ckb setTitle: _NS("Automatically check for updates")];
+-    [o_intf_last_update_lbl setStringValue: @""];
+     [o_intf_enableGrowl_ckb setTitle: _NS("Enable Growl notifications (on playlist item change)")];
+     [o_intf_autoresize_ckb setTitle: _NS("Resize interface to the native video size")];
+     [o_intf_pauseminimized_ckb setTitle: _NS("Pause the video playback when minimized")];
+@@ -595,10 +592,6 @@ static inline char * __config_GetLabel(vlc_object_t *p_this, const char *psz_nam
+     [self setupButton: o_intf_appleremote_sysvol_ckb forBoolValue: "macosx-appleremote-sysvol"];
+ 
+     [self setupButton: o_intf_mediakeys_ckb forBoolValue: "macosx-mediakeys"];
+-    if ([[SUUpdater sharedUpdater] lastUpdateCheckDate] != NULL)
+-        [o_intf_last_update_lbl setStringValue: [NSString stringWithFormat: _NS("Last check on: %@"), [[[SUUpdater sharedUpdater] lastUpdateCheckDate] descriptionWithLocale: [[NSUserDefaults standardUserDefaults] dictionaryRepresentation]]]];
+-    else
+-        [o_intf_last_update_lbl setStringValue: _NS("No check was performed yet.")];
+     psz_tmp = config_GetPsz(p_intf, "control");
+     if (psz_tmp) {
+         [o_intf_enableGrowl_ckb setState: (NSInteger)strstr(psz_tmp, "growl")];
+diff --git extras/package/macosx/Resources/English.lproj/Preferences.xib extras/package/macosx/Resources/English.lproj/Preferences.xib
+index 2f264fd..d4049bd 100644
+--- extras/package/macosx/Resources/English.lproj/Preferences.xib
++++ extras/package/macosx/Resources/English.lproj/Preferences.xib
+@@ -4779,9 +4779,6 @@
+ 				<string key="NSMaxSize">{10000000000000, 10000000000000}</string>
+ 				<bool key="NSWindowIsRestorable">YES</bool>
+ 			</object>
+-			<object class="NSCustomObject" id="761483302">
+-				<string key="NSClassName">SUUpdater</string>
+-			</object>
+ 			<object class="NSWindowTemplate" id="898680423">
+ 				<int key="NSWindowStyleMask">15</int>
+ 				<int key="NSWindowBacking">2</int>
+@@ -7629,22 +7626,6 @@
+ 					<int key="connectionID">2681</int>
+ 				</object>
+ 				<object class="IBConnectionRecord">
+-					<object class="IBBindingConnection" key="connection">
+-						<string key="label">value: automaticallyChecksForUpdates</string>
+-						<reference key="source" ref="243384014"/>
+-						<reference key="destination" ref="761483302"/>
+-						<object class="NSNibBindingConnector" key="connector">
+-							<reference key="NSSource" ref="243384014"/>
+-							<reference key="NSDestination" ref="761483302"/>
+-							<string key="NSLabel">value: automaticallyChecksForUpdates</string>
+-							<string key="NSBinding">value</string>
+-							<string key="NSKeyPath">automaticallyChecksForUpdates</string>
+-							<int key="NSNibBindingConnectorVersion">2</int>
+-						</object>
+-					</object>
+-					<int key="connectionID">3559</int>
+-				</object>
+-				<object class="IBConnectionRecord">
+ 					<object class="IBOutletConnection" key="connection">
+ 						<string key="label">nextKeyView</string>
+ 						<reference key="source" ref="588417130"/>
+@@ -9360,12 +9341,6 @@
+ 						<reference key="parent" ref="492678965"/>
+ 					</object>
+ 					<object class="IBObjectRecord">
+-						<int key="objectID">3555</int>
+-						<reference key="object" ref="761483302"/>
+-						<reference key="parent" ref="0"/>
+-						<string key="objectName">Sparkle Updater</string>
+-					</object>
+-					<object class="IBObjectRecord">
+ 						<int key="objectID">3556</int>
+ 						<reference key="object" ref="243384014"/>
+ 						<array class="NSMutableArray" key="children">
+diff --git modules/gui/macosx/intf.m modules/gui/macosx/intf.m
+index 1d48150..c61a4aa 100644
+--- modules/gui/macosx/intf.m
++++ modules/gui/macosx/intf.m
+@@ -68,8 +68,6 @@
+ #import "VideoEffects.h"
+ #import "AudioEffects.h"
+ 
+-#import <Sparkle/Sparkle.h>                 /* we're the update delegate */
+-
+ #import "iTunes.h"
+ #import "Spotify.h"
+ 
+@@ -785,8 +783,6 @@
+     PL_LOCK;
+     items_at_launch = p_playlist->p_local_category->i_children;
+     PL_UNLOCK;
+-
+-    [[SUUpdater sharedUpdater] setDelegate:self];
+ }
+ 
+ - (void)applicationDidFinishLaunching:(NSNotification *)aNotification
+@@ -974,25 +970,6 @@
+ }
+ 
+ #pragma mark -
+-#pragma mark Sparkle delegate
+-/* received directly before the update gets installed, so let's shut down a bit */
+-- (void)updater:(SUUpdater *)updater willInstallUpdate:(SUAppcastItem *)update
+-{
+-    [NSApp activateIgnoringOtherApps:YES];
+-    [o_remote stopListening: self];
+-    [[VLCCoreInteraction sharedInstance] stop];
+-}
+-
+-/* don't be enthusiastic about an update if we currently play a video */
+-- (BOOL)updaterMayCheckForUpdates:(SUUpdater *)bundle
+-{
+-    if ([self activeVideoPlayback])
+-        return NO;
+-
+-    return YES;
+-}
+-
+-#pragma mark -
+ #pragma mark Media Key support
+ 
+ -(void)mediaKeyTap:(SPMediaKeyTap*)keyTap receivedMediaKeyEvent:(NSEvent*)event
diff --git a/multimedia/VLC/files/files/old/patch-ignore-libGL.diff b/multimedia/VLC/files/files/old/patch-ignore-libGL.diff
new file mode 100644
index 0000000..24b35b2
--- /dev/null
+++ b/multimedia/VLC/files/files/old/patch-ignore-libGL.diff
@@ -0,0 +1,19 @@
+diff --git modules/video_output/Modules.am modules/video_output/Modules.am
+index df8fbf6..81ee341 100644
+--- modules/video_output/Modules.am
++++ modules/video_output/Modules.am
+@@ -22,12 +22,12 @@ endif
+ if HAVE_OSX
+ libvout_macosx_plugin_la_SOURCES = macosx.m opengl.c opengl.h
+ libvout_macosx_plugin_la_CFLAGS = $(AM_CFLAGS) $(GL_CFLAGS)
+-libvout_macosx_plugin_la_LIBADD = $(GL_LIBS)
++libvout_macosx_plugin_la_LIBADD =
+ libvout_macosx_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(voutdir)' -Wl,-framework,OpenGL,-framework,Cocoa
+ 
+ libcaopengllayer_plugin_la_SOURCES = caopengllayer.m opengl.c opengl.h
+ libcaopengllayer_plugin_la_CFLAGS = $(AM_CFLAGS) $(GL_CFLAGS)
+-libcaopengllayer_plugin_la_LIBADD = $(GL_LIBS)
++libcaopengllayer_plugin_la_LIBADD =
+ libcaopengllayer_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(voutdir)' -Wl,-framework,OpenGL,-framework,Cocoa,-framework,QuartzCore
+ vout_LTLIBRARIES += libvout_macosx_plugin.la libcaopengllayer_plugin.la
+ endif
diff --git a/multimedia/VLC/files/files/old/patch-ogg-nullptr-deref.diff b/multimedia/VLC/files/files/old/patch-ogg-nullptr-deref.diff
new file mode 100644
index 0000000..68ee3c0
--- /dev/null
+++ b/multimedia/VLC/files/files/old/patch-ogg-nullptr-deref.diff
@@ -0,0 +1,21 @@
+--- modules/demux/orig.ogg.c	2016-01-18 21:49:57.000000000 +0100
++++ modules/demux/ogg.c	2017-02-13 22:01:59.734081802 +0100
+@@ -2199,10 +2199,14 @@
+ #ifdef HAVE_LIBVORBIS
+     if ( p_stream->fmt.i_codec == VLC_CODEC_VORBIS )
+     {
+-        vorbis_info_clear( p_stream->special.vorbis.p_info );
+-        FREENULL( p_stream->special.vorbis.p_info );
+-        vorbis_comment_clear( p_stream->special.vorbis.p_comment );
+-        FREENULL( p_stream->special.vorbis.p_comment );
++        if (p_stream->special.vorbis.p_info) {
++            vorbis_info_clear( p_stream->special.vorbis.p_info );
++            FREENULL( p_stream->special.vorbis.p_info );
++        }
++        if (p_stream->special.vorbis.p_comment) {
++            vorbis_comment_clear( p_stream->special.vorbis.p_comment );
++            FREENULL( p_stream->special.vorbis.p_comment );
++        }
+         p_stream->special.vorbis.i_headers_flags = 0;
+     }
+ #else
diff --git a/multimedia/VLC/files/files/old/patch-strverscmp.diff b/multimedia/VLC/files/files/old/patch-strverscmp.diff
new file mode 100644
index 0000000..26dd537
--- /dev/null
+++ b/multimedia/VLC/files/files/old/patch-strverscmp.diff
@@ -0,0 +1,39 @@
+diff --git compat/strverscmp.c compat/strverscmp.c
+index 0487592..475531c 100644
+--- compat/strverscmp.c
++++ compat/strverscmp.c
+@@ -67,6 +67,11 @@ int strverscmp (const char *s1, const char *s2)
+ 
+   if (p1 == p2)
+     return 0;
++  // handle the easy inequalities:
++  else if (p1 == NULL)
++    return -999;
++  else if (p2 == NULL)
++    return 999;
+ 
+   unsigned char c1 = *p1++;
+   unsigned char c2 = *p2++;
+@@ -76,8 +81,9 @@ int strverscmp (const char *s1, const char *s2)
+   int diff;
+   while ((diff = c1 - c2) == 0)
+     {
+-      if (c1 == '\0')
+-	return diff;
++      // is there a reason we don't check against a nullbyte in p2 here?
++      if (c1 == '\0' || c2 == '\0')
++        return diff;
+ 
+       state = next_state[state];
+       c1 = *p1++;
+@@ -94,8 +100,8 @@ int strverscmp (const char *s1, const char *s2)
+ 
+     case LEN:
+       while (isdigit (*p1++))
+-	if (!isdigit (*p2++))
+-	  return 1;
++        if (!isdigit (*p2++))
++          return 1;
+ 
+       return isdigit (*p2) ? -1 : diff;
+ 
diff --git a/multimedia/VLC/files/files/old/patch-vlc-for-macports-old.diff b/multimedia/VLC/files/files/old/patch-vlc-for-macports-old.diff
new file mode 100644
index 0000000..935e7ba
--- /dev/null
+++ b/multimedia/VLC/files/files/old/patch-vlc-for-macports-old.diff
@@ -0,0 +1,160 @@
+diff --git modules/lua/vlc.c modules/lua/vlc.c
+index 14b5520..92668f1 100644
+--- modules/lua/vlc.c
++++ modules/lua/vlc.c
+@@ -234,10 +234,22 @@ int vlclua_dir_list( const char *luadirname, char ***pppsz_dir_list )
+             i++;
+ 
+ #if defined(__APPLE__)
+-        if( likely(asprintf( &ppsz_dir_list[i],
++        if( strcasestr (psz_datapath, "/share") == NULL
++            && likely(asprintf( &ppsz_dir_list[i],
+                              "%s"DIR_SEP"share"DIR_SEP"lua"DIR_SEP"%s",
+                              psz_datapath, luadirname ) != -1) )
+             i++;
++        // When installed through MacPorts (or Fink, or HomeBrew, or...?) we do have
++        // meta/reader under LibDir/lua (/opt/local/lib/vlc/lua for MacPorts's standard install prefix)
++        // so we add that location at the end.
++        char *psz_libpath = config_GetLibDir();
++        if( likely(psz_libpath != NULL) )
++        {
++            if( likely(asprintf( &ppsz_dir_list[i], "%s"DIR_SEP"lua"DIR_SEP"%s",
++                                 psz_libpath, luadirname ) != -1) )
++                i++;
++            free( psz_libpath );
++        }
+ #endif
+         free( psz_datapath );
+     }
+diff --git src/darwin/dirs.c src/darwin/dirs.c
+index 83c27a4..7e8b0cb 100644
+--- src/darwin/dirs.c
++++ src/darwin/dirs.c
+@@ -42,6 +42,14 @@
+ # define MAXPATHLEN 1024
+ #endif
+ 
++// this is set to true in config_GetLibDir() if it detects we're installed
++// in a (linux-specific) posix way.
++static int libDirIsPosix = FALSE;
++
++// 20150205: we should do case-insensitive filename comparisons. HFS is case-insensitive by default,
++// and while it strives to preserve case there is no guarantee that case folding will never occur,
++// especially in directory components.
++
+ static char *config_GetLibPath (void)
+ {
+     /* Get the full program path and name */
+@@ -49,7 +57,7 @@ static char *config_GetLibPath (void)
+     for (unsigned i = 0; i < _dyld_image_count(); i++)
+     {
+         const char *psz_img_name = _dyld_get_image_name(i);
+-        const char *p = strstr( psz_img_name, "VLCKit.framework/Versions/" );
++        const char *p = strcasestr( psz_img_name, "VLCKit.framework/Versions/" );
+ 
+         /* Check for "VLCKit.framework/Versions/Current/VLCKit",
+          * as well as "VLCKit.framework/Versions/A/VLCKit" and
+@@ -61,26 +69,26 @@ static char *config_GetLibPath (void)
+             p += strcspn( p, "/" );
+ 
+             /* If the string ends with VLC then we've found a winner */
+-            if ( !strcmp( p, "/VLCKit" ) )
++            if ( !strcasecmp( p, "/VLCKit" ) )
+                 return strdup( psz_img_name );
+         }
+ 
+-        /* Do we end by "VLC"? If so we are the legacy VLC.app that doesn't
++        /* Do we end in "MacOS/VLC"? If so we are the legacy (?!) VLC.app that doesn't
+          * link to VLCKit. */
+         size_t len = strlen(psz_img_name);
+-        if( len >= 3 && !strcmp( psz_img_name + len - 3, "VLC") )
++        if( len >= 9 && !strcasecmp( psz_img_name + len - 9, "MacOS/VLC") )
+             return strdup( psz_img_name );
+ 
+-        /* Do we end by "VLC-Plugin"? oh, we must be the NPAPI plugin */
+-        if( len >= 10 && !strcmp( psz_img_name + len - 10, "VLC-Plugin") )
++        /* Do we end in "VLC-Plugin"? oh, we must be the NPAPI plugin */
++        if( len >= 10 && !strcasecmp( psz_img_name + len - 10, "VLC-Plugin") )
+             return strdup( psz_img_name );
+     }
+ 
+-    /* We are not linked to the VLC.framework, let's use dladdr to figure
+-     * libvlc path */
++    /* We are not linked to the VLC.framework, we'rebreak not VLC.app either,
++     * so let's use dladdr to figure the libvlc path */
+     Dl_info info;
+     if( dladdr(system_Init, &info) )
+-        return strdup(dirname( info.dli_fname ));
++        return strdup(dirname( (char*)info.dli_fname ));
+ 
+     char path[MAXPATHLEN+1];
+     uint32_t path_len = sizeof(path) - 1;
+@@ -99,6 +107,19 @@ char *config_GetLibDir (void)
+         if (p != NULL)
+         {
+             *p = '\0';
++            p = strrchr (path, '.');
++            if (p == NULL || !strcasestr(p, ".app/Contents/MacOS"))
++            {
++                // we're NOT running an OS X style app bundle;
++                // return the Linux/POSIX style LibDir.
++                free(path);
++                path = strdup (PKGLIBDIR);
++                libDirIsPosix = TRUE;
++            }
++            else
++            {
++                libDirIsPosix = FALSE;
++            }
+             return path;
+         }
+         free (path);
+@@ -115,8 +136,26 @@ char *config_GetDataDir (void)
+         return strdup (path);
+ 
+     char *vlcpath = config_GetLibDir ();
+-    char *datadir;
++    char *datadir = NULL;
+ 
++    if (libDirIsPosix)
++    {
++        // vlcpath should point to something like /opt/local/lib/vlc
++        // if so, we can chop off the /lib/vlc bit, and then add /share
++        // like we would otherwise.
++        char *p = strcasestr (vlcpath, "/lib/");
++        if (p != NULL)
++        {
++            *p = '\0';
++        }
++        else
++        {
++            // something else ... return PKGDATADIR
++            free(vlcpath);
++            datadir = strdup(PKGDATADIR);
++            return datadir;
++        }
++    }
+     if (asprintf (&datadir, "%s/share", vlcpath) == -1)
+         datadir = NULL;
+ 
+diff --git src/interface/interface.c src/interface/interface.c
+index b1dcfaf..f31a4a5 100644
+--- src/interface/interface.c
++++ src/interface/interface.c
+@@ -113,8 +113,14 @@ int intf_Create( vlc_object_t *p_this, const char *chain )
+     char *module;
+     char *psz_tmp = config_ChainCreate( &module, &p_intf->p_cfg,
+                                         psz_parser );
+-    free( psz_tmp );
+-    free( psz_parser );
++    if (psz_tmp)
++    {
++        free( psz_tmp );
++    }
++    if (psz_parser)
++    {
++        free( psz_parser );
++    }
+     p_intf->p_module = module_need( p_intf, "interface", module, true );
+     free(module);
+     if( p_intf->p_module == NULL )
diff --git a/multimedia/VLC/files/files/old/patch-vlc-for-macports2.diff b/multimedia/VLC/files/files/old/patch-vlc-for-macports2.diff
new file mode 100644
index 0000000..1ed96ee
--- /dev/null
+++ b/multimedia/VLC/files/files/old/patch-vlc-for-macports2.diff
@@ -0,0 +1,135 @@
+diff --git src/darwin/dirs.c src/darwin/dirs.c
+index 381729c..9174602 100644
+--- src/darwin/dirs.c
++++ src/darwin/dirs.c
+@@ -43,14 +43,20 @@
+ # define MAXPATHLEN 1024
+ #endif
+ 
+-char *config_GetLibDir (void)
++// 20150205: we should do case-insensitive filename comparisons. HFS is case-insensitive by default,
++// and while it strives to preserve case there is no guarantee that case folding will never occur,
++// especially in directory components.
++
++// @p libDirIsPosix is set to true in if getLibDir() detects we're installed
++// in a (linux-specific) posix way, like e.g. MacPorts would do.
++char *getLibDir (bool *libDirIsPosix)
+ {
++    *libDirIsPosix = FALSE;
+     /* Get the full program path and name */
+     /* First try to see if we are linked to the framework */
+-    for (unsigned i = 0; i < _dyld_image_count(); i++)
+-    {
++    for (unsigned i = 0; i < _dyld_image_count(); i++) {
+         const char *psz_img_name = _dyld_get_image_name(i);
+-        const char *p = strstr( psz_img_name, "VLCKit.framework/Versions/" );
++        const char *p = strcasestr( psz_img_name, "VLCKit.framework/Versions/" );
+ 
+         /* Check for "VLCKit.framework/Versions/Current/VLCKit",
+          * as well as "VLCKit.framework/Versions/A/VLCKit" and
+@@ -61,18 +67,18 @@ char *config_GetLibDir (void)
+             p += strcspn( p, "/" );
+ 
+             /* If the string ends with VLCKit then we've found a winner */
+-            if (!strcmp( p, "/VLCKit"))
++            if (!strcasecmp( p, "/VLCKit"))
+                 return strdup( dirname(psz_img_name) );
+         }
+ 
+-        /* Do we end by "VLC"? If so we are the legacy VLC.app that doesn't
++        /* Do we end by "MacOS/VLC"? If so we are the legacy VLC.app that doesn't
+          * link to VLCKit. */
+         size_t len = strlen(psz_img_name);
+-        if (len >= 3 && !strcmp( psz_img_name + len - 3, "VLC"))
++        if (len >= 9 && !strcasecmp( psz_img_name + len - 9, "MacOS/VLC"))
+             return strdup( dirname(psz_img_name) );
+ 
+         /* Do we end by "VLC-Plugin"? oh, we must be the NPAPI plugin */
+-        if (len >= 10 && !strcmp( psz_img_name + len - 10, "VLC-Plugin"))
++        if (len >= 10 && !strcasecmp( psz_img_name + len - 10, "VLC-Plugin"))
+             return strdup( dirname(psz_img_name) );
+     }
+ 
+@@ -84,6 +90,7 @@ char *config_GetLibDir (void)
+         char *path = NULL;
+         asprintf(&path, "%s/"PACKAGE, incompletepath);
+         free(incompletepath);
++        *libDirIsPosix = TRUE;
+         return path;
+     }
+ 
+@@ -91,15 +98,37 @@ char *config_GetLibDir (void)
+     abort ();
+ }
+ 
++char *config_GetLibDir (void)
++{
++    bool isPosixStub;
++    return getLibDir (&isPosixStub);
++}
++
+ char *config_GetDataDir (void)
+ {
+     const char *path = getenv ("VLC_DATA_PATH");
+     if (path)
+         return strdup (path);
+ 
+-    char *vlcpath = config_GetLibDir ();
+-    char *datadir;
++    bool libDirIsPosix;
++    char *vlcpath = getLibDir (&libDirIsPosix);
++    char *datadir = NULL;
+ 
++    if (libDirIsPosix) {
++        // vlcpath should point to something like /opt/local/lib/vlc
++        // if so, we can chop off the /lib/vlc bit, and then add /share
++        // like we would otherwise.
++        char *p = strcasestr(vlcpath, "/lib/");
++        if (p != NULL) {
++            *p = '\0';
++        }
++        else {
++            // something else ... return PKGDATADIR
++            free(vlcpath);
++            datadir = strdup(PKGDATADIR);
++            return datadir;
++        }
++    }
+     if (asprintf (&datadir, "%s/share", vlcpath) == -1)
+         datadir = NULL;
+ 
+@@ -137,16 +166,24 @@ static char *getAppDependentDir(vlc_userdir_t type)
+     }
+ 
+     // Default fallback
+-    const char *name = "org.videolan.vlc";
+-
+-    CFBundleRef mainBundle = CFBundleGetMainBundle();
+-    if (mainBundle) {
+-        CFStringRef identifierAsNS = CFBundleGetIdentifier(mainBundle);
+-        if (identifierAsNS) {
+-            char identifier[256];
+-            Boolean ret = CFStringGetCString(identifierAsNS, identifier, sizeof(identifier), kCFStringEncodingUTF8);
+-            if (ret)
+-                name = identifier;            
++    char name[256] = "org.videolan.vlc";
++    bool libDirIsPosix;
++    char *vlcpath = getLibDir(&libDirIsPosix);
++    if (vlcpath) {
++        free(vlcpath);
++    }
++
++    if (!libDirIsPosix) {
++        CFBundleRef mainBundle = CFBundleGetMainBundle();
++        if (mainBundle) {
++            CFStringRef identifierAsNS = CFBundleGetIdentifier(mainBundle);
++            if (identifierAsNS) {
++                char identifier[256];
++                Boolean ret = CFStringGetCString(identifierAsNS, identifier, sizeof(identifier), kCFStringEncodingUTF8);
++                // Don't use an empty identifier (= the application that links to us doesn't have a CFBundleIdentifier set).
++                if (ret && strlen(identifier))
++                    strcpy(name, identifier);
++            }
+         }
+     }
+ 
diff --git a/multimedia/VLC/files/files/old/qtkit.patch b/multimedia/VLC/files/files/old/qtkit.patch
new file mode 100644
index 0000000..e69de29
diff --git a/multimedia/VLC/files/files/old/vlc b/multimedia/VLC/files/files/old/vlc
new file mode 100644
index 0000000..9337b06
--- /dev/null
+++ b/multimedia/VLC/files/files/old/vlc
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+exec @APPLICATIONS_DIR@/VLC.app/Contents/MacOS/VLC "$@"
diff --git a/multimedia/VLC/files/files/patch-ffmpeg3-compat.diff b/multimedia/VLC/files/files/patch-ffmpeg3-compat.diff
new file mode 100644
index 0000000..7dc5411
--- /dev/null
+++ b/multimedia/VLC/files/files/patch-ffmpeg3-compat.diff
@@ -0,0 +1,231 @@
+Submitted By:            Armin K <krejzi au email do com>
+Date:                    2016-05-06
+Initial Package Version: 2.2.3
+Upstream Status:         Committed
+Origin:                  Upstream
+Description:             Fixes building against ffmpeg3
+                         Rediffed for version 2.2.3 by Bruce Dubbs
+
+diff -Naur  configure  configure
+---  configure	2016-04-04 19:45:51.000000000 -0500
++++  configure	2016-05-06 22:39:24.859030920 -0500
+@@ -36549,7 +36549,7 @@
+ 
+     if test -n "$PKG_CONFIG" && \
+     { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libavutil < 55\""; } >&5
+-  ($PKG_CONFIG --exists --print-errors "libavutil < 55") 2>&5
++  ($PKG_CONFIG --exists --print-errors "libavutil > 55") 2>&5
+   ac_status=$?
+   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+   test $ac_status = 0; }; then
+@@ -36843,7 +36843,7 @@
+     ffmpeg)
+       if test -n "$PKG_CONFIG" && \
+     { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libavcodec >= 57.10.100\""; } >&5
+-  ($PKG_CONFIG --exists --print-errors "libavcodec >= 57.10.100") 2>&5
++  ($PKG_CONFIG --exists --print-errors "libavcodec >= 60.10.100") 2>&5
+   ac_status=$?
+   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+   test $ac_status = 0; }; then
+@@ -36927,7 +36927,7 @@
+       ffmpeg)
+         if test -n "$PKG_CONFIG" && \
+     { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libavcodec >= 57.10.100\""; } >&5
+-  ($PKG_CONFIG --exists --print-errors "libavcodec >= 57.10.100") 2>&5
++  ($PKG_CONFIG --exists --print-errors "libavcodec >= 60.10.100") 2>&5
+   ac_status=$?
+   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+   test $ac_status = 0; }; then
+@@ -45119,7 +45119,7 @@
+     ffmpeg) av_vdpau_ver="55.42.100"
+       if test -n "$PKG_CONFIG" && \
+     { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libavcodec >= 57.10.100\""; } >&5
+-  ($PKG_CONFIG --exists --print-errors "libavcodec >= 57.10.100") 2>&5
++  ($PKG_CONFIG --exists --print-errors "libavcodec >= 60.10.100") 2>&5
+   ac_status=$?
+   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+   test $ac_status = 0; }; then
+diff -Naur  modules/codec/avcodec/audio.c  modules/codec/avcodec/audio.c
+---  modules/codec/avcodec/audio.c	2015-12-08 10:18:56.000000000 -0600
++++  modules/codec/avcodec/audio.c	2016-05-06 22:39:24.859030920 -0500
+@@ -36,12 +36,11 @@
+ #include <vlc_codec.h>
+ #include <vlc_avcodec.h>
+ 
++#include "avcodec.h"
++
+ #include <libavcodec/avcodec.h>
+ #include <libavutil/mem.h>
+ 
+-#include <libavutil/audioconvert.h>
+-
+-#include "avcodec.h"
+ 
+ /*****************************************************************************
+  * decoder_sys_t : decoder descriptor
+diff -Naur  modules/codec/avcodec/avcommon_compat.h  modules/codec/avcodec/avcommon_compat.h
+---  modules/codec/avcodec/avcommon_compat.h	2015-03-01 08:07:35.000000000 -0600
++++  modules/codec/avcodec/avcommon_compat.h	2016-05-06 22:39:24.859030920 -0500
+@@ -506,6 +506,15 @@
+ 
+ #endif /* HAVE_LIBAVUTIL_AVUTIL_H */
+ 
++#if LIBAVUTIL_VERSION_MAJOR >= 55
++# define FF_API_AUDIOCONVERT 1
++#endif
++
++/* libavutil/pixfmt.h */
++#ifndef PixelFormat
++# define PixelFormat AVPixelFormat
++#endif
++
+ #ifdef HAVE_LIBAVFORMAT_AVFORMAT_H
+ # include <libavformat/avformat.h>
+ 
+diff -Naur  modules/codec/avcodec/encoder.c  modules/codec/avcodec/encoder.c
+---  modules/codec/avcodec/encoder.c	2015-10-21 11:36:45.000000000 -0500
++++  modules/codec/avcodec/encoder.c	2016-05-06 22:39:24.860030887 -0500
+@@ -41,7 +41,6 @@
+ #include <vlc_cpu.h>
+ 
+ #include <libavcodec/avcodec.h>
+-#include <libavutil/audioconvert.h>
+ 
+ #include "avcodec.h"
+ #include "avcommon.h"
+@@ -311,7 +310,7 @@
+     else if( !GetFfmpegCodec( p_enc->fmt_out.i_codec, &i_cat, &i_codec_id,
+                              &psz_namecodec ) )
+     {
+-        if( FindFfmpegChroma( p_enc->fmt_out.i_codec ) == PIX_FMT_NONE )
++        if( FindFfmpegChroma( p_enc->fmt_out.i_codec ) == AV_PIX_FMT_NONE )
+             return VLC_EGENERIC; /* handed chroma output */
+ 
+         i_cat      = VIDEO_ES;
+@@ -1017,7 +1016,7 @@
+         }
+     }
+ 
+-    p_sys->frame = avcodec_alloc_frame();
++    p_sys->frame = av_frame_alloc();
+     if( !p_sys->frame )
+     {
+         goto error;
+@@ -1088,7 +1087,8 @@
+     AVFrame *frame = NULL;
+     if( likely(p_pict) ) {
+         frame = p_sys->frame;
+-        avcodec_get_frame_defaults( frame );
++        av_frame_unref( frame );
++
+         for( i_plane = 0; i_plane < p_pict->i_planes; i_plane++ )
+         {
+             p_sys->frame->data[i_plane] = p_pict->p[i_plane].p_pixels;
+@@ -1329,7 +1329,7 @@
+     //How much we need to copy from new packet
+     const int leftover = leftover_samples * p_sys->p_context->channels * p_sys->i_sample_bytes;
+ 
+-    avcodec_get_frame_defaults( p_sys->frame );
++    av_frame_unref( p_sys->frame );
+     p_sys->frame->format     = p_sys->p_context->sample_fmt;
+     p_sys->frame->nb_samples = leftover_samples + p_sys->i_samples_delay;
+ 
+@@ -1451,7 +1451,8 @@
+     while( ( p_aout_buf->i_nb_samples >= p_sys->i_frame_size ) ||
+            ( p_sys->b_variable && p_aout_buf->i_nb_samples ) )
+     {
+-        avcodec_get_frame_defaults( p_sys->frame );
++        av_frame_unref( p_sys->frame );
++
+         if( p_sys->b_variable )
+             p_sys->frame->nb_samples = p_aout_buf->i_nb_samples;
+         else
+diff -Naur  modules/codec/avcodec/vaapi.c  modules/codec/avcodec/vaapi.c
+---  modules/codec/avcodec/vaapi.c	2014-11-16 12:57:58.000000000 -0600
++++  modules/codec/avcodec/vaapi.c	2016-05-06 22:39:24.860030887 -0500
+@@ -595,7 +595,7 @@
+         return err;
+ 
+     /* Only VLD supported */
+-    p_va->pix_fmt = PIX_FMT_VAAPI_VLD;
++    p_va->pix_fmt = AV_PIX_FMT_VAAPI_VLD;
+     p_va->setup = Setup;
+     p_va->get = Get;
+     p_va->release = Release;
+diff -Naur  modules/codec/avcodec/video.c  modules/codec/avcodec/video.c
+---  modules/codec/avcodec/video.c	2016-04-04 19:45:24.000000000 -0500
++++  modules/codec/avcodec/video.c	2016-05-06 22:39:24.860030887 -0500
+@@ -234,7 +234,7 @@
+     p_sys->p_codec = p_codec;
+     p_sys->i_codec_id = i_codec_id;
+     p_sys->psz_namecodec = psz_namecodec;
+-    p_sys->p_ff_pic = avcodec_alloc_frame();
++    p_sys->p_ff_pic = av_frame_alloc();
+     p_sys->b_delayed_open = true;
+     p_sys->p_va = NULL;
+     vlc_sem_init( &p_sys->sem_mt, 0 );
+@@ -446,7 +446,7 @@
+     if( ffmpeg_OpenCodec( p_dec ) < 0 )
+     {
+         msg_Err( p_dec, "cannot open codec (%s)", p_sys->psz_namecodec );
+-        avcodec_free_frame( &p_sys->p_ff_pic );
++        av_frame_free( &p_sys->p_ff_pic );
+         vlc_sem_destroy( &p_sys->sem_mt );
+         free( p_sys );
+         return VLC_EGENERIC;
+@@ -826,7 +826,7 @@
+     wait_mt( p_sys );
+ 
+     if( p_sys->p_ff_pic )
+-        avcodec_free_frame( &p_sys->p_ff_pic );
++        av_frame_free( &p_sys->p_ff_pic );
+ 
+     if( p_sys->p_va )
+         vlc_va_Delete( p_sys->p_va );
+diff -Naur  configure.ac  configure.ac
+--- configure.ac.orig	2017-07-14 17:31:03.000000000 +0200
++++ configure.ac	2017-07-14 17:19:32.000000000 +0200
+@@ -2305,8 +2305,8 @@
+ [  --enable-avcodec        libavcodec codec (default enabled)])
+ AS_IF([test "${enable_avcodec}" != "no"], [
+   PKG_CHECK_MODULES(AVCODEC,[libavcodec >= 53.34.0 libavutil >= 51.22.0], [
+-    PKG_CHECK_EXISTS([libavutil < 55],, [
+-      AC_MSG_ERROR([libavutil versions 55 and later are not supported.])
++    PKG_CHECK_EXISTS([libavutil < 56],, [
++      AC_MSG_ERROR([libavutil versions 56 and later are not supported.])
+     ])
+     VLC_SAVE_FLAGS
+     CPPFLAGS="${CPPFLAGS} ${AVCODEC_CFLAGS}"
+@@ -2364,8 +2364,8 @@
+ AS_IF([test "${have_vaapi}" = "yes" -a "${have_avcodec}" = "yes"], [
+   case "${avfork}" in
+     ffmpeg)
+-      PKG_CHECK_EXISTS([libavcodec >= 57.10.100], [
+-        AC_MSG_ERROR([VA API requires FFmpeg libavcodec < 57.10 or libav.])
++      PKG_CHECK_EXISTS([libavcodec >= 60.10.100], [
++        AC_MSG_ERROR([VA API requires FFmpeg libavcodec < 60.10 or libav.])
+       ])
+       ;;
+   esac
+@@ -2398,8 +2398,8 @@
+   AS_IF([test "x${have_avcodec}" = "xyes"], [
+     case "${avfork}" in
+       ffmpeg)
+-        PKG_CHECK_EXISTS([libavcodec >= 57.10.100], [
+-          AC_MSG_ERROR([DXVA2 requires FFmpeg libavcodec < 57.10 or libav.])
++        PKG_CHECK_EXISTS([libavcodec >= 60.10.100], [
++          AC_MSG_ERROR([DXVA2 requires FFmpeg libavcodec < 60.10 or libav.])
+         ])
+         ;;
+     esac
+@@ -3162,8 +3162,8 @@
+   case "${avfork}" in
+     libav) av_vdpau_ver="55.26.0" ;;
+     ffmpeg) av_vdpau_ver="55.42.100"
+-      PKG_CHECK_EXISTS([libavcodec >= 57.10.100], [
+-        AC_MSG_ERROR([VDPAU requires FFmpeg libavcodec < 57.10 or libav.])
++      PKG_CHECK_EXISTS([libavcodec >= 60.10.100], [
++        AC_MSG_ERROR([VDPAU requires FFmpeg libavcodec < 60.10 or libav.])
+       ])
+       ;;
+   esac
diff --git a/multimedia/VLC/files/files/patch-ffmpegVLC.diff b/multimedia/VLC/files/files/patch-ffmpegVLC.diff
new file mode 100644
index 0000000..c005003
--- /dev/null
+++ b/multimedia/VLC/files/files/patch-ffmpegVLC.diff
@@ -0,0 +1,82 @@
+--- orig.configure.ac	2016-05-31 18:11:07.000000000 +0200
++++ configure.ac	2016-07-04 23:04:07.557682616 +0200
+@@ -2283,7 +2272,7 @@
+ AM_CONDITIONAL([MERGE_FFMPEG], [test "$enable_merge_ffmpeg" != "no"])
+ 
+ AC_MSG_CHECKING([for libavutil variant])
+-PKG_CHECK_EXISTS([libavutil], [
++PKG_CHECK_EXISTS([libavutil-VLC], [
+   libavutil_version="$(${PKG_CONFIG} --modversion libavutil)"
+   libavutil_micro="${libavutil_version##*.}"
+   AS_IF([test ${libavutil_micro} -le 99], [
+@@ -2322,8 +2311,8 @@
+ AC_ARG_ENABLE(avcodec,
+ [  --enable-avcodec        libavcodec codec (default enabled)])
+ AS_IF([test "${enable_avcodec}" != "no"], [
+-  PKG_CHECK_MODULES(AVCODEC,[libavcodec >= 53.34.0 libavutil >= 51.22.0], [
+-    PKG_CHECK_EXISTS([libavutil < 55],, [
++  PKG_CHECK_MODULES(AVCODEC,[libavcodec-VLC >= 53.34.0 libavutil-VLC >= 51.22.0], [
++    PKG_CHECK_EXISTS([libavutil-VLC < 55],, [
+       AC_MSG_ERROR([libavutil versions 55 and later are not supported.])
+     ])
+     VLC_SAVE_FLAGS
+@@ -2382,7 +2371,7 @@
+ AS_IF([test "${have_vaapi}" = "yes" -a "${have_avcodec}" = "yes"], [
+   case "${avfork}" in
+     ffmpeg)
+-      PKG_CHECK_EXISTS([libavcodec >= 57.10.100], [
++      PKG_CHECK_EXISTS([libavcodec-VLC >= 57.10.100], [
+         AC_MSG_ERROR([VA API requires FFmpeg libavcodec < 57.10 or libav.])
+       ])
+       ;;
+@@ -2416,7 +2405,7 @@
+   AS_IF([test "x${have_avcodec}" = "xyes"], [
+     case "${avfork}" in
+       ffmpeg)
+-        PKG_CHECK_EXISTS([libavcodec >= 57.10.100], [
++        PKG_CHECK_EXISTS([libavcodec-VLC >= 57.10.100], [
+           AC_MSG_ERROR([DXVA2 requires FFmpeg libavcodec < 57.10 or libav.])
+         ])
+         ;;
+@@ -2496,7 +2485,7 @@
+ ])
+ have_avformat="no"
+ AS_IF([test "${enable_avformat}" != "no"], [
+-  PKG_CHECK_MODULES(AVFORMAT,[libavformat >= 53.21.0 libavcodec libavutil], [
++  PKG_CHECK_MODULES(AVFORMAT,[libavformat-VLC >= 53.21.0 libavcodec-VLC libavutil-VLC], [
+       have_avformat="yes"
+       VLC_SAVE_FLAGS
+       CPPFLAGS="${CPPFLAGS} ${AVFORMAT_CFLAGS}"
+@@ -2523,7 +2512,7 @@
+           (default enabled)]))
+ if test "${enable_swscale}" != "no"
+ then
+-  PKG_CHECK_MODULES(SWSCALE,[libswscale],
++  PKG_CHECK_MODULES(SWSCALE,[libswscale-VLC],
+     [
+       VLC_SAVE_FLAGS
+       CPPFLAGS="${CPPFLAGS} ${SWSCALE_CFLAGS}"
+@@ -2550,7 +2539,7 @@
+ [  --enable-postproc       libpostproc image post-processing (default auto)])
+ if test "${enable_postproc}" != "no"
+ then
+-  PKG_CHECK_MODULES(POSTPROC,[libpostproc libavutil],
++  PKG_CHECK_MODULES(POSTPROC,[libpostproc-VLC libavutil-VLC],
+     [
+       VLC_SAVE_FLAGS
+       CPPFLAGS="${CPPFLAGS} ${POSTPROC_CFLAGS}"
+@@ -3180,12 +3169,12 @@
+   case "${avfork}" in
+     libav) av_vdpau_ver="55.26.0" ;;
+     ffmpeg) av_vdpau_ver="55.42.100"
+-      PKG_CHECK_EXISTS([libavcodec >= 57.10.100], [
++      PKG_CHECK_EXISTS([libavcodec-VLC >= 57.10.100], [
+         AC_MSG_ERROR([VDPAU requires FFmpeg libavcodec < 57.10 or libav.])
+       ])
+       ;;
+   esac
+-  PKG_CHECK_EXISTS([libavutil >= 52.4.0 libavcodec >= ${av_vdpau_ver}], [
++  PKG_CHECK_EXISTS([libavutil-VLC >= 52.4.0 libavcodec-VLC >= ${av_vdpau_ver}], [
+     have_avcodec_vdpau="yes"
+     AC_MSG_NOTICE([VDPAU decoding acceleration activated])
+   ], [
diff --git a/multimedia/VLC/files/files/patch-for-lua52.diff b/multimedia/VLC/files/files/patch-for-lua52.diff
new file mode 100644
index 0000000..01a839f
--- /dev/null
+++ b/multimedia/VLC/files/files/patch-for-lua52.diff
@@ -0,0 +1,50 @@
+diff --git configure.ac configure.ac
+index 95f24fc..15c274b 100644
+--- configure.ac
++++ configure.ac
+@@ -1481,7 +1481,7 @@ AC_ARG_ENABLE(lua,
+     [disable LUA scripting support (default enabled)])])
+ if test "${enable_lua}" != "no"
+ then
+-  PKG_CHECK_MODULES(LUA, lua5.2,
++  PKG_CHECK_MODULES(LUA, lua-5.2,
+     [ have_lua=yes ],
+     [
+     AC_MSG_WARN([${LUA_PKG_ERRORS}, trying lua 5.1 instead])
+@@ -1498,8 +1498,8 @@ then
+           AC_CHECK_HEADERS([lua.h lauxlib.h lualib.h],
+             [],
+             [ have_lua=no ] )
+-          AC_CHECK_LIB(  lua5.2 , luaL_newstate,
+-            [LUA_LIBS="-llua5.2"],
++          AC_CHECK_LIB(  lua-5.2 , luaL_newstate,
++            [LUA_LIBS="-llua-5.2"],
+           AC_CHECK_LIB( lua5.1 , luaL_newstate,
+             [LUA_LIBS="-llua5.1"],
+             AC_CHECK_LIB( lua51 , luaL_newstate,
+@@ -1516,7 +1516,7 @@ then
+       AC_MSG_ERROR([Could not find lua. Lua is needed for some interfaces (rc, telnet, http) as well as many other custom scripts. Use --disable-lua to ignore this error.])
+   fi
+   AC_ARG_VAR([LUAC], [LUA byte compiler])
+-  AC_PATH_PROGS(LUAC,[${LUAC} luac], [false])
++  AC_PATH_PROGS(LUAC,[${LUAC} luac5.2], [false])
+   AS_IF([test "${LUAC}" = "false"], [
+     AC_MSG_ERROR([Could not find the LUA byte compiler.])
+   ])
+diff --git modules/lua/vlc.h modules/lua/vlc.h
+index c7a2913..b5ebbd8 100644
+--- modules/lua/vlc.h
++++ modules/lua/vlc.h
+@@ -39,9 +39,9 @@
+ #include <vlc_demux.h>
+ 
+ #define LUA_COMPAT_MODULE
+-#include <lua.h>        /* Low level lua C API */
+-#include <lauxlib.h>    /* Higher level C API */
+-#include <lualib.h>     /* Lua libs */
++#include <lua-5.2/lua.h>        /* Low level lua C API */
++#include <lua-5.2/lauxlib.h>    /* Higher level C API */
++#include <lua-5.2/lualib.h>     /* Lua libs */
+ #if LUA_VERSION_NUM >= 502
+ #define lua_equal(L,idx1,idx2)		lua_compare(L,(idx1),(idx2),LUA_OPEQ)
+ #define lua_objlen(L,idx)			lua_rawlen(L,idx)
diff --git a/multimedia/VLC/files/files/patch-no-opencv_example.diff b/multimedia/VLC/files/files/patch-no-opencv_example.diff
new file mode 100644
index 0000000..b8c7e82
--- /dev/null
+++ b/multimedia/VLC/files/files/patch-no-opencv_example.diff
@@ -0,0 +1,168 @@
+--- modules/video_filter/orig.Makefile.am	2016-02-24 17:57:51.000000000 +0100
++++ modules/video_filter/Makefile.am	2016-02-24 18:20:24.000000000 +0100
+@@ -257,16 +257,6 @@
+ liboldmovie_plugin_la_LIBADD = $(LIBS_oldmovie)
+ liboldmovie_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(video_filterdir)' $(LDFLAGS_oldmovie)
+ 
+-libopencv_example_plugin_la_SOURCES = $(SOURCES_opencv_example)
+-libopencv_example_plugin_la_CPPFLAGS = $(AM_CPPFLAGS) $(CPPFLAGS_opencv_example) 	-DMODULE_NAME_IS_opencv_example
+-libopencv_example_plugin_la_CFLAGS = $(AM_CFLAGS) $(CFLAGS_opencv_example)
+-libopencv_example_plugin_la_CXXFLAGS = $(AM_CXXFLAGS) $(CXXFLAGS_opencv_example)
+-libopencv_example_plugin_la_OBJCFLAGS = $(AM_OBJCFLAGS) $(OBJCFLAGS_opencv_example)
+-libopencv_example_plugin_la_LIBADD = $(LIBS_opencv_example)
+-libopencv_example_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(video_filterdir)' $(LDFLAGS_opencv_example)
+-EXTRA_LTLIBRARIES += libopencv_example_plugin.la
+-video_filter_LTLIBRARIES += $(LTLIBopencv_example)
+-
+ libopencv_wrapper_plugin_la_SOURCES = $(SOURCES_opencv_wrapper)
+ libopencv_wrapper_plugin_la_CPPFLAGS = $(AM_CPPFLAGS) $(CPPFLAGS_opencv_wrapper) 	-DMODULE_NAME_IS_opencv_wrapper
+ libopencv_wrapper_plugin_la_CFLAGS = $(AM_CFLAGS) $(CFLAGS_opencv_wrapper)
+Exit 1
+--- modules/video_filter/orig.Makefile.in	2016-02-24 17:58:32.000000000 +0100
++++ modules/video_filter/Makefile.in	2016-02-24 18:22:02.000000000 +0100
+@@ -472,15 +472,6 @@
+ 	$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
+ 	$(liboldmovie_plugin_la_CFLAGS) $(CFLAGS) \
+ 	$(liboldmovie_plugin_la_LDFLAGS) $(LDFLAGS) -o $@
+-libopencv_example_plugin_la_DEPENDENCIES = $(am__DEPENDENCIES_1)
+-am__objects_32 = libopencv_example_plugin_la-opencv_example.lo
+-am_libopencv_example_plugin_la_OBJECTS = $(am__objects_32)
+-libopencv_example_plugin_la_OBJECTS =  \
+-	$(am_libopencv_example_plugin_la_OBJECTS)
+-libopencv_example_plugin_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX \
+-	$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CXXLD) \
+-	$(libopencv_example_plugin_la_CXXFLAGS) $(CXXFLAGS) \
+-	$(libopencv_example_plugin_la_LDFLAGS) $(LDFLAGS) -o $@
+ libopencv_wrapper_plugin_la_DEPENDENCIES = $(am__DEPENDENCIES_1)
+ am__objects_33 = libopencv_wrapper_plugin_la-opencv_wrapper.lo
+ am_libopencv_wrapper_plugin_la_OBJECTS = $(am__objects_33)
+@@ -706,7 +697,6 @@
+ 	$(libmotionblur_plugin_la_SOURCES) \
+ 	$(libmotiondetect_plugin_la_SOURCES) \
+ 	$(liboldmovie_plugin_la_SOURCES) \
+-	$(libopencv_example_plugin_la_SOURCES) \
+ 	$(libopencv_wrapper_plugin_la_SOURCES) \
+ 	$(libposterize_plugin_la_SOURCES) \
+ 	$(libpostproc_plugin_la_SOURCES) \
+@@ -746,7 +736,6 @@
+ 	$(libmotionblur_plugin_la_SOURCES) \
+ 	$(libmotiondetect_plugin_la_SOURCES) \
+ 	$(liboldmovie_plugin_la_SOURCES) \
+-	$(libopencv_example_plugin_la_SOURCES) \
+ 	$(libopencv_wrapper_plugin_la_SOURCES) \
+ 	$(libposterize_plugin_la_SOURCES) \
+ 	$(libpostproc_plugin_la_SOURCES) \
+@@ -856,7 +845,6 @@
+ CFLAGS_ogg = @CFLAGS_ogg@
+ CFLAGS_omxil = @CFLAGS_omxil@
+ CFLAGS_omxil_vout = @CFLAGS_omxil_vout@
+-CFLAGS_opencv_example = @CFLAGS_opencv_example@
+ CFLAGS_opencv_wrapper = @CFLAGS_opencv_wrapper@
+ CFLAGS_opus = @CFLAGS_opus@
+ CFLAGS_postproc = @CFLAGS_postproc@
+@@ -924,7 +912,6 @@
+ CPPFLAGS_mux_ogg = @CPPFLAGS_mux_ogg@
+ CPPFLAGS_notify = @CPPFLAGS_notify@
+ CPPFLAGS_ogg = @CPPFLAGS_ogg@
+-CPPFLAGS_opencv_example = @CPPFLAGS_opencv_example@
+ CPPFLAGS_opencv_wrapper = @CPPFLAGS_opencv_wrapper@
+ CPPFLAGS_opus = @CPPFLAGS_opus@
+ CPPFLAGS_qsv = @CPPFLAGS_qsv@
+@@ -1146,7 +1133,6 @@
+ LIBS_ogg = @LIBS_ogg@
+ LIBS_oldmovie = @LIBS_oldmovie@
+ LIBS_oldrc = @LIBS_oldrc@
+-LIBS_opencv_example = @LIBS_opencv_example@
+ LIBS_opencv_wrapper = @LIBS_opencv_wrapper@
+ LIBS_opus = @LIBS_opus@
+ LIBS_param_eq = @LIBS_param_eq@
+@@ -1282,7 +1268,6 @@
+ LTLIBogg = @LTLIBogg@
+ LTLIBomxil = @LTLIBomxil@
+ LTLIBomxil_vout = @LTLIBomxil_vout@
+-LTLIBopencv_example = @LTLIBopencv_example@
+ LTLIBopencv_wrapper = @LTLIBopencv_wrapper@
+ LTLIBopensles_android = @LTLIBopensles_android@
+ LTLIBopus = @LTLIBopus@
+@@ -1594,9 +1579,9 @@
+ 	libwave_plugin.la libgradfun_plugin.la libyuvp_plugin.la \
+ 	libantiflicker_plugin.la libhqdn3d_plugin.la \
+ 	libanaglyph_plugin.la liboldmovie_plugin.la libvhs_plugin.la \
+-	libfreeze_plugin.la $(LTLIBatmo) $(LTLIBopencv_example) \
++	libfreeze_plugin.la $(LTLIBatmo) \
+ 	$(LTLIBopencv_wrapper) $(LTLIBpostproc)
+-EXTRA_LTLIBRARIES = libatmo_plugin.la libopencv_example_plugin.la \
++EXTRA_LTLIBRARIES = libatmo_plugin.la \
+ 	libopencv_wrapper_plugin.la libpostproc_plugin.la
+ EXTRA_DIST = Modules.am
+ AUTOMAKE_OPTIONS = subdir-objects
+@@ -1668,7 +1653,6 @@
+ SOURCES_gradient = gradient.c
+ SOURCES_ball = ball.c
+ SOURCES_opencv_wrapper = opencv_wrapper.c
+-SOURCES_opencv_example = opencv_example.cpp filter_event_info.h
+ librotate_plugin_la_SOURCES = rotate.c
+ librotate_plugin_la_LIBADD = ../control/libvlc_motion.la $(LIBM)
+ librotate_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath \
+@@ -1929,20 +1913,6 @@
+ liboldmovie_plugin_la_OBJCFLAGS = $(AM_OBJCFLAGS) $(OBJCFLAGS_oldmovie)
+ liboldmovie_plugin_la_LIBADD = $(LIBS_oldmovie)
+ liboldmovie_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(video_filterdir)' $(LDFLAGS_oldmovie)
+-libopencv_example_plugin_la_SOURCES = $(SOURCES_opencv_example)
+-libopencv_example_plugin_la_CPPFLAGS = $(AM_CPPFLAGS) $(CPPFLAGS_opencv_example) 	-DMODULE_NAME_IS_opencv_example
+-libopencv_example_plugin_la_CFLAGS = $(AM_CFLAGS) $(CFLAGS_opencv_example)
+-libopencv_example_plugin_la_CXXFLAGS = $(AM_CXXFLAGS) $(CXXFLAGS_opencv_example)
+-libopencv_example_plugin_la_OBJCFLAGS = $(AM_OBJCFLAGS) $(OBJCFLAGS_opencv_example)
+-libopencv_example_plugin_la_LIBADD = $(LIBS_opencv_example)
+-libopencv_example_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(video_filterdir)' $(LDFLAGS_opencv_example)
+-libopencv_wrapper_plugin_la_SOURCES = $(SOURCES_opencv_wrapper)
+-libopencv_wrapper_plugin_la_CPPFLAGS = $(AM_CPPFLAGS) $(CPPFLAGS_opencv_wrapper) 	-DMODULE_NAME_IS_opencv_wrapper
+-libopencv_wrapper_plugin_la_CFLAGS = $(AM_CFLAGS) $(CFLAGS_opencv_wrapper)
+-libopencv_wrapper_plugin_la_CXXFLAGS = $(AM_CXXFLAGS) $(CXXFLAGS_opencv_wrapper)
+-libopencv_wrapper_plugin_la_OBJCFLAGS = $(AM_OBJCFLAGS) $(OBJCFLAGS_opencv_wrapper)
+-libopencv_wrapper_plugin_la_LIBADD = $(LIBS_opencv_wrapper)
+-libopencv_wrapper_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(video_filterdir)' $(LDFLAGS_opencv_wrapper)
+ libposterize_plugin_la_SOURCES = $(SOURCES_posterize)
+ libposterize_plugin_la_CPPFLAGS = $(AM_CPPFLAGS) $(CPPFLAGS_posterize) 	-DMODULE_NAME_IS_posterize
+ libposterize_plugin_la_CFLAGS = $(AM_CFLAGS) $(CFLAGS_posterize)
+@@ -2305,8 +2275,6 @@
+ liboldmovie_plugin.la: $(liboldmovie_plugin_la_OBJECTS) $(liboldmovie_plugin_la_DEPENDENCIES) $(EXTRA_liboldmovie_plugin_la_DEPENDENCIES) 
+ 	$(AM_V_CCLD)$(liboldmovie_plugin_la_LINK) -rpath $(video_filterdir) $(liboldmovie_plugin_la_OBJECTS) $(liboldmovie_plugin_la_LIBADD) $(LIBS)
+ 
+-libopencv_example_plugin.la: $(libopencv_example_plugin_la_OBJECTS) $(libopencv_example_plugin_la_DEPENDENCIES) $(EXTRA_libopencv_example_plugin_la_DEPENDENCIES) 
+-	$(AM_V_CXXLD)$(libopencv_example_plugin_la_LINK)  $(libopencv_example_plugin_la_OBJECTS) $(libopencv_example_plugin_la_LIBADD) $(LIBS)
+ 
+ libopencv_wrapper_plugin.la: $(libopencv_wrapper_plugin_la_OBJECTS) $(libopencv_wrapper_plugin_la_DEPENDENCIES) $(EXTRA_libopencv_wrapper_plugin_la_DEPENDENCIES) 
+ 	$(AM_V_CCLD)$(libopencv_wrapper_plugin_la_LINK)  $(libopencv_wrapper_plugin_la_OBJECTS) $(libopencv_wrapper_plugin_la_LIBADD) $(LIBS)
+@@ -2404,7 +2372,6 @@
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmotionblur_plugin_la-motionblur.Plo@am__quote@
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmotiondetect_plugin_la-motiondetect.Plo@am__quote@
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liboldmovie_plugin_la-oldmovie.Plo@am__quote@
+-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libopencv_example_plugin_la-opencv_example.Plo@am__quote@
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libopencv_wrapper_plugin_la-opencv_wrapper.Plo@am__quote@
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libposterize_plugin_la-posterize.Plo@am__quote@
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpostproc_plugin_la-postproc.Plo@am__quote@
+@@ -3052,12 +3019,6 @@
+ @AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ @am__fastdepCXX_FALSE@	$(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libblend_plugin_la_CPPFLAGS) $(CPPFLAGS) $(libblend_plugin_la_CXXFLAGS) $(CXXFLAGS) -c -o libblend_plugin_la-blend.lo `test -f 'blend.cpp' || echo '$(srcdir)/'`blend.cpp
+ 
+-libopencv_example_plugin_la-opencv_example.lo: opencv_example.cpp
+-@am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libopencv_example_plugin_la_CPPFLAGS) $(CPPFLAGS) $(libopencv_example_plugin_la_CXXFLAGS) $(CXXFLAGS) -MT libopencv_example_plugin_la-opencv_example.lo -MD -MP -MF $(DEPDIR)/libopencv_example_plugin_la-opencv_example.Tpo -c -o libopencv_example_plugin_la-opencv_example.lo `test -f 'opencv_example.cpp' || echo '$(srcdir)/'`opencv_example.cpp
+-@am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libopencv_example_plugin_la-opencv_example.Tpo $(DEPDIR)/libopencv_example_plugin_la-opencv_example.Plo
+-@AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='opencv_example.cpp' object='libopencv_example_plugin_la-opencv_example.lo' libtool=yes @AMDEPBACKSLASH@
+-@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+-@am__fastdepCXX_FALSE@	$(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libopencv_example_plugin_la_CPPFLAGS) $(CPPFLAGS) $(libopencv_example_plugin_la_CXXFLAGS) $(CXXFLAGS) -c -o libopencv_example_plugin_la-opencv_example.lo `test -f 'opencv_example.cpp' || echo '$(srcdir)/'`opencv_example.cpp
+ 
+ mostlyclean-libtool:
+ 	-rm -f *.lo
+Exit 1
+--- modules/video_filter/orig.Modules.am	2015-02-02 20:42:29.000000000 +0100
++++ modules/video_filter/Modules.am	2016-02-24 18:22:23.000000000 +0100
+@@ -65,7 +65,6 @@
+ SOURCES_gradient = gradient.c
+ SOURCES_ball = ball.c
+ SOURCES_opencv_wrapper = opencv_wrapper.c
+-SOURCES_opencv_example = opencv_example.cpp filter_event_info.h
+ 
+ librotate_plugin_la_SOURCES = rotate.c
+ librotate_plugin_la_LIBADD = ../control/libvlc_motion.la $(LIBM)
diff --git a/multimedia/VLC/files/files/patch-opencv_includes.diff b/multimedia/VLC/files/files/patch-opencv_includes.diff
new file mode 100644
index 0000000..36f214e
--- /dev/null
+++ b/multimedia/VLC/files/files/patch-opencv_includes.diff
@@ -0,0 +1,10 @@
+--- modules/video_filter/opencv_wrapper.c.orig	2016-02-23 10:07:58.000000000 +0100
++++ modules/video_filter/opencv_wrapper.c	2016-02-23 10:03:36.000000000 +0100
+@@ -39,6 +39,7 @@
+ #include <vlc_image.h>
+ #include "filter_picture.h"
+ 
++#include <opencv2/core/fast_math.hpp>
+ #include <opencv2/core/core_c.h>
+ #include <opencv2/core/types_c.h>
+ 
diff --git a/multimedia/VLC/files/files/patch-really-no-qtkit.diff b/multimedia/VLC/files/files/patch-really-no-qtkit.diff
new file mode 100644
index 0000000..ff55b3a
--- /dev/null
+++ b/multimedia/VLC/files/files/patch-really-no-qtkit.diff
@@ -0,0 +1,197 @@
+--- modules/gui/macosx/orig.open.m	2016-12-17 19:55:54.000000000 +0100
++++ modules/gui/macosx/open.m	2016-12-17 20:26:12.000000000 +0100
+@@ -40,7 +40,14 @@
+ #import <IOKit/storage/IODVDMedia.h>
+ #import <IOKit/storage/IOBDMedia.h>
+ #import <Cocoa/Cocoa.h>
++#import <AvailabilityMacros.h>
++#if defined(MAC_OS_X_VERSION_10_12) \
++    && ((MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12) || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_12))
++#warning "Excluding all code and features based on QTKit"
++#else
+ #import <QTKit/QTKit.h>
++#define HAVE_QTKIT
++#endif
+ 
+ #import "intf.h"
+ #import "playlist.h"
+@@ -51,8 +58,10 @@
+ 
+ #import <vlc_url.h>
+ 
++#ifdef HAVE_QTKIT
+ NSArray *qtkvideoDevices;
+ NSArray *qtkaudioDevices;
++#endif
+ #define setEyeTVUnconnected \
+ [o_capture_lbl setStringValue: _NS("No device is selected")]; \
+ [o_capture_long_lbl setStringValue: _NS("No device is selected.\n\nChoose available device in above pull-down menu.\n")]; \
+@@ -207,7 +216,9 @@
+     [o_screen_width_lbl setStringValue: [NSString stringWithFormat:@"%@:",_NS("Subscreen width")]];
+     [o_screen_height_lbl setStringValue: [NSString stringWithFormat:@"%@:",_NS("Subscreen height")]];
+     [o_screen_follow_mouse_ckb setTitle: _NS("Follow the mouse")];
++#ifdef HAVE_QTKIT
+     [o_screen_qtk_audio_ckb setTitle: _NS("Capture Audio")];
++#endif
+     [o_eyetv_currentChannel_lbl setStringValue: _NS("Current channel:")];
+     [o_eyetv_previousProgram_btn setTitle: _NS("Previous Channel")];
+     [o_eyetv_nextProgram_btn setTitle: _NS("Next Channel")];
+@@ -223,6 +234,7 @@
+     [o_file_starttime_fld setFormatter:[[[PositionFormatter alloc] init] autorelease]];
+     [o_file_stoptime_fld setFormatter:[[[PositionFormatter alloc] init] autorelease]];
+ 
++#ifdef HAVE_QTKIT
+     [self qtkvideoDevices];
+     [o_qtk_video_device_pop removeAllItems];
+     msg_Dbg(VLCIntf, "Found %lu video capture devices", [qtkvideoDevices count]);
+@@ -275,6 +287,7 @@
+         [o_screen_qtk_audio_pop addItemWithTitle: _NS("None")];
+         [qtkaudio_currdevice_uid release];
+     }
++#endif
+ 
+     [self setSubPanel];
+ 
+@@ -321,7 +334,9 @@
+     [[sharedWorkspace notificationCenter] addObserver:self selector:@selector(scanOpticalMedia:) name:NSWorkspaceDidMountNotification object:nil];
+     [[sharedWorkspace notificationCenter] addObserver:self selector:@selector(scanOpticalMedia:) name:NSWorkspaceDidUnmountNotification object:nil];
+ 
++#ifdef HAVE_QTKIT
+     [self qtkToggleUIElements:nil];
++#endif
+     [self scanOpticalMedia:nil];
+ 
+     [self setMRL: @""];
+@@ -504,16 +519,20 @@
+                     [o_options addObject: @"screen-follow-mouse"];
+                 else
+                     [o_options addObject: @"no-screen-follow-mouse"];
++#ifdef HAVE_QTKIT
+                 if ([o_screen_qtk_audio_ckb state] && qtkaudio_currdevice_uid)
+                    [o_options addObject: [NSString stringWithFormat: @"input-slave=qtsound://%@", qtkaudio_currdevice_uid]];
++#endif
+             }
+             else if ([[[o_capture_mode_pop selectedItem] title] isEqualToString: _NS("Input Devices")]) {
++#ifdef HAVE_QTKIT
+                 if ([o_qtk_video_ckb state]) {
+                     [o_options addObject: [NSString stringWithFormat: @"qtcapture-width=%i", [o_capture_width_fld intValue]]];
+                     [o_options addObject: [NSString stringWithFormat: @"qtcapture-height=%i", [o_capture_height_fld intValue]]];
+                     if ([o_qtk_audio_ckb state] && qtkaudio_currdevice_uid)
+                        [o_options addObject: [NSString stringWithFormat: @"input-slave=qtsound://%@", qtkaudio_currdevice_uid]];
+                 }
++#endif
+             }
+         }
+ 
+@@ -539,11 +558,14 @@
+     [o_screen_width_stp setMaxValue: item->rect.size.width];
+     [o_screen_height_stp setMaxValue: item->rect.size.height];
+ 
++#ifdef HAVE_QTKIT
+     [o_screen_qtk_audio_pop setEnabled: [o_screen_qtk_audio_ckb state]];
++#endif
+ }
+ 
+ - (IBAction)qtkChanged:(id)sender
+ {
++#ifdef HAVE_QTKIT
+     NSInteger i_selectedDevice = [o_qtk_video_device_pop indexOfSelectedItem];
+     if ([qtkvideoDevices count] >= 1) {
+         NSValue *sizes = [[[[qtkvideoDevices objectAtIndex:i_selectedDevice] formatDescriptions] objectAtIndex:0] attributeForKey: QTFormatDescriptionVideoEncodedPixelsSizeAttribute];
+@@ -554,20 +576,24 @@
+         [o_capture_height_stp setIntValue: [o_capture_height_fld intValue]];
+         qtk_currdevice_uid = [[(QTCaptureDevice *)[qtkvideoDevices objectAtIndex:i_selectedDevice] uniqueID] stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];
+     }
++#endif
+ }
+ 
+ - (IBAction)qtkAudioChanged:(id)sender
+ {
++#ifdef HAVE_QTKIT
+     NSInteger i_selectedDevice = [o_qtk_audio_device_pop indexOfSelectedItem];
+     if ([qtkaudioDevices count] >= 1) {
+         qtkaudio_currdevice_uid = [[(QTCaptureDevice *)[qtkaudioDevices objectAtIndex:i_selectedDevice] uniqueID] stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];
+     }
+     [o_screen_qtk_audio_pop selectItemAtIndex: i_selectedDevice];
+     [o_qtk_audio_device_pop selectItemAtIndex: i_selectedDevice];
++#endif
+ }
+ 
+ - (IBAction)qtkToggleUIElements:(id)sender
+ {
++#ifdef HAVE_QTKIT
+     [o_qtk_audio_device_pop setEnabled:[o_qtk_audio_ckb state]];
+     BOOL b_state = [o_qtk_video_ckb state];
+     [o_qtk_video_device_pop setEnabled:b_state];
+@@ -578,6 +604,7 @@
+     [self qtkAudioChanged:sender];
+     [self qtkChanged:sender];
+     [self openCaptureModeChanged:sender];
++#endif
+ }
+ 
+ #pragma mark -
+@@ -1402,18 +1429,22 @@
+         }
+     }
+     else if ([[[o_capture_mode_pop selectedItem] title] isEqualToString: _NS("Input Devices")]) {
++#ifdef HAVE_QTKIT
+         [self showCaptureView: o_qtk_view];
+         if ([o_capture_width_fld intValue] <= 0)
+             [self qtkChanged:nil];
+ 
+         [self qtkAudioChanged:nil];
++#endif
+ 
+         [self setMRL: @""];
+ 
++#ifdef HAVE_QTKIT
+         if ([o_qtk_video_ckb state] && qtk_currdevice_uid)
+             [self setMRL:[NSString stringWithFormat:@"qtcapture://%@", qtk_currdevice_uid]];
+         else if ([o_qtk_audio_ckb state] && qtkaudio_currdevice_uid)
+             [self setMRL:[NSString stringWithFormat:@"qtsound://%@", qtkaudio_currdevice_uid]];
++#endif
+     }
+ }
+ 
+@@ -1597,28 +1628,40 @@
+ 
+ - (NSArray *)qtkvideoDevices
+ {
++#ifdef HAVE_QTKIT
+     if (!qtkvideoDevices)
+         [self qtkrefreshVideoDevices];
+     return qtkvideoDevices;
++#else
++    return NULL;
++#endif
+ }
+ 
+ - (void)qtkrefreshVideoDevices
+ {
++#ifdef HAVE_QTKIT
+     [qtkvideoDevices release];
+     qtkvideoDevices = [[[QTCaptureDevice inputDevicesWithMediaType:QTMediaTypeVideo] arrayByAddingObjectsFromArray:[QTCaptureDevice inputDevicesWithMediaType:QTMediaTypeMuxed]] retain];
++#endif
+ }
+ 
+ - (NSArray *)qtkaudioDevices
+ {
++#ifdef HAVE_QTKIT
+     if (!qtkaudioDevices)
+         [self qtkrefreshAudioDevices];
+     return qtkaudioDevices;
++#else
++    return NULL;
++#endif
+ }
+ 
+ - (void)qtkrefreshAudioDevices
+ {
++#ifdef HAVE_QTKIT
+     [qtkaudioDevices release];
+     qtkaudioDevices = [[[QTCaptureDevice inputDevicesWithMediaType:QTMediaTypeSound] arrayByAddingObjectsFromArray:[QTCaptureDevice inputDevicesWithMediaType:QTMediaTypeMuxed]] retain];
++#endif
+ }
+ 
+ @end
diff --git a/multimedia/VLC/files/files/patch-simplepreferences.diff b/multimedia/VLC/files/files/patch-simplepreferences.diff
new file mode 100644
index 0000000..62036a7
--- /dev/null
+++ b/multimedia/VLC/files/files/patch-simplepreferences.diff
@@ -0,0 +1,13 @@
+diff --git modules/gui/qt4/components/simple_preferences.cpp modules/gui/qt4/components/simple_preferences.cpp
+index 2487cc4..cfe6a3b 100644
+--- modules/gui/qt4/components/simple_preferences.cpp
++++ modules/gui/qt4/components/simple_preferences.cpp
+@@ -225,7 +225,7 @@ static int getDefaultAudioVolume(vlc_object_t *obj, const char *aout)
+         return -1;
+     else
+ #ifdef __APPLE__
+-    if (!strcmp("auhal") && module_exists("auhal"))
++    if (!strcmp(aout, "auhal") && module_exists("auhal"))
+         return (config_GetFloat(obj, "auhal-volume") * 100.f + .5f)
+                  / AOUT_VOLUME_DEFAULT;
+     else
diff --git a/multimedia/VLC/files/files/patch-soundfont-path.diff b/multimedia/VLC/files/files/patch-soundfont-path.diff
new file mode 100644
index 0000000..bca8b80
--- /dev/null
+++ b/multimedia/VLC/files/files/patch-soundfont-path.diff
@@ -0,0 +1,13 @@
+diff --git modules/codec/fluidsynth.c modules/codec/fluidsynth.c
+index bdc8d24..9859aa1 100644
+--- modules/codec/fluidsynth.c
++++ modules/codec/fluidsynth.c
+@@ -125,7 +125,7 @@ static int Open (vlc_object_t *p_this)
+     {
+         glob_t gl;
+ 
+-        glob ("/usr/share/sounds/sf2/*.sf2", GLOB_NOESCAPE, NULL, &gl);
++        glob ("@PREFIX@/share/sounds/sf2/*.sf2", GLOB_NOESCAPE, NULL, &gl);
+         for (size_t i = 0; i < gl.gl_pathc; i++)
+         {
+             const char *path = gl.gl_pathv[i];
diff --git a/multimedia/VLC/files/files/patch-static_assert.diff b/multimedia/VLC/files/files/patch-static_assert.diff
new file mode 100644
index 0000000..f00a7df
--- /dev/null
+++ b/multimedia/VLC/files/files/patch-static_assert.diff
@@ -0,0 +1,11 @@
+--- config.h.orig    2016-03-22 15:34:33.000000000 +0000
++++ config.h 2016-03-22 15:34:57.000000000 +0000
+@@ -793,6 +793,7 @@
+ /* Define to `int' if <stddef.h> does not define. */
+ /* #undef ssize_t */
+
++#define static_assert _Static_assert
+ #include <vlc_fixups.h>
+
+
+
diff --git a/multimedia/VLC/files/files/patch-use-NSGetEnviron.diff b/multimedia/VLC/files/files/patch-use-NSGetEnviron.diff
new file mode 100644
index 0000000..36d84f2
--- /dev/null
+++ b/multimedia/VLC/files/files/patch-use-NSGetEnviron.diff
@@ -0,0 +1,40 @@
+--- modules/misc/inhibit/orig.xdg.c	2014-08-14 09:20:04.000000000 +0200
++++ modules/misc/inhibit/xdg.c	2017-08-18 14:11:43.000000000 +0200
+@@ -48,7 +48,7 @@
+     posix_spawnattr_t attr;
+ };
+ 
+-extern char **environ;
++#include <crt_externs.h>
+ 
+ static void Timer (void *data)
+ {
+@@ -60,7 +60,7 @@
+     pid_t pid;
+ 
+     int err = posix_spawnp (&pid, "xdg-screensaver", NULL, &sys->attr,
+-                            argv, environ);
++                            argv, *_NSGetEnviron());
+     if (err == 0)
+     {
+         int status;
+--- modules/stream_filter/orig.decomp.c	2015-04-13 21:54:35.000000000 +0200
++++ modules/stream_filter/decomp.c	2017-08-18 14:11:46.000000000 +0200
+@@ -92,7 +92,7 @@
+     int64_t      pts_delay;
+ };
+ 
+-extern char **environ;
++#include <crt_externs.h>
+ 
+ static const size_t bufsize = 65536;
+ #ifdef HAVE_VMSPLICE
+@@ -361,7 +361,7 @@
+                 if (!posix_spawn_file_actions_adddup2 (&actions, comp[0], 0)
+                  && !posix_spawn_file_actions_adddup2 (&actions, uncomp[1], 1)
+                  && !posix_spawnp (&p_sys->pid, path, &actions, NULL, argv,
+-                                   environ))
++                                   *_NSGetEnviron()))
+                 {
+                     if (vlc_clone (&p_sys->thread, Thread, stream,
+                                    VLC_THREAD_PRIORITY_INPUT) == 0)
diff --git a/multimedia/VLC/files/files/patch-vlc-for-macports.diff b/multimedia/VLC/files/files/patch-vlc-for-macports.diff
new file mode 100644
index 0000000..c9e3ebd
--- /dev/null
+++ b/multimedia/VLC/files/files/patch-vlc-for-macports.diff
@@ -0,0 +1,163 @@
+diff --git modules/lua/vlc.c modules/lua/vlc.c
+index df235d0..b753346 100644
+--- modules/lua/vlc.c
++++ modules/lua/vlc.c
+@@ -232,10 +232,22 @@ int vlclua_dir_list( const char *luadirname, char ***pppsz_dir_list )
+             i++;
+
+ #if defined(__APPLE__)
+-        if( likely(asprintf( &ppsz_dir_list[i],
++        if( strcasestr (psz_datapath, "/share") == NULL
++            && likely(asprintf( &ppsz_dir_list[i],
+                              "%s"DIR_SEP"share"DIR_SEP"lua"DIR_SEP"%s",
+                              psz_datapath, luadirname ) != -1) )
+             i++;
++        // When installed through MacPorts (or Fink, or HomeBrew, or...?) we do have
++        // meta/reader under LibDir/lua (/opt/local/lib/vlc/lua for MacPorts's standard install prefix)
++        // so we add that location at the end.
++        char *psz_libpath = config_GetLibDir();
++        if( likely(psz_libpath != NULL) )
++        {
++            if( likely(asprintf( &ppsz_dir_list[i], "%s"DIR_SEP"lua"DIR_SEP"%s",
++                                 psz_libpath, luadirname ) != -1) )
++                i++;
++            free( psz_libpath );
++        }
+ #endif
+         free( psz_datapath );
+     }
+diff --git src/darwin/dirs.c src/darwin/dirs.c
+index 381729c..9174602 100644
+--- src/darwin/dirs.c
++++ src/darwin/dirs.c
+@@ -43,14 +43,20 @@
+ # define MAXPATHLEN 1024
+ #endif
+ 
+-char *config_GetLibDir (void)
++// 20150205: we should do case-insensitive filename comparisons. HFS is case-insensitive by default,
++// and while it strives to preserve case there is no guarantee that case folding will never occur,
++// especially in directory components.
++
++// @p libDirIsPosix is set to true in if getLibDir() detects we're installed
++// in a (linux-specific) posix way, like e.g. MacPorts would do.
++char *getLibDir (bool *libDirIsPosix)
+ {
++    *libDirIsPosix = FALSE;
+     /* Get the full program path and name */
+     /* First try to see if we are linked to the framework */
+-    for (unsigned i = 0; i < _dyld_image_count(); i++)
+-    {
++    for (unsigned i = 0; i < _dyld_image_count(); i++) {
+         const char *psz_img_name = _dyld_get_image_name(i);
+-        const char *p = strstr( psz_img_name, "VLCKit.framework/Versions/" );
++        const char *p = strcasestr( psz_img_name, "VLCKit.framework/Versions/" );
+ 
+         /* Check for "VLCKit.framework/Versions/Current/VLCKit",
+          * as well as "VLCKit.framework/Versions/A/VLCKit" and
+@@ -61,18 +67,18 @@ char *config_GetLibDir (void)
+             p += strcspn( p, "/" );
+ 
+             /* If the string ends with VLCKit then we've found a winner */
+-            if (!strcmp( p, "/VLCKit"))
++            if (!strcasecmp( p, "/VLCKit"))
+                 return strdup( dirname(psz_img_name) );
+         }
+ 
+-        /* Do we end by "VLC"? If so we are the legacy VLC.app that doesn't
++        /* Do we end by "MacOS/VLC"? If so we are the legacy VLC.app that doesn't
+          * link to VLCKit. */
+         size_t len = strlen(psz_img_name);
+-        if (len >= 3 && !strcmp( psz_img_name + len - 3, "VLC"))
++        if (len >= 9 && !strcasecmp( psz_img_name + len - 9, "MacOS/VLC"))
+             return strdup( dirname(psz_img_name) );
+ 
+         /* Do we end by "VLC-Plugin"? oh, we must be the NPAPI plugin */
+-        if (len >= 10 && !strcmp( psz_img_name + len - 10, "VLC-Plugin"))
++        if (len >= 10 && !strcasecmp( psz_img_name + len - 10, "VLC-Plugin"))
+             return strdup( dirname(psz_img_name) );
+     }
+ 
+@@ -84,6 +90,7 @@ char *config_GetLibDir (void)
+         char *path = NULL;
+         asprintf(&path, "%s/"PACKAGE, incompletepath);
+         free(incompletepath);
++        *libDirIsPosix = TRUE;
+         return path;
+     }
+ 
+@@ -91,15 +98,37 @@ char *config_GetLibDir (void)
+     abort ();
+ }
+ 
++char *config_GetLibDir (void)
++{
++    bool isPosixStub;
++    return getLibDir (&isPosixStub);
++}
++
+ char *config_GetDataDir (void)
+ {
+     const char *path = getenv ("VLC_DATA_PATH");
+     if (path)
+         return strdup (path);
+ 
+-    char *vlcpath = config_GetLibDir ();
+-    char *datadir;
++    bool libDirIsPosix;
++    char *vlcpath = getLibDir (&libDirIsPosix);
++    char *datadir = NULL;
+ 
++    if (libDirIsPosix) {
++        // vlcpath should point to something like /opt/local/lib/vlc
++        // if so, we can chop off the /lib/vlc bit, and then add /share
++        // like we would otherwise.
++        char *p = strcasestr(vlcpath, "/lib/");
++        if (p != NULL) {
++            *p = '\0';
++        }
++        else {
++            // something else ... return PKGDATADIR
++            free(vlcpath);
++            datadir = strdup(PKGDATADIR);
++            return datadir;
++        }
++    }
+     if (asprintf (&datadir, "%s/share", vlcpath) == -1)
+         datadir = NULL;
+ 
+@@ -137,16 +166,24 @@ static char *getAppDependentDir(vlc_userdir_t type)
+     }
+ 
+     // Default fallback
+-    const char *name = "org.videolan.vlc";
+-
+-    CFBundleRef mainBundle = CFBundleGetMainBundle();
+-    if (mainBundle) {
+-        CFStringRef identifierAsNS = CFBundleGetIdentifier(mainBundle);
+-        if (identifierAsNS) {
+-            char identifier[256];
+-            Boolean ret = CFStringGetCString(identifierAsNS, identifier, sizeof(identifier), kCFStringEncodingUTF8);
+-            if (ret)
+-                name = identifier;            
++    char name[256] = "org.videolan.vlc";
++    bool libDirIsPosix;
++    char *vlcpath = getLibDir(&libDirIsPosix);
++    if (vlcpath) {
++        free(vlcpath);
++    }
++
++    if (!libDirIsPosix) {
++        CFBundleRef mainBundle = CFBundleGetMainBundle();
++        if (mainBundle) {
++            CFStringRef identifierAsNS = CFBundleGetIdentifier(mainBundle);
++            if (identifierAsNS) {
++                char identifier[256];
++                Boolean ret = CFStringGetCString(identifierAsNS, identifier, sizeof(identifier), kCFStringEncodingUTF8);
++                // Don't use an empty identifier (= the application that links to us doesn't have a CFBundleIdentifier set).
++                if (ret && strlen(identifier))
++                    strcpy(name, identifier);
++            }
+         }
+     }
+ 
diff --git a/multimedia/VLC/files/files/patch-vlc-no-O4.diff b/multimedia/VLC/files/files/patch-vlc-no-O4.diff
new file mode 100644
index 0000000..5226121
--- /dev/null
+++ b/multimedia/VLC/files/files/patch-vlc-no-O4.diff
@@ -0,0 +1,19 @@
+diff --git configure.ac configure.ac
+index a085ac3..f737b2d 100644
+--- configure.ac
++++ configure.ac
+@@ -940,10 +942,10 @@ AS_IF([test "${enable_optimizations}" != "no"], [
+   dnl -O4 and -O3 only in production builds
+   AS_IF([test "${enable_debug}" = "no"], [
+     VLC_SAVE_FLAGS
+-    CFLAGS="${CFLAGS} -O4"
+-    CXXFLAGS="${CXXFLAGS} -O4"
+-    OBJCFLAGS="${OBJCFLAGS} -O4"
+-    AC_CACHE_CHECK([if $CC accepts -O4], [ac_cv_c_o4], [
++    CFLAGS="${CFLAGS} -O3"
++    CXXFLAGS="${CXXFLAGS} -O3"
++    OBJCFLAGS="${OBJCFLAGS} -O3"
++    AC_CACHE_CHECK([if $CC accepts -O3], [ac_cv_c_o4], [
+       AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
+         ac_cv_c_o4=yes
+       ], [
diff --git a/multimedia/VLC/files/files/patch-vlc-no-qt5.diff b/multimedia/VLC/files/files/patch-vlc-no-qt5.diff
new file mode 100644
index 0000000..7edf97c
--- /dev/null
+++ b/multimedia/VLC/files/files/patch-vlc-no-qt5.diff
@@ -0,0 +1,13 @@
+diff --git configure.ac configure.ac
+index a085ac3..8c6eb3d 100644
+--- configure.ac
++++ configure.ac
+@@ -3701,7 +3701,7 @@ AC_ARG_ENABLE(qt, [
+   ])
+ ])
+ AS_IF([test "${enable_qt}" != "no"], [
+-  PKG_CHECK_MODULES([QT], [Qt5Core >= 5.1.0 Qt5Widgets Qt5Gui], [
++  PKG_CHECK_MODULES([QT], [Qt5Core >= 6.1.0 Qt5Widgets Qt5Gui], [
+       PKG_CHECK_MODULES([QTX11], [Qt5X11Extras], [
+           VLC_ADD_LIBS([qt4],[${QTX11_LIBS}])
+           VLC_ADD_CXXFLAGS([qt4],[${QTX11_CFLAGS} -DQT5_HAS_X11])
diff --git a/multimedia/VLC/files/files/patch-vlc-qt-configureac.diff b/multimedia/VLC/files/files/patch-vlc-qt-configureac.diff
new file mode 100644
index 0000000..824ac9a
--- /dev/null
+++ b/multimedia/VLC/files/files/patch-vlc-qt-configureac.diff
@@ -0,0 +1,34 @@
+diff --git configure.ac configure.ac
+index a085ac3..f0b2c0a 100644
+--- configure.ac
++++ configure.ac
+@@ -69,6 +69,7 @@ AM_PROG_CC_C_O
+ AC_PROG_CXX
+ AC_PROG_CPP
+ AC_PROG_OBJC
++AC_PROG_OBJCXX
+ _AM_DEPENDENCIES([OBJC])
+ AC_PROG_EGREP
+ AC_PROG_MAKE_SET
+diff --git modules/gui/qt4/Makefile.am modules/gui/qt4/Makefile.am
+index 1a564cf..ff4ea4c 100644
+--- modules/gui/qt4/Makefile.am
++++ modules/gui/qt4/Makefile.am
+@@ -26,6 +26,7 @@ libqt4_plugin_la_LIBADD += $(X_LIBS) $(X_PRE_LIB) -lX11
+ endif
+ endif
+ if HAVE_DARWIN
++libqt4_plugin_la_OBJCXXFLAGS = $(AM_CXXFLAGS) $(QT_CFLAGS) $(CXXFLAGS_qt4)
+ libqt4_plugin_la_LDFLAGS += -Wl,-framework,Cocoa
+ endif
+
+@@ -118,6 +119,9 @@ libqt4_plugin_la_SOURCES = \
+ if HAVE_WIN32
+ libqt4_plugin_la_SOURCES += main_interface_win32.cpp
+ endif
++if HAVE_DARWIN
++libqt4_plugin_la_SOURCES += util/searchlineedit_mac.mm
++endif
+
+ # Meta-object compilation
+
diff --git a/multimedia/VLC/files/files/patch-vlc-qt4mac.diff b/multimedia/VLC/files/files/patch-vlc-qt4mac.diff
new file mode 100644
index 0000000..1e958f4
--- /dev/null
+++ b/multimedia/VLC/files/files/patch-vlc-qt4mac.diff
@@ -0,0 +1,97 @@
+diff --git modules/gui/qt4/util/searchlineedit.cpp modules/gui/qt4/util/searchlineedit.cpp
+index 94744ec..e83625d 100644
+--- modules/gui/qt4/util/searchlineedit.cpp
++++ modules/gui/qt4/util/searchlineedit.cpp
+@@ -103,7 +103,7 @@ void ClickLineEdit::focusOutEvent( QFocusEvent *ev )
+ }
+ #endif
+ 
+-#ifndef Q_OS_MAC
++#ifndef Q_OS_MAC_UNUSED
+ SearchLineEdit::SearchLineEdit( QWidget *parent ) : QLineEdit( parent )
+ {
+     clearButton = new QFramelessButton( this );
+@@ -202,4 +202,14 @@ void SearchLineEdit::searchEditingFinished()
+     emit searchDelayedChanged( text() );
+ }
+ 
++// #else
++//
++// void SearchLineEdit::updateText( const QString& text )
++// {
++// }
++//
++// void SearchLineEdit::searchEditingFinished()
++// {
++// }
++
+ #endif
+diff --git modules/gui/qt4/util/searchlineedit.hpp modules/gui/qt4/util/searchlineedit.hpp
+index a09b9bc..8d9e2b7 100644
+--- modules/gui/qt4/util/searchlineedit.hpp
++++ modules/gui/qt4/util/searchlineedit.hpp
+@@ -72,7 +72,7 @@ private:
+ };
+ #endif
+ 
+-#ifndef Q_OS_MAC
++#ifndef Q_OS_MAC_UNUSED
+ class QFramelessButton;
+ class SearchLineEdit : public QLineEdit
+ {
+@@ -99,28 +99,33 @@ private slots:
+ signals:
+     void searchDelayedChanged( const QString& );
+ };
+-#else
+-
+-/* On Mac, we try to use the native NSSearchField */
+-#include <QMacCocoaViewContainer>
+-
+-class SearchLineEdit : public QMacCocoaViewContainer
+-{
+-    Q_OBJECT
+-
+-public:
+-    SearchLineEdit(QWidget *parent = 0);
+-    virtual ~SearchLineEdit() {}
+-
+-    virtual QSize sizeHint() const { return QSize(150, 40); }
+-
+-public slots:
+-    void clear() {}
+-
+-signals:
+-    void searchDelayedChanged( const QString& );
+-    void textEdited( const QString& );
+-};
++// #else
++//
++// /* On Mac, we try to use the native NSSearchField */
++// #include <QMacCocoaViewContainer>
++//
++// class SearchLineEdit : public QMacCocoaViewContainer
++// {
++//     Q_OBJECT
++//
++// public:
++//     SearchLineEdit(QWidget *parent = 0);
++//     virtual ~SearchLineEdit() {}
++//
++//     virtual QSize sizeHint() const { return QSize(150, 40); }
++//
++// public slots:
++//     void clear() {}
++//
++// // moc does not look at #ifdefs, so we must provide the same slots and signals
++// private slots:
++//     void updateText( const QString& );
++//     void searchEditingFinished();
++//
++// signals:
++//     void searchDelayedChanged( const QString& );
++//     void textEdited( const QString& );
++// };
+ #endif
+ 
+ #endif
diff --git a/multimedia/VLC/files/files/static_assert.patch b/multimedia/VLC/files/files/static_assert.patch
new file mode 100644
index 0000000..8e8a7ca
--- /dev/null
+++ b/multimedia/VLC/files/files/static_assert.patch
@@ -0,0 +1,15 @@
+diff --git include/vlc_fixups.h include/vlc_fixups.h
+index b448d83..638b864 100644
+--- include/vlc_fixups.h
++++ include/vlc_fixups.h
+@@ -239,8 +239,8 @@ static inline locale_t newlocale(int mask, const char * locale, locale_t base)
+ }
+ #endif
+ 
+-#if !defined (HAVE_STATIC_ASSERT)
+-# define _Static_assert(x, s) ((void) sizeof (struct { unsigned:-!(x); }))
++#if !defined (HAVE_STATIC_ASSERT) && !defined (static_assert)
++# define _Static_assert(x, s) ((void) sizeof (struct { unsigned a[(x) ? 1 : -1];}))
+ # define static_assert _Static_assert
+ #endif
+ 
