Ticket #54480: VLC-portdir.diff

File VLC-portdir.diff, 98.5 KB (added by RJVB (René Bertin), 7 years ago)
  • multimedia/VLC/Portfile

    diff --git a/multimedia/VLC/Portfile b/multimedia/VLC/Portfile
    index 7f74bf6..bea4d12 100644
    a b PortGroup compiler_blacklist_versions 1.0 
    55PortGroup               active_variants 1.1
    66PortGroup               conflicts_build 1.0
    77
     8if {[file exists ${prefix}/etc/macports/locales.tcl]} {
     9    # experimental feature to cut down the NLS/locale files, which take up over 50% of
     10    # the install footprint for VLC. This feature loads the locale_select PortGroup
     11    # if its configuration file exist; a variant is then added which prunes all translations from
     12    # ${destroot}${prefix}/share/locale except those whitelisted in etc/macports/locales.tcl .
     13    PortGroup           locale_select 1.0
     14}
     15
    816name                    VLC
    917
    1018categories              multimedia devel
    subport lib${name} { 
    2937    homepage            http://www.videolan.org/vlc/libvlc.html
    3038}
    3139
    32 subport ffmpeg-VLC {}
    33 set FFMPEG_VLC_PREFIX   ${prefix}/lib/vlc/ffmpeg
     40set use_ffmpeg_VLC      no
     41
     42if {[tbool use_ffmpeg_VLC]} {
     43    subport ffmpeg-VLC {}
     44    set FFMPEG_VLC_PREFIX   ${prefix}/lib/vlc/ffmpeg
     45}
    3446
    3547if {${subport} eq ${name}} {
    3648    conflicts           lib${name} libVLC-devel VLC-devel
    supported_archs x86_64 
    4456###################  ports VLC and libVLC  ###################
    4557##
    4658if {(${subport} eq ${name}) || (${subport} eq "lib${name}")} {
    47     version             2.2.4
    48     revision            8
     59    version             2.2.6
    4960    license             GPL-2
    5061
    5162    platforms           darwin
    if {(${subport} eq ${name}) || (${subport} eq "lib${name}")} { 
    5465    distname            vlc-${version}
    5566    use_xz              yes
    5667
    57     checksums           rmd160  2fe178bb9a4b2ad5ca0294d3e52ceb992b22e8ee \
    58                         sha256  1632e91d2a0087e0ef4c3fb4c95c3c2890f7715a9d1d43ffd46329f428cf53be
     68    checksums           rmd160  b2727834bcbbf0d274e3a0b4a3317f3b914f9ad4 \
     69                        sha256  c403d3accd9a400eb2181c958f3e7bc5524fe5738425f4253d42883b425a42a8
    5970
    6071    if {[info exist ::env(MACPORTS_COMPRESS_WORKDIR)] && $::env(MACPORTS_COMPRESS_WORKDIR)} {
    6172        # Enable HFS compression.
    if {(${subport} eq ${name}) || (${subport} eq "lib${name}")} { 
    6778
    6879    depends_build       port:pkgconfig
    6980
    70     depends_lib         port:ffmpeg-VLC \
    71                         port:a52dec \
     81    if {[tbool use_ffmpeg_VLC]} {
     82        depends_lib-append \
     83                        port:ffmpeg-FFMPEG_VLC_PREFIX
     84    }
     85    depends_lib-append  port:a52dec \
    7286                        port:avahi \
    7387                        port:bzip2 \
    7488                        port:faad2 \
    if {(${subport} eq ${name}) || (${subport} eq "lib${name}")} { 
    189203                        static_assert.patch \
    190204                        no-sparkle.patch \
    191205                        patch-vlc-no-O4.diff \
    192                         patch-ffmpegVLC.diff \
    193206                        patch-soundfont-path.diff
     207    if {[tbool use_ffmpeg_VLC]} {
     208        patchfiles-append \
     209                        patch-ffmpegVLC.diff
     210    } else {
     211        patchfiles-append \
     212                        patch-ffmpeg3-compat.diff
     213    }
    194214
    195215    post-patch {
    196216        if {[string match *clang* ${configure.cxx}] && ${configure.cxx_stdlib} == "libc++"} {
    197217            reinplace "s:-lstdc\+\+:-lc++:" \
    198                 ${worksrcpath}/configure.ac \
    199218                ${worksrcpath}/modules/access/Makefile.am
    200219        }
    201220
    202221        reinplace "s|@PREFIX@|${prefix}|g" ${worksrcpath}/modules/codec/fluidsynth.c
    203222
    204         # patch source using ffmpeg to use the correct header file locations
    205         foreach dir {libavcodec libavformat libavresample libavutil libpostproc libswresample libswscale} {
    206             foreach module {access codec/avcodec demux/avformat hw/vdpau packetizer video_chroma} {
    207                 foreach cf [glob -nocomplain ${worksrcpath}/modules/${module}/*.c] {
    208                     reinplace "s|${dir}/|${dir}-VLC/|g" ${cf}
    209                 }
    210                 foreach cf [glob -nocomplain ${worksrcpath}/modules/${module}/*.h] {
    211                     reinplace "s|${dir}/|${dir}-VLC/|g" ${cf}
     223        if {[tbool use_ffmpeg_VLC]} {
     224            # patch source using ffmpeg to use the correct header file locations
     225            foreach dir {libavcodec libavformat libavresample libavutil libpostproc libswresample libswscale} {
     226                foreach module {access codec/avcodec demux/avformat hw/vdpau packetizer video_chroma} {
     227                    foreach cf [glob -nocomplain ${worksrcpath}/modules/${module}/*.c] {
     228                        reinplace "s|${dir}/|${dir}-VLC/|g" ${cf}
     229                    }
     230                    foreach cf [glob -nocomplain ${worksrcpath}/modules/${module}/*.h] {
     231                        reinplace "s|${dir}/|${dir}-VLC/|g" ${cf}
     232                    }
    212233                }
     234                reinplace "s|${dir}/|${dir}-VLC/|g" ${worksrcpath}/configure.ac ${worksrcpath}/configure
    213235            }
    214             reinplace "s|${dir}/|${dir}-VLC/|g" ${worksrcpath}/configure.ac ${worksrcpath}/configure
    215         }
    216         reinplace "s|postproc/|postproc-VLC/|g" ${worksrcpath}/configure.ac ${worksrcpath}/configure
    217         reinplace "s|libpostproc/|libpostproc-VLC/|g" ${worksrcpath}/modules/video_filter/postproc.c
    218         reinplace "s|HAVE_LIBAVUTIL_AV|HAVE_LIBAVUTIL_VLC_AV|g" \
     236            reinplace "s|postproc/|postproc-VLC/|g" ${worksrcpath}/configure.ac ${worksrcpath}/configure
     237            reinplace "s|libpostproc/|libpostproc-VLC/|g" ${worksrcpath}/modules/video_filter/postproc.c
     238            reinplace "s|HAVE_LIBAVUTIL_AV|HAVE_LIBAVUTIL_VLC_AV|g" \
    219239                ${worksrcpath}/modules/codec/avcodec/avcommon.h \
    220240                ${worksrcpath}/modules/codec/avcodec/avcommon_compat.h
    221         reinplace "s|HAVE_LIBAVFORMAT_AV|HAVE_LIBAVFORMAT_VLC_AV|g" \
     241            reinplace "s|HAVE_LIBAVFORMAT_AV|HAVE_LIBAVFORMAT_VLC_AV|g" \
    222242                ${worksrcpath}/modules/codec/avcodec/avcommon.h \
    223243                ${worksrcpath}/modules/codec/avcodec/avcommon_compat.h
    224         reinplace "s|HAVE_LIBAVCODEC_AV|HAVE_LIBAVCODEC_VLC_AV|g" \
     244            reinplace "s|HAVE_LIBAVCODEC_AV|HAVE_LIBAVCODEC_VLC_AV|g" \
    225245                ${worksrcpath}/modules/codec/avcodec/avcommon.h \
    226246                ${worksrcpath}/modules/codec/avcodec/avcommon_compat.h
    227         reinplace "s|HAVE_LIBSWSCALE_SW|HAVE_LIBSWSCALE_VLC_SW|g" \
     247            reinplace "s|HAVE_LIBSWSCALE_SW|HAVE_LIBSWSCALE_VLC_SW|g" \
    228248                ${worksrcpath}/modules/codec/avcodec/avcommon.h \
    229249                ${worksrcpath}/modules/codec/avcodec/avcommon_compat.h
     250        }
    230251    }
    231252    post-configure {
    232253        system -W ${worksrcpath} "patch -Np0 -i ${filespath}/patch-static_assert.diff"
    if {(${subport} eq ${name}) || (${subport} eq "lib${name}")} { 
    240261
    241262    configure.env-append \
    242263                        CXXCPP="${configure.cxx} -E"
    243     # splice in ffmpeg-VLC's pkgconfig path, hoping that PKG_CONFIG_PATH hasn't been set by anyone else
    244     configure.env-append \
     264    if {[tbool use_ffmpeg_VLC]} {
     265        # splice in ffmpeg-VLC's pkgconfig path, hoping that PKG_CONFIG_PATH hasn't been set by anyone else
     266        configure.env-append \
    245267                        PKG_CONFIG_PATH=${FFMPEG_VLC_PREFIX}/lib/pkgconfig
     268    }
    246269    build.args-append   DESTDIR=${worksrcpath}/dest_ignore V=1
    247270
    248271    # gl.c:121:3: error: Platform not recognized.
    if {(${subport} eq ${name}) || (${subport} eq "lib${name}")} { 
    439462            description {Enable all variants (except freerdp, currently)} {}
    440463    }
    441464
    442     # this patchfile can probably go with VLC 2.2.2, or should be reviewed then.
    443     # update 2.2.2 : lua 5.3 gives compiler syntax errors so we stick with 5.2 for now.
     465#     # this patchfile can probably go with VLC 2.2.2, or should be reviewed then.
     466#     # update 2.2.2 : lua 5.3 gives compiler syntax errors so we stick with 5.2 for now.
    444467    patchfiles-append           patch-for-lua52.diff
    445468
    446469    # make 10.12 and later ignore all QTKit code in modules/gui/macosx/open.m
    if {(${subport} eq ${name}) || (${subport} eq "lib${name}")} { 
    452475            default_variants-append +qtkit
    453476        }
    454477
    455         configure.args-replace  --disable-macosx-eyetv --enable-macosx-eyetv
    456 
    457         if {${subport} ne "lib${name}"} {
    458             configure.args-replace  --disable-macosx-vlc-app --enable-macosx-vlc-app
    459         }
     478        patchfiles-append       patch-use-NSGetEnviron.diff
    460479
    461480        post-patch {
    462             reinplace "s/Appkit/AppKit/" ${worksrcpath}/configure.ac
    463481            reinplace "/Sparkle.framework/d" \
    464482                ${worksrcpath}/extras/package/macosx/vlc.xcodeproj/project.pbxproj
    465483            reinplace "/SDKROOT/d" \
    if {(${subport} eq ${name}) || (${subport} eq "lib${name}")} { 
    470488            reinplace "s:LD_LIBRARY_PATH:DYLD_LIBRARY_PATH:g" \
    471489                ${worksrcpath}/Makefile.am
    472490
    473             reinplace "/argv/s/environ/*_NSGetEnviron()/" \
    474                 ${worksrcpath}/modules/misc/inhibit/xdg.c \
    475                 ${worksrcpath}/modules/stream_filter/decomp.c
    476 
    477             reinplace "s/extern char \\*\\*environ;/#include <crt_externs.h>/" \
    478                 ${worksrcpath}/modules/misc/inhibit/xdg.c \
    479                 ${worksrcpath}/modules/stream_filter/decomp.c
    480 
    481491            if {![file exists ${worksrcpath}/contrib/BGHUDAppKit.framework]} {
    482492                ln -s ${frameworks_dir}/BGHUDAppKit.framework ${worksrcpath}/contrib/BGHUDAppKit.framework
    483493            }
    if {(${subport} eq ${name}) || (${subport} eq "lib${name}")} { 
    486496            file mkdir "${worksrcpath}/contrib/lib"
    487497        }
    488498
     499        configure.args-replace  --disable-macosx-eyetv --enable-macosx-eyetv
     500
     501        if {${subport} ne "lib${name}"} {
     502            configure.args-replace  --disable-macosx-vlc-app --enable-macosx-vlc-app
     503        }
     504
    489505        post-destroot {
    490506            eval file delete [glob ${destroot}${prefix}/lib/vlc/plugins/*/*.la]
    491507
    if {(${subport} eq ${name}) || (${subport} eq "lib${name}")} { 
    505521                    delete ${destroot}${applications_dir}/VLC.app/Contents/MacOS/share/lua
    506522
    507523                    # http://trac.macports.org/ticket/35131
    508                     ln -s ${prefix}/lib ${destroot}${applications_dir}/VLC.app/Contents/MacOS/lib
     524                    xinstall -m 755 -d ${destroot}${applications_dir}/VLC.app/Contents/MacOS/lib
     525                    foreach l [glob -nocomplain ${destroot}${prefix}/lib/*] {
     526                        ln -s ${prefix}/lib/[file tail ${l}] ${destroot}${applications_dir}/VLC.app/Contents/MacOS/lib
     527                    }
    509528                    ln -s ${prefix}/lib/vlc/plugins ${destroot}${applications_dir}/VLC.app/Contents/MacOS/plugins
    510529                    ln -s ${prefix}/lib/vlc/lua ${destroot}${applications_dir}/VLC.app/Contents/MacOS/share/lua
    511                     ln -s ${prefix}/share/locale ${destroot}${applications_dir}/VLC.app/Contents/MacOS/share/locale
     530                    foreach d [glob -nocomplain ${destroot}${prefix}/share/locale/*] {
     531                        set locale [file tail ${d}]
     532                        set ldir ${destroot}${applications_dir}/VLC.app/Contents/MacOS/share/locale/${locale}/LC_MESSAGES
     533                        xinstall -m 755 -d ${ldir}
     534                        foreach m [glob -nocomplain ${d}/LC_MESSAGES/*] {
     535                            ln -s ${prefix}/share/locale/${locale}/LC_MESSAGES/[file tail ${m}] ${ldir}/
     536                        }
     537                    }
    512538
    513539                    # the vlc executable needs to be started with a full path to the app bundle executable
    514540                    # or else the Mac OS X interface will hang beyond even a ^C or ^\ :
    if {(${subport} eq ${name}) || (${subport} eq "lib${name}")} { 
    529555            system "${prefix}/lib/vlc/vlc-cache-gen -f ${prefix}/lib/vlc"
    530556        }
    531557    }
    532 # outcomment when the port:fluid-soundfont* ports have been made available
    533 #     notes-append "MIDI support requires installing one or more SoundFont files,\
    534 #         in ${prefix}/share/sounds/sf2, for instance from one of the port:fluid-soundfont-* ports"
     558    notes-append "MIDI support requires installing one or more SoundFont files,\
     559        in ${prefix}/share/sounds/sf2, for instance from port:generaluser-soundfont."
    535560}
    536561
    537562##
    538563#################  support port ffmpeg-VLC  ##################
    539564##
    540565if {${subport} eq "ffmpeg-VLC"} {
    541     PortGroup           xcodeversion 1.0
    542 
    543     version             2.8.6
    544     revision            1
    545     license             LGPL-2.1+
    546     categories          multimedia
    547     maintainers         gmail.com:rjvbertin openmaintainer
    548 
    549     description         Custom FFMpeg 2.8.6 build for port:VLC and port:libVLC.
    550     long_description    Custom FFMpeg build for VLC and libVLC v2.2.x . It installs \
    551                         a private copy of FFMpeg v2.8.6 .
    552 
    553     platforms           darwin
    554     homepage            http://www.ffmpeg.org/
    555     master_sites        http://www.ffmpeg.org/releases/
    556 
    557     use_bzip2           yes
    558     distname            ffmpeg-${version}
    559 
    560     checksums           rmd160  5b61b6b0521d39ca31dcfb7fff1dfa26d9e7667a \
    561                         sha256  40611e329bc354592c6f8f1deb033c31b91f80e91f5707ca4f9afceca78d8e62
    562 
    563     depends_build       port:pkgconfig \
    564                         port:gmake
    565 
    566     # libvpx is static only so can be considered a build dependency (#47934)
    567 
    568     depends_build-append \
    569                         port:libvpx
    570 
    571     depends_lib         port:lame \
    572                         port:libiconv \
    573                         port:openjpeg15 \
    574                         port:xz \
    575                         port:zlib
    576 
    577     build.cmd           ${prefix}/bin/gmake
    578     build.env-append    V=1
    579 
    580     #
    581     # enable auto configure of asm optimizations
    582     # requires Xcode 3.1 or better on Leopard
    583     #
    584     minimum_xcodeversions {9 3.1}
    585 
    586     if {[lsearch [get_canonical_archs] i386] != -1} {
    587         # clang-3.1 hits https://trac.macports.org/ticket/30137 (<rdar://problem/11542429>)
    588         # clang-139 hits https://trac.macports.org/ticket/38141
    589         compiler.blacklist-append {clang < 422.1.7}
    590     }
    591 
    592     configure.cflags-append -DHAVE_LRINTF ${configure.cppflags}
    593     configure.args      --prefix=${FFMPEG_VLC_PREFIX} \
    594                         --progs-suffix=-VLC \
    595                         --build-suffix=-VLC \
    596                         --disable-doc \
    597                         --disable-encoder=vorbis \
    598                         --enable-libopenjpeg \
    599                         --disable-debug \
    600                         --disable-avdevice \
    601                         --disable-devices \
    602                         --disable-avfilter \
    603                         --disable-filters \
    604                         --disable-protocol=concat \
    605                         --disable-bsfs \
    606                         --disable-bzlib \
    607                         --enable-avresample \
    608                         --enable-libmp3lame \
    609                         --enable-libvpx \
    610                         --disable-libbluray \
    611                         --disable-sdl \
    612                         --disable-libxcb --disable-libxcb-shm --disable-libxcb-xfixes --disable-libxcb-shape \
    613                         --enable-shared --disable-static --enable-pthreads \
    614                         --enable-rpath \
    615                         --disable-stripping \
    616                         --cc=${configure.cc}
    617 
    618     # this is the old gpl2 variant. VLC is GPL2'ed, so we can just as well build ffmpeg
    619     # with these components.
    620     configure.args-append \
    621                         --enable-gpl \
    622                         --enable-postproc
    623 
    624     configure.args-append \
    625                         --arch=${configure.build_arch}
    626     configure.env-append \
    627                         ASFLAGS='[get_canonical_archflags]'
    628     if {${build_arch} eq "x86_64"} {
    629         depends_build-append \
    630                         port:yasm
    631         configure.args-append \
    632                         --enable-yasm
     566    if {[catch {source "${portpath}/Portfile.ffmpeg.tcl"} err]} {
     567        puts stderr "Error reading Portfile.ffmpeg.tcl: $err"
     568        return 1;
    633569    }
    634 
    635     platform darwin {
    636         if {${os.major} < 9} {
    637             configure.args-append --disable-asm
    638         }
    639 
    640         # VDA (video hardware acceleration, mostly H264) is only supported on 10.6.3+ up to (excluding) 10.11.
    641         #if {(${os.major} > 10 || (${os.major} == 10 && ${os.minor} >= 3)) && (${os.major} < 15)}
    642         # Due to a bug in ffmpeg(?), we have to enable VDA on 10.11 as well, even though it shouldn't be supported.
    643         # More information: https://github.com/mpv-player/mpv/issues/2299
    644         if {${os.major} > 10 || (${os.major} == 10 && ${os.minor} >= 3)} {
    645             configure.args-delete --disable-vda
    646             configure.args-append --enable-vda
    647         }
    648 
    649         # VideotoolBox, a new hardware acceleration framework, is supported on 10.8+ and "here to stay".
    650         # It provides support for H264, H263, MPEG1, MPEG2 and MPEG4.
    651         if {${os.major} > 11} {
    652             configure.args-delete --disable-videotoolbox
    653             configure.args-append --enable-videotoolbox
    654         }
    655 
    656         # Apple GCC has problems with SIMD intrinsics and -Werror=no-missing-prototypes.
    657         if {${os.major} < 11} {
    658             patchfiles-append patch-configure-no-error-on-missing-prototypes.diff
    659         }
    660 
    661         # kCVPixelFormatType_OneComponent8 used in avfoundation indev is only available on 10.8+
    662         if {${os.major} < 12} {
    663             configure.args-append --disable-indev=avfoundation
    664         }
    665     }
    666 
    667     #
    668     # configure isn't autoconf and they do use a dep cache
    669     #
    670 
    671     platform darwin 8 {
    672         post-patch {
    673             reinplace "s:,-compatibility_version,$\(LIBMAJOR\)::" ${worksrcpath}/configure
    674         }
    675     }
    676 
    677     destroot.target     install-libs install-headers
    678 
    679     post-destroot {
    680         file delete -force ${destroot}${prefix}/share/examples
    681         # We need to make sure that the linker will use our libraries and not one
    682         # from a location like ${prefix}/lib . That's why we use --build-suffix, but
    683         # that still requires us to provide pkg-config files with the standard names:
    684         foreach pc [glob ${destroot}${FFMPEG_VLC_PREFIX}/lib/pkgconfig/*.pc] {
    685             set standardname [strsed ${pc} "s/-VLC.pc/.pc/"]
    686             ln -s [file tail ${pc}] ${standardname}
    687         }
    688         # oblige dependent code to include files from our own renamed header file directories, so it
    689         # cannot include mismatching headers by accident (e.g. those from ffmpeg 3.x).
    690         foreach dir {libavcodec libavformat libavresample libavutil libpostproc libswresample libswscale} {
    691             file rename ${destroot}${FFMPEG_VLC_PREFIX}/include/${dir} ${destroot}${FFMPEG_VLC_PREFIX}/include/${dir}-VLC
    692         }
    693         foreach dir {libavcodec libavformat libavresample libavutil libpostproc libswresample libswscale} {
    694             foreach header [glob -nocomplain ${destroot}${FFMPEG_VLC_PREFIX}/include/*/*.h] {
    695                 reinplace "s|${dir}/|${dir}-VLC/|g" ${header}
    696             }
    697         }
    698         # packageable: ${destroot}${FFMPEG_VLC_PREFIX}/{include,lib/lib*VLC.dylib,lib/pkgconfig}
    699     }
    700 
    701     livecheck.type      regex
    702     livecheck.url       ${master_sites}
    703     livecheck.regex     "ffmpeg-(\\d+(?:\\.\\d+)*)${extract.suffix}"
    704 
    705570}
    706571
    707572# 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;
  • new file multimedia/VLC/files/files/PR-34741-no__clang_version__.patch

    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
    - +  
     1--- modules/gui/macosx/about.m.orig     2014-02-25 11:36:09.000000000 -0800
     2+++ modules/gui/macosx/about.m  2014-02-25 12:06:29.000000000 -0800
     3@@ -101,10 +101,14 @@ static VLAboutBox *_o_sharedInstance = n
     4 
     5         /* setup the creator / revision field */
     6         NSString *compiler;
     7-#ifdef __clang__
     8+#ifdef __clang_version__
     9         compiler = [NSString stringWithFormat:@"clang %s", __clang_version__];
     10-#else
     11+#elif defined(__clang__)
     12+        compiler = [NSString stringWithFormat:@"clang"];
     13+#elif defined(__llvm__)
     14         compiler = [NSString stringWithFormat:@"llvm-gcc %s", __VERSION__];
     15+#else
     16+        compiler = [NSString stringWithFormat:@"gcc %s", __VERSION__];
     17 #endif
     18         [o_revision_field setStringValue: [NSString stringWithFormat: _NS("Compiled by %s with %@"), VLC_CompileBy(), compiler]];
     19 
  • new file multimedia/VLC/files/files/buildfix-package.mak.patch

    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
    - +  
     1diff --git extras/package/macosx/package.mak extras/package/macosx/package.mak
     2index 40e4fe5..0f381dd 100644
     3--- extras/package/macosx/package.mak
     4+++ extras/package/macosx/package.mak
     5@@ -26,10 +26,10 @@ VLC.app: VLC-tmp
     6 
     7 
     8 VLC-tmp: vlc
     9+       rm -Rf "$(top_builddir)/tmp" "$@"
     10        $(AM_V_GEN)for i in src lib share; do \
     11-               (cd $$i && $(MAKE) $(AM_MAKEFLAGS) install $(silentstd)); \
     12+               (cd $$i && $(MAKE) $(AM_MAKEFLAGS) install $(silentstd) DESTDIR=$(abs_top_builddir)/tmp/destdir); \
     13        done
     14-       rm -Rf "$(top_builddir)/tmp" "$@"
     15        mkdir -p "$(top_builddir)/tmp/extras/package/macosx"
     16        cd $(srcdir)/extras/package/macosx; cp -R Resources README.MacOSX.rtf $(abs_top_builddir)/tmp/extras/package/macosx/
     17        mkdir -p $(abs_top_builddir)/tmp/extras/package/macosx/vlc.xcodeproj/
     18@@ -49,7 +49,7 @@ VLC-tmp: vlc
     19        cp -R $(top_builddir)/tmp/build/Default/VLC.bundle $@
     20        mkdir -p $@/Contents/Frameworks && cp -R $(CONTRIB_DIR)/Growl.framework $@/Contents/Frameworks/
     21        mkdir -p $@/Contents/MacOS/share/locale/
     22-       cp -r "$(prefix)/lib/vlc/lua" "$(prefix)/share/vlc/lua" $@/Contents/MacOS/share/
     23+       cp -r "$(top_builddir)/tmp/destdir$(prefix)/lib/vlc/lua" "$(top_builddir)/tmp/destdir$(prefix)/share/vlc/lua" $@/Contents/MacOS/share/
     24        mkdir -p $@/Contents/MacOS/include/
     25        (cd "$(prefix)/include" && $(AMTAR) -c --exclude "plugins" vlc) | $(AMTAR) -x -C $@/Contents/MacOS/include/
     26        $(INSTALL) -m 644 $(srcdir)/share/vlc512x512.png $@/Contents/MacOS/share/vlc512x512.png
  • new file multimedia/VLC/files/files/configure.ac-no-arch.patch

    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
    - +  
     1diff --git configure.ac configure.ac
     2index 318cad4..9350f90 100644
     3--- configure.ac
     4+++ configure.ac
     5@@ -144,22 +144,11 @@ case "${host_os}" in
     6     SYS=dragonfly
     7     ;;
     8   darwin*)
     9-
     10-    dnl Force gcc "-arch" flag
     11-    ARCH_flag=""
     12     case "${host}" in
     13       i?86*)
     14-        ARCH_flag="-arch i386"
     15         YASMFLAGS="-f macho32"
     16       ;;
     17-      ppc64*)
     18-        ARCH_flag="-arch ppc64"
     19-      ;;
     20-      ppc*)
     21-        ARCH_flag="-arch ppc"
     22-      ;;
     23       x86_64*)
     24-        ARCH_flag="-arch x86_64"
     25         YASMFLAGS="-f macho64"
     26       ;;
     27       arm*)
     28@@ -169,11 +158,10 @@ case "${host_os}" in
     29     esac
     30 
     31     SYS=darwin
     32-    CFLAGS="${CFLAGS} -D_INTL_REDIRECT_MACROS ${ARCH_flag}"
     33-    CXXFLAGS="${CXXFLAGS} -D_INTL_REDIRECT_MACROS ${ARCH_flag}"
     34-    CPPFLAGS="${CPPFLAGS} ${ARCH_flag}"
     35-    OBJCFLAGS="${OBJCFLAGS} -D_INTL_REDIRECT_MACROS -std=gnu99 ${ARCH_flag}"
     36-    LDFLAGS="${LDFLAGS} -Wl,-headerpad_max_install_names ${ARCH_flag}"
     37+    CFLAGS="${CFLAGS} -D_INTL_REDIRECT_MACROS"
     38+    CXXFLAGS="${CXXFLAGS} -D_INTL_REDIRECT_MACROS"
     39+    OBJCFLAGS="${OBJCFLAGS} -D_INTL_REDIRECT_MACROS -std=gnu99"
     40+    LDFLAGS="${LDFLAGS} -Wl,-headerpad_max_install_names"
     41     VLC_ADD_LIBS([libvlc vlc],[-Wl,-undefined,dynamic_lookup,-framework,AppKit])
     42     VLC_ADD_LIBS([libvlccore],[-Wl,-framework,CoreFoundation,-framework,CoreServices])
     43 
  • new file multimedia/VLC/files/files/ffmpeg/patch-configure-no-error-on-missing-prototypes.diff

    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
    - +  
     1--- configure.old       2015-09-27 18:43:30.000000000 +0200
     2+++ configure   2015-09-27 18:44:18.000000000 +0200
     3@@ -5683,7 +5683,6 @@
     4     check_optflags -fno-tree-vectorize
     5     check_cflags -Werror=format-security
     6     check_cflags -Werror=implicit-function-declaration
     7-    check_cflags -Werror=missing-prototypes
     8     check_cflags -Werror=return-type
     9     check_cflags -Werror=vla
     10     check_cflags -Wformat
  • new file multimedia/VLC/files/files/no-sparkle.patch

    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
    - +  
     1diff --git configure.ac configure.ac
     2index 318cad4..7c4e53f 100644
     3--- configure.ac
     4+++ configure.ac
     5@@ -3850,13 +3850,6 @@ then
     6 
     7   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])
     8 
     9-  if test ! -d ${CONTRIB_DIR}/Sparkle.framework
     10-  then
     11-    AC_MSG_ERROR([Sparkle framework is required and was not found in ${CONTRIB_DIR}])
     12-  fi
     13-  VLC_ADD_LIBS([macosx], [-F${CONTRIB_DIR} -Wl,-framework,Sparkle])
     14-  VLC_ADD_OBJCFLAGS([macosx], [-F${CONTRIB_DIR}])
     15-
     16   if test ! -d ${CONTRIB_DIR}/BGHUDAppKit.framework
     17   then
     18     AC_MSG_ERROR([BGHUDAppKit framework is required and was not found in ${CONTRIB_DIR}])
     19diff --git extras/package/macosx/Resources/English.lproj/MainMenu.xib extras/package/macosx/Resources/English.lproj/MainMenu.xib
     20index 1c880c9..08b3b9d 100644
     21--- extras/package/macosx/Resources/English.lproj/MainMenu.xib
     22+++ extras/package/macosx/Resources/English.lproj/MainMenu.xib
     23@@ -2106,9 +2106,6 @@
     24       <object class="NSCustomObject" id="651263286">
     25         <string key="NSClassName">VLCMainMenu</string>
     26       </object>
     27-      <object class="NSCustomObject" id="1040926652">
     28-        <string key="NSClassName">SUUpdater</string>
     29-      </object>
     30       <object class="NSCustomView" id="560875128">
     31         <reference key="NSNextResponder"/>
     32         <int key="NSvFlags">268</int>
     33@@ -2635,14 +2632,6 @@
     34           <int key="connectionID">2817</int>
     35         </object>
     36         <object class="IBConnectionRecord">
     37-          <object class="IBActionConnection" key="connection">
     38-            <string key="label">checkForUpdates:</string>
     39-            <reference key="source" ref="1040926652"/>
     40-            <reference key="destination" ref="354414928"/>
     41-          </object>
     42-          <int key="connectionID">4371</int>
     43-        </object>
     44-        <object class="IBConnectionRecord">
     45           <object class="IBOutletConnection" key="connection">
     46             <string key="label">o_dmi_mute</string>
     47             <reference key="source" ref="651263286"/>
     48@@ -5466,11 +5455,6 @@
     49             <string key="objectName">Application</string>
     50           </object>
     51           <object class="IBObjectRecord">
     52-            <int key="objectID">4370</int>
     53-            <reference key="object" ref="1040926652"/>
     54-            <reference key="parent" ref="0"/>
     55-          </object>
     56-          <object class="IBObjectRecord">
     57             <int key="objectID">4397</int>
     58             <reference key="object" ref="629699013"/>
     59             <object class="NSMutableArray" key="children">
     60diff --git modules/gui/macosx/simple_prefs.m modules/gui/macosx/simple_prefs.m
     61index 98f315d..0074c64 100644
     62--- modules/gui/macosx/simple_prefs.m
     63+++ modules/gui/macosx/simple_prefs.m
     64@@ -38,8 +38,6 @@
     65 #import "AppleRemote.h"
     66 #import "CoreInteraction.h"
     67 
     68-#import <Sparkle/Sparkle.h>                        //for o_intf_last_update_lbl
     69-
     70 static const char *const ppsz_language[] =
     71 {
     72     "auto",
     73@@ -383,7 +381,6 @@ create_toolbar_item(NSString * o_itemIdent, NSString * o_name, NSString * o_desc
     74     [o_intf_mediakeys_ckb setTitle: _NS("Control playback with media keys")];
     75     [o_intf_art_ckb setTitle: _NS("Allow metadata network access")];
     76     [o_intf_update_ckb setTitle: _NS("Automatically check for updates")];
     77-    [o_intf_last_update_lbl setStringValue: @""];
     78     [o_intf_enableGrowl_ckb setTitle: _NS("Enable Growl notifications (on playlist item change)")];
     79     [o_intf_autoresize_ckb setTitle: _NS("Resize interface to the native video size")];
     80     [o_intf_pauseminimized_ckb setTitle: _NS("Pause the video playback when minimized")];
     81@@ -595,10 +592,6 @@ static inline char * __config_GetLabel(vlc_object_t *p_this, const char *psz_nam
     82     [self setupButton: o_intf_appleremote_sysvol_ckb forBoolValue: "macosx-appleremote-sysvol"];
     83 
     84     [self setupButton: o_intf_mediakeys_ckb forBoolValue: "macosx-mediakeys"];
     85-    if ([[SUUpdater sharedUpdater] lastUpdateCheckDate] != NULL)
     86-        [o_intf_last_update_lbl setStringValue: [NSString stringWithFormat: _NS("Last check on: %@"), [[[SUUpdater sharedUpdater] lastUpdateCheckDate] descriptionWithLocale: [[NSUserDefaults standardUserDefaults] dictionaryRepresentation]]]];
     87-    else
     88-        [o_intf_last_update_lbl setStringValue: _NS("No check was performed yet.")];
     89     psz_tmp = config_GetPsz(p_intf, "control");
     90     if (psz_tmp) {
     91         [o_intf_enableGrowl_ckb setState: (NSInteger)strstr(psz_tmp, "growl")];
     92diff --git extras/package/macosx/Resources/English.lproj/Preferences.xib extras/package/macosx/Resources/English.lproj/Preferences.xib
     93index 2f264fd..d4049bd 100644
     94--- extras/package/macosx/Resources/English.lproj/Preferences.xib
     95+++ extras/package/macosx/Resources/English.lproj/Preferences.xib
     96@@ -4779,9 +4779,6 @@
     97                                <string key="NSMaxSize">{10000000000000, 10000000000000}</string>
     98                                <bool key="NSWindowIsRestorable">YES</bool>
     99                        </object>
     100-                       <object class="NSCustomObject" id="761483302">
     101-                               <string key="NSClassName">SUUpdater</string>
     102-                       </object>
     103                        <object class="NSWindowTemplate" id="898680423">
     104                                <int key="NSWindowStyleMask">15</int>
     105                                <int key="NSWindowBacking">2</int>
     106@@ -7629,22 +7626,6 @@
     107                                        <int key="connectionID">2681</int>
     108                                </object>
     109                                <object class="IBConnectionRecord">
     110-                                       <object class="IBBindingConnection" key="connection">
     111-                                               <string key="label">value: automaticallyChecksForUpdates</string>
     112-                                               <reference key="source" ref="243384014"/>
     113-                                               <reference key="destination" ref="761483302"/>
     114-                                               <object class="NSNibBindingConnector" key="connector">
     115-                                                       <reference key="NSSource" ref="243384014"/>
     116-                                                       <reference key="NSDestination" ref="761483302"/>
     117-                                                       <string key="NSLabel">value: automaticallyChecksForUpdates</string>
     118-                                                       <string key="NSBinding">value</string>
     119-                                                       <string key="NSKeyPath">automaticallyChecksForUpdates</string>
     120-                                                       <int key="NSNibBindingConnectorVersion">2</int>
     121-                                               </object>
     122-                                       </object>
     123-                                       <int key="connectionID">3559</int>
     124-                               </object>
     125-                               <object class="IBConnectionRecord">
     126                                        <object class="IBOutletConnection" key="connection">
     127                                                <string key="label">nextKeyView</string>
     128                                                <reference key="source" ref="588417130"/>
     129@@ -9360,12 +9341,6 @@
     130                                                <reference key="parent" ref="492678965"/>
     131                                        </object>
     132                                        <object class="IBObjectRecord">
     133-                                               <int key="objectID">3555</int>
     134-                                               <reference key="object" ref="761483302"/>
     135-                                               <reference key="parent" ref="0"/>
     136-                                               <string key="objectName">Sparkle Updater</string>
     137-                                       </object>
     138-                                       <object class="IBObjectRecord">
     139                                                <int key="objectID">3556</int>
     140                                                <reference key="object" ref="243384014"/>
     141                                                <array class="NSMutableArray" key="children">
     142diff --git modules/gui/macosx/intf.m modules/gui/macosx/intf.m
     143index 1d48150..c61a4aa 100644
     144--- modules/gui/macosx/intf.m
     145+++ modules/gui/macosx/intf.m
     146@@ -68,8 +68,6 @@
     147 #import "VideoEffects.h"
     148 #import "AudioEffects.h"
     149 
     150-#import <Sparkle/Sparkle.h>                 /* we're the update delegate */
     151-
     152 #import "iTunes.h"
     153 #import "Spotify.h"
     154 
     155@@ -785,8 +783,6 @@
     156     PL_LOCK;
     157     items_at_launch = p_playlist->p_local_category->i_children;
     158     PL_UNLOCK;
     159-
     160-    [[SUUpdater sharedUpdater] setDelegate:self];
     161 }
     162 
     163 - (void)applicationDidFinishLaunching:(NSNotification *)aNotification
     164@@ -974,25 +970,6 @@
     165 }
     166 
     167 #pragma mark -
     168-#pragma mark Sparkle delegate
     169-/* received directly before the update gets installed, so let's shut down a bit */
     170-- (void)updater:(SUUpdater *)updater willInstallUpdate:(SUAppcastItem *)update
     171-{
     172-    [NSApp activateIgnoringOtherApps:YES];
     173-    [o_remote stopListening: self];
     174-    [[VLCCoreInteraction sharedInstance] stop];
     175-}
     176-
     177-/* don't be enthusiastic about an update if we currently play a video */
     178-- (BOOL)updaterMayCheckForUpdates:(SUUpdater *)bundle
     179-{
     180-    if ([self activeVideoPlayback])
     181-        return NO;
     182-
     183-    return YES;
     184-}
     185-
     186-#pragma mark -
     187 #pragma mark Media Key support
     188 
     189 -(void)mediaKeyTap:(SPMediaKeyTap*)keyTap receivedMediaKeyEvent:(NSEvent*)event
  • new file multimedia/VLC/files/files/old/patch-ignore-libGL.diff

    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
    - +  
     1diff --git modules/video_output/Modules.am modules/video_output/Modules.am
     2index df8fbf6..81ee341 100644
     3--- modules/video_output/Modules.am
     4+++ modules/video_output/Modules.am
     5@@ -22,12 +22,12 @@ endif
     6 if HAVE_OSX
     7 libvout_macosx_plugin_la_SOURCES = macosx.m opengl.c opengl.h
     8 libvout_macosx_plugin_la_CFLAGS = $(AM_CFLAGS) $(GL_CFLAGS)
     9-libvout_macosx_plugin_la_LIBADD = $(GL_LIBS)
     10+libvout_macosx_plugin_la_LIBADD =
     11 libvout_macosx_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(voutdir)' -Wl,-framework,OpenGL,-framework,Cocoa
     12 
     13 libcaopengllayer_plugin_la_SOURCES = caopengllayer.m opengl.c opengl.h
     14 libcaopengllayer_plugin_la_CFLAGS = $(AM_CFLAGS) $(GL_CFLAGS)
     15-libcaopengllayer_plugin_la_LIBADD = $(GL_LIBS)
     16+libcaopengllayer_plugin_la_LIBADD =
     17 libcaopengllayer_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(voutdir)' -Wl,-framework,OpenGL,-framework,Cocoa,-framework,QuartzCore
     18 vout_LTLIBRARIES += libvout_macosx_plugin.la libcaopengllayer_plugin.la
     19 endif
  • new file multimedia/VLC/files/files/old/patch-ogg-nullptr-deref.diff

    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
    - +  
     1--- modules/demux/orig.ogg.c    2016-01-18 21:49:57.000000000 +0100
     2+++ modules/demux/ogg.c 2017-02-13 22:01:59.734081802 +0100
     3@@ -2199,10 +2199,14 @@
     4 #ifdef HAVE_LIBVORBIS
     5     if ( p_stream->fmt.i_codec == VLC_CODEC_VORBIS )
     6     {
     7-        vorbis_info_clear( p_stream->special.vorbis.p_info );
     8-        FREENULL( p_stream->special.vorbis.p_info );
     9-        vorbis_comment_clear( p_stream->special.vorbis.p_comment );
     10-        FREENULL( p_stream->special.vorbis.p_comment );
     11+        if (p_stream->special.vorbis.p_info) {
     12+            vorbis_info_clear( p_stream->special.vorbis.p_info );
     13+            FREENULL( p_stream->special.vorbis.p_info );
     14+        }
     15+        if (p_stream->special.vorbis.p_comment) {
     16+            vorbis_comment_clear( p_stream->special.vorbis.p_comment );
     17+            FREENULL( p_stream->special.vorbis.p_comment );
     18+        }
     19         p_stream->special.vorbis.i_headers_flags = 0;
     20     }
     21 #else
  • new file multimedia/VLC/files/files/old/patch-strverscmp.diff

    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
    - +  
     1diff --git compat/strverscmp.c compat/strverscmp.c
     2index 0487592..475531c 100644
     3--- compat/strverscmp.c
     4+++ compat/strverscmp.c
     5@@ -67,6 +67,11 @@ int strverscmp (const char *s1, const char *s2)
     6 
     7   if (p1 == p2)
     8     return 0;
     9+  // handle the easy inequalities:
     10+  else if (p1 == NULL)
     11+    return -999;
     12+  else if (p2 == NULL)
     13+    return 999;
     14 
     15   unsigned char c1 = *p1++;
     16   unsigned char c2 = *p2++;
     17@@ -76,8 +81,9 @@ int strverscmp (const char *s1, const char *s2)
     18   int diff;
     19   while ((diff = c1 - c2) == 0)
     20     {
     21-      if (c1 == '\0')
     22-       return diff;
     23+      // is there a reason we don't check against a nullbyte in p2 here?
     24+      if (c1 == '\0' || c2 == '\0')
     25+        return diff;
     26 
     27       state = next_state[state];
     28       c1 = *p1++;
     29@@ -94,8 +100,8 @@ int strverscmp (const char *s1, const char *s2)
     30 
     31     case LEN:
     32       while (isdigit (*p1++))
     33-       if (!isdigit (*p2++))
     34-         return 1;
     35+        if (!isdigit (*p2++))
     36+          return 1;
     37 
     38       return isdigit (*p2) ? -1 : diff;
     39 
  • new file multimedia/VLC/files/files/old/patch-vlc-for-macports-old.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
    - +  
     1diff --git modules/lua/vlc.c modules/lua/vlc.c
     2index 14b5520..92668f1 100644
     3--- modules/lua/vlc.c
     4+++ modules/lua/vlc.c
     5@@ -234,10 +234,22 @@ int vlclua_dir_list( const char *luadirname, char ***pppsz_dir_list )
     6             i++;
     7 
     8 #if defined(__APPLE__)
     9-        if( likely(asprintf( &ppsz_dir_list[i],
     10+        if( strcasestr (psz_datapath, "/share") == NULL
     11+            && likely(asprintf( &ppsz_dir_list[i],
     12                              "%s"DIR_SEP"share"DIR_SEP"lua"DIR_SEP"%s",
     13                              psz_datapath, luadirname ) != -1) )
     14             i++;
     15+        // When installed through MacPorts (or Fink, or HomeBrew, or...?) we do have
     16+        // meta/reader under LibDir/lua (/opt/local/lib/vlc/lua for MacPorts's standard install prefix)
     17+        // so we add that location at the end.
     18+        char *psz_libpath = config_GetLibDir();
     19+        if( likely(psz_libpath != NULL) )
     20+        {
     21+            if( likely(asprintf( &ppsz_dir_list[i], "%s"DIR_SEP"lua"DIR_SEP"%s",
     22+                                 psz_libpath, luadirname ) != -1) )
     23+                i++;
     24+            free( psz_libpath );
     25+        }
     26 #endif
     27         free( psz_datapath );
     28     }
     29diff --git src/darwin/dirs.c src/darwin/dirs.c
     30index 83c27a4..7e8b0cb 100644
     31--- src/darwin/dirs.c
     32+++ src/darwin/dirs.c
     33@@ -42,6 +42,14 @@
     34 # define MAXPATHLEN 1024
     35 #endif
     36 
     37+// this is set to true in config_GetLibDir() if it detects we're installed
     38+// in a (linux-specific) posix way.
     39+static int libDirIsPosix = FALSE;
     40+
     41+// 20150205: we should do case-insensitive filename comparisons. HFS is case-insensitive by default,
     42+// and while it strives to preserve case there is no guarantee that case folding will never occur,
     43+// especially in directory components.
     44+
     45 static char *config_GetLibPath (void)
     46 {
     47     /* Get the full program path and name */
     48@@ -49,7 +57,7 @@ static char *config_GetLibPath (void)
     49     for (unsigned i = 0; i < _dyld_image_count(); i++)
     50     {
     51         const char *psz_img_name = _dyld_get_image_name(i);
     52-        const char *p = strstr( psz_img_name, "VLCKit.framework/Versions/" );
     53+        const char *p = strcasestr( psz_img_name, "VLCKit.framework/Versions/" );
     54 
     55         /* Check for "VLCKit.framework/Versions/Current/VLCKit",
     56          * as well as "VLCKit.framework/Versions/A/VLCKit" and
     57@@ -61,26 +69,26 @@ static char *config_GetLibPath (void)
     58             p += strcspn( p, "/" );
     59 
     60             /* If the string ends with VLC then we've found a winner */
     61-            if ( !strcmp( p, "/VLCKit" ) )
     62+            if ( !strcasecmp( p, "/VLCKit" ) )
     63                 return strdup( psz_img_name );
     64         }
     65 
     66-        /* Do we end by "VLC"? If so we are the legacy VLC.app that doesn't
     67+        /* Do we end in "MacOS/VLC"? If so we are the legacy (?!) VLC.app that doesn't
     68          * link to VLCKit. */
     69         size_t len = strlen(psz_img_name);
     70-        if( len >= 3 && !strcmp( psz_img_name + len - 3, "VLC") )
     71+        if( len >= 9 && !strcasecmp( psz_img_name + len - 9, "MacOS/VLC") )
     72             return strdup( psz_img_name );
     73 
     74-        /* Do we end by "VLC-Plugin"? oh, we must be the NPAPI plugin */
     75-        if( len >= 10 && !strcmp( psz_img_name + len - 10, "VLC-Plugin") )
     76+        /* Do we end in "VLC-Plugin"? oh, we must be the NPAPI plugin */
     77+        if( len >= 10 && !strcasecmp( psz_img_name + len - 10, "VLC-Plugin") )
     78             return strdup( psz_img_name );
     79     }
     80 
     81-    /* We are not linked to the VLC.framework, let's use dladdr to figure
     82-     * libvlc path */
     83+    /* We are not linked to the VLC.framework, we'rebreak not VLC.app either,
     84+     * so let's use dladdr to figure the libvlc path */
     85     Dl_info info;
     86     if( dladdr(system_Init, &info) )
     87-        return strdup(dirname( info.dli_fname ));
     88+        return strdup(dirname( (char*)info.dli_fname ));
     89 
     90     char path[MAXPATHLEN+1];
     91     uint32_t path_len = sizeof(path) - 1;
     92@@ -99,6 +107,19 @@ char *config_GetLibDir (void)
     93         if (p != NULL)
     94         {
     95             *p = '\0';
     96+            p = strrchr (path, '.');
     97+            if (p == NULL || !strcasestr(p, ".app/Contents/MacOS"))
     98+            {
     99+                // we're NOT running an OS X style app bundle;
     100+                // return the Linux/POSIX style LibDir.
     101+                free(path);
     102+                path = strdup (PKGLIBDIR);
     103+                libDirIsPosix = TRUE;
     104+            }
     105+            else
     106+            {
     107+                libDirIsPosix = FALSE;
     108+            }
     109             return path;
     110         }
     111         free (path);
     112@@ -115,8 +136,26 @@ char *config_GetDataDir (void)
     113         return strdup (path);
     114 
     115     char *vlcpath = config_GetLibDir ();
     116-    char *datadir;
     117+    char *datadir = NULL;
     118 
     119+    if (libDirIsPosix)
     120+    {
     121+        // vlcpath should point to something like /opt/local/lib/vlc
     122+        // if so, we can chop off the /lib/vlc bit, and then add /share
     123+        // like we would otherwise.
     124+        char *p = strcasestr (vlcpath, "/lib/");
     125+        if (p != NULL)
     126+        {
     127+            *p = '\0';
     128+        }
     129+        else
     130+        {
     131+            // something else ... return PKGDATADIR
     132+            free(vlcpath);
     133+            datadir = strdup(PKGDATADIR);
     134+            return datadir;
     135+        }
     136+    }
     137     if (asprintf (&datadir, "%s/share", vlcpath) == -1)
     138         datadir = NULL;
     139 
     140diff --git src/interface/interface.c src/interface/interface.c
     141index b1dcfaf..f31a4a5 100644
     142--- src/interface/interface.c
     143+++ src/interface/interface.c
     144@@ -113,8 +113,14 @@ int intf_Create( vlc_object_t *p_this, const char *chain )
     145     char *module;
     146     char *psz_tmp = config_ChainCreate( &module, &p_intf->p_cfg,
     147                                         psz_parser );
     148-    free( psz_tmp );
     149-    free( psz_parser );
     150+    if (psz_tmp)
     151+    {
     152+        free( psz_tmp );
     153+    }
     154+    if (psz_parser)
     155+    {
     156+        free( psz_parser );
     157+    }
     158     p_intf->p_module = module_need( p_intf, "interface", module, true );
     159     free(module);
     160     if( p_intf->p_module == NULL )
  • new file multimedia/VLC/files/files/old/patch-vlc-for-macports2.diff

    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
    - +  
     1diff --git src/darwin/dirs.c src/darwin/dirs.c
     2index 381729c..9174602 100644
     3--- src/darwin/dirs.c
     4+++ src/darwin/dirs.c
     5@@ -43,14 +43,20 @@
     6 # define MAXPATHLEN 1024
     7 #endif
     8 
     9-char *config_GetLibDir (void)
     10+// 20150205: we should do case-insensitive filename comparisons. HFS is case-insensitive by default,
     11+// and while it strives to preserve case there is no guarantee that case folding will never occur,
     12+// especially in directory components.
     13+
     14+// @p libDirIsPosix is set to true in if getLibDir() detects we're installed
     15+// in a (linux-specific) posix way, like e.g. MacPorts would do.
     16+char *getLibDir (bool *libDirIsPosix)
     17 {
     18+    *libDirIsPosix = FALSE;
     19     /* Get the full program path and name */
     20     /* First try to see if we are linked to the framework */
     21-    for (unsigned i = 0; i < _dyld_image_count(); i++)
     22-    {
     23+    for (unsigned i = 0; i < _dyld_image_count(); i++) {
     24         const char *psz_img_name = _dyld_get_image_name(i);
     25-        const char *p = strstr( psz_img_name, "VLCKit.framework/Versions/" );
     26+        const char *p = strcasestr( psz_img_name, "VLCKit.framework/Versions/" );
     27 
     28         /* Check for "VLCKit.framework/Versions/Current/VLCKit",
     29          * as well as "VLCKit.framework/Versions/A/VLCKit" and
     30@@ -61,18 +67,18 @@ char *config_GetLibDir (void)
     31             p += strcspn( p, "/" );
     32 
     33             /* If the string ends with VLCKit then we've found a winner */
     34-            if (!strcmp( p, "/VLCKit"))
     35+            if (!strcasecmp( p, "/VLCKit"))
     36                 return strdup( dirname(psz_img_name) );
     37         }
     38 
     39-        /* Do we end by "VLC"? If so we are the legacy VLC.app that doesn't
     40+        /* Do we end by "MacOS/VLC"? If so we are the legacy VLC.app that doesn't
     41          * link to VLCKit. */
     42         size_t len = strlen(psz_img_name);
     43-        if (len >= 3 && !strcmp( psz_img_name + len - 3, "VLC"))
     44+        if (len >= 9 && !strcasecmp( psz_img_name + len - 9, "MacOS/VLC"))
     45             return strdup( dirname(psz_img_name) );
     46 
     47         /* Do we end by "VLC-Plugin"? oh, we must be the NPAPI plugin */
     48-        if (len >= 10 && !strcmp( psz_img_name + len - 10, "VLC-Plugin"))
     49+        if (len >= 10 && !strcasecmp( psz_img_name + len - 10, "VLC-Plugin"))
     50             return strdup( dirname(psz_img_name) );
     51     }
     52 
     53@@ -84,6 +90,7 @@ char *config_GetLibDir (void)
     54         char *path = NULL;
     55         asprintf(&path, "%s/"PACKAGE, incompletepath);
     56         free(incompletepath);
     57+        *libDirIsPosix = TRUE;
     58         return path;
     59     }
     60 
     61@@ -91,15 +98,37 @@ char *config_GetLibDir (void)
     62     abort ();
     63 }
     64 
     65+char *config_GetLibDir (void)
     66+{
     67+    bool isPosixStub;
     68+    return getLibDir (&isPosixStub);
     69+}
     70+
     71 char *config_GetDataDir (void)
     72 {
     73     const char *path = getenv ("VLC_DATA_PATH");
     74     if (path)
     75         return strdup (path);
     76 
     77-    char *vlcpath = config_GetLibDir ();
     78-    char *datadir;
     79+    bool libDirIsPosix;
     80+    char *vlcpath = getLibDir (&libDirIsPosix);
     81+    char *datadir = NULL;
     82 
     83+    if (libDirIsPosix) {
     84+        // vlcpath should point to something like /opt/local/lib/vlc
     85+        // if so, we can chop off the /lib/vlc bit, and then add /share
     86+        // like we would otherwise.
     87+        char *p = strcasestr(vlcpath, "/lib/");
     88+        if (p != NULL) {
     89+            *p = '\0';
     90+        }
     91+        else {
     92+            // something else ... return PKGDATADIR
     93+            free(vlcpath);
     94+            datadir = strdup(PKGDATADIR);
     95+            return datadir;
     96+        }
     97+    }
     98     if (asprintf (&datadir, "%s/share", vlcpath) == -1)
     99         datadir = NULL;
     100 
     101@@ -137,16 +166,24 @@ static char *getAppDependentDir(vlc_userdir_t type)
     102     }
     103 
     104     // Default fallback
     105-    const char *name = "org.videolan.vlc";
     106-
     107-    CFBundleRef mainBundle = CFBundleGetMainBundle();
     108-    if (mainBundle) {
     109-        CFStringRef identifierAsNS = CFBundleGetIdentifier(mainBundle);
     110-        if (identifierAsNS) {
     111-            char identifier[256];
     112-            Boolean ret = CFStringGetCString(identifierAsNS, identifier, sizeof(identifier), kCFStringEncodingUTF8);
     113-            if (ret)
     114-                name = identifier;           
     115+    char name[256] = "org.videolan.vlc";
     116+    bool libDirIsPosix;
     117+    char *vlcpath = getLibDir(&libDirIsPosix);
     118+    if (vlcpath) {
     119+        free(vlcpath);
     120+    }
     121+
     122+    if (!libDirIsPosix) {
     123+        CFBundleRef mainBundle = CFBundleGetMainBundle();
     124+        if (mainBundle) {
     125+            CFStringRef identifierAsNS = CFBundleGetIdentifier(mainBundle);
     126+            if (identifierAsNS) {
     127+                char identifier[256];
     128+                Boolean ret = CFStringGetCString(identifierAsNS, identifier, sizeof(identifier), kCFStringEncodingUTF8);
     129+                // Don't use an empty identifier (= the application that links to us doesn't have a CFBundleIdentifier set).
     130+                if (ret && strlen(identifier))
     131+                    strcpy(name, identifier);
     132+            }
     133         }
     134     }
     135 
  • new file multimedia/VLC/files/files/old/vlc

    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
    - +  
     1#!/bin/sh
     2
     3exec @APPLICATIONS_DIR@/VLC.app/Contents/MacOS/VLC "$@"
  • new file multimedia/VLC/files/files/patch-ffmpeg3-compat.diff

    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
    - +  
     1Submitted By:            Armin K <krejzi au email do com>
     2Date:                    2016-05-06
     3Initial Package Version: 2.2.3
     4Upstream Status:         Committed
     5Origin:                  Upstream
     6Description:             Fixes building against ffmpeg3
     7                         Rediffed for version 2.2.3 by Bruce Dubbs
     8
     9diff -Naur  configure  configure
     10---  configure  2016-04-04 19:45:51.000000000 -0500
     11+++  configure  2016-05-06 22:39:24.859030920 -0500
     12@@ -36549,7 +36549,7 @@
     13 
     14     if test -n "$PKG_CONFIG" && \
     15     { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libavutil < 55\""; } >&5
     16-  ($PKG_CONFIG --exists --print-errors "libavutil < 55") 2>&5
     17+  ($PKG_CONFIG --exists --print-errors "libavutil > 55") 2>&5
     18   ac_status=$?
     19   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
     20   test $ac_status = 0; }; then
     21@@ -36843,7 +36843,7 @@
     22     ffmpeg)
     23       if test -n "$PKG_CONFIG" && \
     24     { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libavcodec >= 57.10.100\""; } >&5
     25-  ($PKG_CONFIG --exists --print-errors "libavcodec >= 57.10.100") 2>&5
     26+  ($PKG_CONFIG --exists --print-errors "libavcodec >= 60.10.100") 2>&5
     27   ac_status=$?
     28   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
     29   test $ac_status = 0; }; then
     30@@ -36927,7 +36927,7 @@
     31       ffmpeg)
     32         if test -n "$PKG_CONFIG" && \
     33     { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libavcodec >= 57.10.100\""; } >&5
     34-  ($PKG_CONFIG --exists --print-errors "libavcodec >= 57.10.100") 2>&5
     35+  ($PKG_CONFIG --exists --print-errors "libavcodec >= 60.10.100") 2>&5
     36   ac_status=$?
     37   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
     38   test $ac_status = 0; }; then
     39@@ -45119,7 +45119,7 @@
     40     ffmpeg) av_vdpau_ver="55.42.100"
     41       if test -n "$PKG_CONFIG" && \
     42     { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libavcodec >= 57.10.100\""; } >&5
     43-  ($PKG_CONFIG --exists --print-errors "libavcodec >= 57.10.100") 2>&5
     44+  ($PKG_CONFIG --exists --print-errors "libavcodec >= 60.10.100") 2>&5
     45   ac_status=$?
     46   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
     47   test $ac_status = 0; }; then
     48diff -Naur  modules/codec/avcodec/audio.c  modules/codec/avcodec/audio.c
     49---  modules/codec/avcodec/audio.c      2015-12-08 10:18:56.000000000 -0600
     50+++  modules/codec/avcodec/audio.c      2016-05-06 22:39:24.859030920 -0500
     51@@ -36,12 +36,11 @@
     52 #include <vlc_codec.h>
     53 #include <vlc_avcodec.h>
     54 
     55+#include "avcodec.h"
     56+
     57 #include <libavcodec/avcodec.h>
     58 #include <libavutil/mem.h>
     59 
     60-#include <libavutil/audioconvert.h>
     61-
     62-#include "avcodec.h"
     63 
     64 /*****************************************************************************
     65  * decoder_sys_t : decoder descriptor
     66diff -Naur  modules/codec/avcodec/avcommon_compat.h  modules/codec/avcodec/avcommon_compat.h
     67---  modules/codec/avcodec/avcommon_compat.h    2015-03-01 08:07:35.000000000 -0600
     68+++  modules/codec/avcodec/avcommon_compat.h    2016-05-06 22:39:24.859030920 -0500
     69@@ -506,6 +506,15 @@
     70 
     71 #endif /* HAVE_LIBAVUTIL_AVUTIL_H */
     72 
     73+#if LIBAVUTIL_VERSION_MAJOR >= 55
     74+# define FF_API_AUDIOCONVERT 1
     75+#endif
     76+
     77+/* libavutil/pixfmt.h */
     78+#ifndef PixelFormat
     79+# define PixelFormat AVPixelFormat
     80+#endif
     81+
     82 #ifdef HAVE_LIBAVFORMAT_AVFORMAT_H
     83 # include <libavformat/avformat.h>
     84 
     85diff -Naur  modules/codec/avcodec/encoder.c  modules/codec/avcodec/encoder.c
     86---  modules/codec/avcodec/encoder.c    2015-10-21 11:36:45.000000000 -0500
     87+++  modules/codec/avcodec/encoder.c    2016-05-06 22:39:24.860030887 -0500
     88@@ -41,7 +41,6 @@
     89 #include <vlc_cpu.h>
     90 
     91 #include <libavcodec/avcodec.h>
     92-#include <libavutil/audioconvert.h>
     93 
     94 #include "avcodec.h"
     95 #include "avcommon.h"
     96@@ -311,7 +310,7 @@
     97     else if( !GetFfmpegCodec( p_enc->fmt_out.i_codec, &i_cat, &i_codec_id,
     98                              &psz_namecodec ) )
     99     {
     100-        if( FindFfmpegChroma( p_enc->fmt_out.i_codec ) == PIX_FMT_NONE )
     101+        if( FindFfmpegChroma( p_enc->fmt_out.i_codec ) == AV_PIX_FMT_NONE )
     102             return VLC_EGENERIC; /* handed chroma output */
     103 
     104         i_cat      = VIDEO_ES;
     105@@ -1017,7 +1016,7 @@
     106         }
     107     }
     108 
     109-    p_sys->frame = avcodec_alloc_frame();
     110+    p_sys->frame = av_frame_alloc();
     111     if( !p_sys->frame )
     112     {
     113         goto error;
     114@@ -1088,7 +1087,8 @@
     115     AVFrame *frame = NULL;
     116     if( likely(p_pict) ) {
     117         frame = p_sys->frame;
     118-        avcodec_get_frame_defaults( frame );
     119+        av_frame_unref( frame );
     120+
     121         for( i_plane = 0; i_plane < p_pict->i_planes; i_plane++ )
     122         {
     123             p_sys->frame->data[i_plane] = p_pict->p[i_plane].p_pixels;
     124@@ -1329,7 +1329,7 @@
     125     //How much we need to copy from new packet
     126     const int leftover = leftover_samples * p_sys->p_context->channels * p_sys->i_sample_bytes;
     127 
     128-    avcodec_get_frame_defaults( p_sys->frame );
     129+    av_frame_unref( p_sys->frame );
     130     p_sys->frame->format     = p_sys->p_context->sample_fmt;
     131     p_sys->frame->nb_samples = leftover_samples + p_sys->i_samples_delay;
     132 
     133@@ -1451,7 +1451,8 @@
     134     while( ( p_aout_buf->i_nb_samples >= p_sys->i_frame_size ) ||
     135            ( p_sys->b_variable && p_aout_buf->i_nb_samples ) )
     136     {
     137-        avcodec_get_frame_defaults( p_sys->frame );
     138+        av_frame_unref( p_sys->frame );
     139+
     140         if( p_sys->b_variable )
     141             p_sys->frame->nb_samples = p_aout_buf->i_nb_samples;
     142         else
     143diff -Naur  modules/codec/avcodec/vaapi.c  modules/codec/avcodec/vaapi.c
     144---  modules/codec/avcodec/vaapi.c      2014-11-16 12:57:58.000000000 -0600
     145+++  modules/codec/avcodec/vaapi.c      2016-05-06 22:39:24.860030887 -0500
     146@@ -595,7 +595,7 @@
     147         return err;
     148 
     149     /* Only VLD supported */
     150-    p_va->pix_fmt = PIX_FMT_VAAPI_VLD;
     151+    p_va->pix_fmt = AV_PIX_FMT_VAAPI_VLD;
     152     p_va->setup = Setup;
     153     p_va->get = Get;
     154     p_va->release = Release;
     155diff -Naur  modules/codec/avcodec/video.c  modules/codec/avcodec/video.c
     156---  modules/codec/avcodec/video.c      2016-04-04 19:45:24.000000000 -0500
     157+++  modules/codec/avcodec/video.c      2016-05-06 22:39:24.860030887 -0500
     158@@ -234,7 +234,7 @@
     159     p_sys->p_codec = p_codec;
     160     p_sys->i_codec_id = i_codec_id;
     161     p_sys->psz_namecodec = psz_namecodec;
     162-    p_sys->p_ff_pic = avcodec_alloc_frame();
     163+    p_sys->p_ff_pic = av_frame_alloc();
     164     p_sys->b_delayed_open = true;
     165     p_sys->p_va = NULL;
     166     vlc_sem_init( &p_sys->sem_mt, 0 );
     167@@ -446,7 +446,7 @@
     168     if( ffmpeg_OpenCodec( p_dec ) < 0 )
     169     {
     170         msg_Err( p_dec, "cannot open codec (%s)", p_sys->psz_namecodec );
     171-        avcodec_free_frame( &p_sys->p_ff_pic );
     172+        av_frame_free( &p_sys->p_ff_pic );
     173         vlc_sem_destroy( &p_sys->sem_mt );
     174         free( p_sys );
     175         return VLC_EGENERIC;
     176@@ -826,7 +826,7 @@
     177     wait_mt( p_sys );
     178 
     179     if( p_sys->p_ff_pic )
     180-        avcodec_free_frame( &p_sys->p_ff_pic );
     181+        av_frame_free( &p_sys->p_ff_pic );
     182 
     183     if( p_sys->p_va )
     184         vlc_va_Delete( p_sys->p_va );
     185diff -Naur  configure.ac  configure.ac
     186--- configure.ac.orig   2017-07-14 17:31:03.000000000 +0200
     187+++ configure.ac        2017-07-14 17:19:32.000000000 +0200
     188@@ -2305,8 +2305,8 @@
     189 [  --enable-avcodec        libavcodec codec (default enabled)])
     190 AS_IF([test "${enable_avcodec}" != "no"], [
     191   PKG_CHECK_MODULES(AVCODEC,[libavcodec >= 53.34.0 libavutil >= 51.22.0], [
     192-    PKG_CHECK_EXISTS([libavutil < 55],, [
     193-      AC_MSG_ERROR([libavutil versions 55 and later are not supported.])
     194+    PKG_CHECK_EXISTS([libavutil < 56],, [
     195+      AC_MSG_ERROR([libavutil versions 56 and later are not supported.])
     196     ])
     197     VLC_SAVE_FLAGS
     198     CPPFLAGS="${CPPFLAGS} ${AVCODEC_CFLAGS}"
     199@@ -2364,8 +2364,8 @@
     200 AS_IF([test "${have_vaapi}" = "yes" -a "${have_avcodec}" = "yes"], [
     201   case "${avfork}" in
     202     ffmpeg)
     203-      PKG_CHECK_EXISTS([libavcodec >= 57.10.100], [
     204-        AC_MSG_ERROR([VA API requires FFmpeg libavcodec < 57.10 or libav.])
     205+      PKG_CHECK_EXISTS([libavcodec >= 60.10.100], [
     206+        AC_MSG_ERROR([VA API requires FFmpeg libavcodec < 60.10 or libav.])
     207       ])
     208       ;;
     209   esac
     210@@ -2398,8 +2398,8 @@
     211   AS_IF([test "x${have_avcodec}" = "xyes"], [
     212     case "${avfork}" in
     213       ffmpeg)
     214-        PKG_CHECK_EXISTS([libavcodec >= 57.10.100], [
     215-          AC_MSG_ERROR([DXVA2 requires FFmpeg libavcodec < 57.10 or libav.])
     216+        PKG_CHECK_EXISTS([libavcodec >= 60.10.100], [
     217+          AC_MSG_ERROR([DXVA2 requires FFmpeg libavcodec < 60.10 or libav.])
     218         ])
     219         ;;
     220     esac
     221@@ -3162,8 +3162,8 @@
     222   case "${avfork}" in
     223     libav) av_vdpau_ver="55.26.0" ;;
     224     ffmpeg) av_vdpau_ver="55.42.100"
     225-      PKG_CHECK_EXISTS([libavcodec >= 57.10.100], [
     226-        AC_MSG_ERROR([VDPAU requires FFmpeg libavcodec < 57.10 or libav.])
     227+      PKG_CHECK_EXISTS([libavcodec >= 60.10.100], [
     228+        AC_MSG_ERROR([VDPAU requires FFmpeg libavcodec < 60.10 or libav.])
     229       ])
     230       ;;
     231   esac
  • new file multimedia/VLC/files/files/patch-ffmpegVLC.diff

    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
    - +  
     1--- orig.configure.ac   2016-05-31 18:11:07.000000000 +0200
     2+++ configure.ac        2016-07-04 23:04:07.557682616 +0200
     3@@ -2283,7 +2272,7 @@
     4 AM_CONDITIONAL([MERGE_FFMPEG], [test "$enable_merge_ffmpeg" != "no"])
     5 
     6 AC_MSG_CHECKING([for libavutil variant])
     7-PKG_CHECK_EXISTS([libavutil], [
     8+PKG_CHECK_EXISTS([libavutil-VLC], [
     9   libavutil_version="$(${PKG_CONFIG} --modversion libavutil)"
     10   libavutil_micro="${libavutil_version##*.}"
     11   AS_IF([test ${libavutil_micro} -le 99], [
     12@@ -2322,8 +2311,8 @@
     13 AC_ARG_ENABLE(avcodec,
     14 [  --enable-avcodec        libavcodec codec (default enabled)])
     15 AS_IF([test "${enable_avcodec}" != "no"], [
     16-  PKG_CHECK_MODULES(AVCODEC,[libavcodec >= 53.34.0 libavutil >= 51.22.0], [
     17-    PKG_CHECK_EXISTS([libavutil < 55],, [
     18+  PKG_CHECK_MODULES(AVCODEC,[libavcodec-VLC >= 53.34.0 libavutil-VLC >= 51.22.0], [
     19+    PKG_CHECK_EXISTS([libavutil-VLC < 55],, [
     20       AC_MSG_ERROR([libavutil versions 55 and later are not supported.])
     21     ])
     22     VLC_SAVE_FLAGS
     23@@ -2382,7 +2371,7 @@
     24 AS_IF([test "${have_vaapi}" = "yes" -a "${have_avcodec}" = "yes"], [
     25   case "${avfork}" in
     26     ffmpeg)
     27-      PKG_CHECK_EXISTS([libavcodec >= 57.10.100], [
     28+      PKG_CHECK_EXISTS([libavcodec-VLC >= 57.10.100], [
     29         AC_MSG_ERROR([VA API requires FFmpeg libavcodec < 57.10 or libav.])
     30       ])
     31       ;;
     32@@ -2416,7 +2405,7 @@
     33   AS_IF([test "x${have_avcodec}" = "xyes"], [
     34     case "${avfork}" in
     35       ffmpeg)
     36-        PKG_CHECK_EXISTS([libavcodec >= 57.10.100], [
     37+        PKG_CHECK_EXISTS([libavcodec-VLC >= 57.10.100], [
     38           AC_MSG_ERROR([DXVA2 requires FFmpeg libavcodec < 57.10 or libav.])
     39         ])
     40         ;;
     41@@ -2496,7 +2485,7 @@
     42 ])
     43 have_avformat="no"
     44 AS_IF([test "${enable_avformat}" != "no"], [
     45-  PKG_CHECK_MODULES(AVFORMAT,[libavformat >= 53.21.0 libavcodec libavutil], [
     46+  PKG_CHECK_MODULES(AVFORMAT,[libavformat-VLC >= 53.21.0 libavcodec-VLC libavutil-VLC], [
     47       have_avformat="yes"
     48       VLC_SAVE_FLAGS
     49       CPPFLAGS="${CPPFLAGS} ${AVFORMAT_CFLAGS}"
     50@@ -2523,7 +2512,7 @@
     51           (default enabled)]))
     52 if test "${enable_swscale}" != "no"
     53 then
     54-  PKG_CHECK_MODULES(SWSCALE,[libswscale],
     55+  PKG_CHECK_MODULES(SWSCALE,[libswscale-VLC],
     56     [
     57       VLC_SAVE_FLAGS
     58       CPPFLAGS="${CPPFLAGS} ${SWSCALE_CFLAGS}"
     59@@ -2550,7 +2539,7 @@
     60 [  --enable-postproc       libpostproc image post-processing (default auto)])
     61 if test "${enable_postproc}" != "no"
     62 then
     63-  PKG_CHECK_MODULES(POSTPROC,[libpostproc libavutil],
     64+  PKG_CHECK_MODULES(POSTPROC,[libpostproc-VLC libavutil-VLC],
     65     [
     66       VLC_SAVE_FLAGS
     67       CPPFLAGS="${CPPFLAGS} ${POSTPROC_CFLAGS}"
     68@@ -3180,12 +3169,12 @@
     69   case "${avfork}" in
     70     libav) av_vdpau_ver="55.26.0" ;;
     71     ffmpeg) av_vdpau_ver="55.42.100"
     72-      PKG_CHECK_EXISTS([libavcodec >= 57.10.100], [
     73+      PKG_CHECK_EXISTS([libavcodec-VLC >= 57.10.100], [
     74         AC_MSG_ERROR([VDPAU requires FFmpeg libavcodec < 57.10 or libav.])
     75       ])
     76       ;;
     77   esac
     78-  PKG_CHECK_EXISTS([libavutil >= 52.4.0 libavcodec >= ${av_vdpau_ver}], [
     79+  PKG_CHECK_EXISTS([libavutil-VLC >= 52.4.0 libavcodec-VLC >= ${av_vdpau_ver}], [
     80     have_avcodec_vdpau="yes"
     81     AC_MSG_NOTICE([VDPAU decoding acceleration activated])
     82   ], [
  • new file multimedia/VLC/files/files/patch-for-lua52.diff

    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
    - +  
     1diff --git configure.ac configure.ac
     2index 95f24fc..15c274b 100644
     3--- configure.ac
     4+++ configure.ac
     5@@ -1481,7 +1481,7 @@ AC_ARG_ENABLE(lua,
     6     [disable LUA scripting support (default enabled)])])
     7 if test "${enable_lua}" != "no"
     8 then
     9-  PKG_CHECK_MODULES(LUA, lua5.2,
     10+  PKG_CHECK_MODULES(LUA, lua-5.2,
     11     [ have_lua=yes ],
     12     [
     13     AC_MSG_WARN([${LUA_PKG_ERRORS}, trying lua 5.1 instead])
     14@@ -1498,8 +1498,8 @@ then
     15           AC_CHECK_HEADERS([lua.h lauxlib.h lualib.h],
     16             [],
     17             [ have_lua=no ] )
     18-          AC_CHECK_LIB(  lua5.2 , luaL_newstate,
     19-            [LUA_LIBS="-llua5.2"],
     20+          AC_CHECK_LIB(  lua-5.2 , luaL_newstate,
     21+            [LUA_LIBS="-llua-5.2"],
     22           AC_CHECK_LIB( lua5.1 , luaL_newstate,
     23             [LUA_LIBS="-llua5.1"],
     24             AC_CHECK_LIB( lua51 , luaL_newstate,
     25@@ -1516,7 +1516,7 @@ then
     26       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.])
     27   fi
     28   AC_ARG_VAR([LUAC], [LUA byte compiler])
     29-  AC_PATH_PROGS(LUAC,[${LUAC} luac], [false])
     30+  AC_PATH_PROGS(LUAC,[${LUAC} luac5.2], [false])
     31   AS_IF([test "${LUAC}" = "false"], [
     32     AC_MSG_ERROR([Could not find the LUA byte compiler.])
     33   ])
     34diff --git modules/lua/vlc.h modules/lua/vlc.h
     35index c7a2913..b5ebbd8 100644
     36--- modules/lua/vlc.h
     37+++ modules/lua/vlc.h
     38@@ -39,9 +39,9 @@
     39 #include <vlc_demux.h>
     40 
     41 #define LUA_COMPAT_MODULE
     42-#include <lua.h>        /* Low level lua C API */
     43-#include <lauxlib.h>    /* Higher level C API */
     44-#include <lualib.h>     /* Lua libs */
     45+#include <lua-5.2/lua.h>        /* Low level lua C API */
     46+#include <lua-5.2/lauxlib.h>    /* Higher level C API */
     47+#include <lua-5.2/lualib.h>     /* Lua libs */
     48 #if LUA_VERSION_NUM >= 502
     49 #define lua_equal(L,idx1,idx2)         lua_compare(L,(idx1),(idx2),LUA_OPEQ)
     50 #define lua_objlen(L,idx)                      lua_rawlen(L,idx)
  • new file multimedia/VLC/files/files/patch-no-opencv_example.diff

    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
    - +  
     1--- modules/video_filter/orig.Makefile.am       2016-02-24 17:57:51.000000000 +0100
     2+++ modules/video_filter/Makefile.am    2016-02-24 18:20:24.000000000 +0100
     3@@ -257,16 +257,6 @@
     4 liboldmovie_plugin_la_LIBADD = $(LIBS_oldmovie)
     5 liboldmovie_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(video_filterdir)' $(LDFLAGS_oldmovie)
     6 
     7-libopencv_example_plugin_la_SOURCES = $(SOURCES_opencv_example)
     8-libopencv_example_plugin_la_CPPFLAGS = $(AM_CPPFLAGS) $(CPPFLAGS_opencv_example)       -DMODULE_NAME_IS_opencv_example
     9-libopencv_example_plugin_la_CFLAGS = $(AM_CFLAGS) $(CFLAGS_opencv_example)
     10-libopencv_example_plugin_la_CXXFLAGS = $(AM_CXXFLAGS) $(CXXFLAGS_opencv_example)
     11-libopencv_example_plugin_la_OBJCFLAGS = $(AM_OBJCFLAGS) $(OBJCFLAGS_opencv_example)
     12-libopencv_example_plugin_la_LIBADD = $(LIBS_opencv_example)
     13-libopencv_example_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(video_filterdir)' $(LDFLAGS_opencv_example)
     14-EXTRA_LTLIBRARIES += libopencv_example_plugin.la
     15-video_filter_LTLIBRARIES += $(LTLIBopencv_example)
     16-
     17 libopencv_wrapper_plugin_la_SOURCES = $(SOURCES_opencv_wrapper)
     18 libopencv_wrapper_plugin_la_CPPFLAGS = $(AM_CPPFLAGS) $(CPPFLAGS_opencv_wrapper)       -DMODULE_NAME_IS_opencv_wrapper
     19 libopencv_wrapper_plugin_la_CFLAGS = $(AM_CFLAGS) $(CFLAGS_opencv_wrapper)
     20Exit 1
     21--- modules/video_filter/orig.Makefile.in       2016-02-24 17:58:32.000000000 +0100
     22+++ modules/video_filter/Makefile.in    2016-02-24 18:22:02.000000000 +0100
     23@@ -472,15 +472,6 @@
     24        $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
     25        $(liboldmovie_plugin_la_CFLAGS) $(CFLAGS) \
     26        $(liboldmovie_plugin_la_LDFLAGS) $(LDFLAGS) -o $@
     27-libopencv_example_plugin_la_DEPENDENCIES = $(am__DEPENDENCIES_1)
     28-am__objects_32 = libopencv_example_plugin_la-opencv_example.lo
     29-am_libopencv_example_plugin_la_OBJECTS = $(am__objects_32)
     30-libopencv_example_plugin_la_OBJECTS =  \
     31-       $(am_libopencv_example_plugin_la_OBJECTS)
     32-libopencv_example_plugin_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX \
     33-       $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CXXLD) \
     34-       $(libopencv_example_plugin_la_CXXFLAGS) $(CXXFLAGS) \
     35-       $(libopencv_example_plugin_la_LDFLAGS) $(LDFLAGS) -o $@
     36 libopencv_wrapper_plugin_la_DEPENDENCIES = $(am__DEPENDENCIES_1)
     37 am__objects_33 = libopencv_wrapper_plugin_la-opencv_wrapper.lo
     38 am_libopencv_wrapper_plugin_la_OBJECTS = $(am__objects_33)
     39@@ -706,7 +697,6 @@
     40        $(libmotionblur_plugin_la_SOURCES) \
     41        $(libmotiondetect_plugin_la_SOURCES) \
     42        $(liboldmovie_plugin_la_SOURCES) \
     43-       $(libopencv_example_plugin_la_SOURCES) \
     44        $(libopencv_wrapper_plugin_la_SOURCES) \
     45        $(libposterize_plugin_la_SOURCES) \
     46        $(libpostproc_plugin_la_SOURCES) \
     47@@ -746,7 +736,6 @@
     48        $(libmotionblur_plugin_la_SOURCES) \
     49        $(libmotiondetect_plugin_la_SOURCES) \
     50        $(liboldmovie_plugin_la_SOURCES) \
     51-       $(libopencv_example_plugin_la_SOURCES) \
     52        $(libopencv_wrapper_plugin_la_SOURCES) \
     53        $(libposterize_plugin_la_SOURCES) \
     54        $(libpostproc_plugin_la_SOURCES) \
     55@@ -856,7 +845,6 @@
     56 CFLAGS_ogg = @CFLAGS_ogg@
     57 CFLAGS_omxil = @CFLAGS_omxil@
     58 CFLAGS_omxil_vout = @CFLAGS_omxil_vout@
     59-CFLAGS_opencv_example = @CFLAGS_opencv_example@
     60 CFLAGS_opencv_wrapper = @CFLAGS_opencv_wrapper@
     61 CFLAGS_opus = @CFLAGS_opus@
     62 CFLAGS_postproc = @CFLAGS_postproc@
     63@@ -924,7 +912,6 @@
     64 CPPFLAGS_mux_ogg = @CPPFLAGS_mux_ogg@
     65 CPPFLAGS_notify = @CPPFLAGS_notify@
     66 CPPFLAGS_ogg = @CPPFLAGS_ogg@
     67-CPPFLAGS_opencv_example = @CPPFLAGS_opencv_example@
     68 CPPFLAGS_opencv_wrapper = @CPPFLAGS_opencv_wrapper@
     69 CPPFLAGS_opus = @CPPFLAGS_opus@
     70 CPPFLAGS_qsv = @CPPFLAGS_qsv@
     71@@ -1146,7 +1133,6 @@
     72 LIBS_ogg = @LIBS_ogg@
     73 LIBS_oldmovie = @LIBS_oldmovie@
     74 LIBS_oldrc = @LIBS_oldrc@
     75-LIBS_opencv_example = @LIBS_opencv_example@
     76 LIBS_opencv_wrapper = @LIBS_opencv_wrapper@
     77 LIBS_opus = @LIBS_opus@
     78 LIBS_param_eq = @LIBS_param_eq@
     79@@ -1282,7 +1268,6 @@
     80 LTLIBogg = @LTLIBogg@
     81 LTLIBomxil = @LTLIBomxil@
     82 LTLIBomxil_vout = @LTLIBomxil_vout@
     83-LTLIBopencv_example = @LTLIBopencv_example@
     84 LTLIBopencv_wrapper = @LTLIBopencv_wrapper@
     85 LTLIBopensles_android = @LTLIBopensles_android@
     86 LTLIBopus = @LTLIBopus@
     87@@ -1594,9 +1579,9 @@
     88        libwave_plugin.la libgradfun_plugin.la libyuvp_plugin.la \
     89        libantiflicker_plugin.la libhqdn3d_plugin.la \
     90        libanaglyph_plugin.la liboldmovie_plugin.la libvhs_plugin.la \
     91-       libfreeze_plugin.la $(LTLIBatmo) $(LTLIBopencv_example) \
     92+       libfreeze_plugin.la $(LTLIBatmo) \
     93        $(LTLIBopencv_wrapper) $(LTLIBpostproc)
     94-EXTRA_LTLIBRARIES = libatmo_plugin.la libopencv_example_plugin.la \
     95+EXTRA_LTLIBRARIES = libatmo_plugin.la \
     96        libopencv_wrapper_plugin.la libpostproc_plugin.la
     97 EXTRA_DIST = Modules.am
     98 AUTOMAKE_OPTIONS = subdir-objects
     99@@ -1668,7 +1653,6 @@
     100 SOURCES_gradient = gradient.c
     101 SOURCES_ball = ball.c
     102 SOURCES_opencv_wrapper = opencv_wrapper.c
     103-SOURCES_opencv_example = opencv_example.cpp filter_event_info.h
     104 librotate_plugin_la_SOURCES = rotate.c
     105 librotate_plugin_la_LIBADD = ../control/libvlc_motion.la $(LIBM)
     106 librotate_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath \
     107@@ -1929,20 +1913,6 @@
     108 liboldmovie_plugin_la_OBJCFLAGS = $(AM_OBJCFLAGS) $(OBJCFLAGS_oldmovie)
     109 liboldmovie_plugin_la_LIBADD = $(LIBS_oldmovie)
     110 liboldmovie_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(video_filterdir)' $(LDFLAGS_oldmovie)
     111-libopencv_example_plugin_la_SOURCES = $(SOURCES_opencv_example)
     112-libopencv_example_plugin_la_CPPFLAGS = $(AM_CPPFLAGS) $(CPPFLAGS_opencv_example)       -DMODULE_NAME_IS_opencv_example
     113-libopencv_example_plugin_la_CFLAGS = $(AM_CFLAGS) $(CFLAGS_opencv_example)
     114-libopencv_example_plugin_la_CXXFLAGS = $(AM_CXXFLAGS) $(CXXFLAGS_opencv_example)
     115-libopencv_example_plugin_la_OBJCFLAGS = $(AM_OBJCFLAGS) $(OBJCFLAGS_opencv_example)
     116-libopencv_example_plugin_la_LIBADD = $(LIBS_opencv_example)
     117-libopencv_example_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(video_filterdir)' $(LDFLAGS_opencv_example)
     118-libopencv_wrapper_plugin_la_SOURCES = $(SOURCES_opencv_wrapper)
     119-libopencv_wrapper_plugin_la_CPPFLAGS = $(AM_CPPFLAGS) $(CPPFLAGS_opencv_wrapper)       -DMODULE_NAME_IS_opencv_wrapper
     120-libopencv_wrapper_plugin_la_CFLAGS = $(AM_CFLAGS) $(CFLAGS_opencv_wrapper)
     121-libopencv_wrapper_plugin_la_CXXFLAGS = $(AM_CXXFLAGS) $(CXXFLAGS_opencv_wrapper)
     122-libopencv_wrapper_plugin_la_OBJCFLAGS = $(AM_OBJCFLAGS) $(OBJCFLAGS_opencv_wrapper)
     123-libopencv_wrapper_plugin_la_LIBADD = $(LIBS_opencv_wrapper)
     124-libopencv_wrapper_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(video_filterdir)' $(LDFLAGS_opencv_wrapper)
     125 libposterize_plugin_la_SOURCES = $(SOURCES_posterize)
     126 libposterize_plugin_la_CPPFLAGS = $(AM_CPPFLAGS) $(CPPFLAGS_posterize)         -DMODULE_NAME_IS_posterize
     127 libposterize_plugin_la_CFLAGS = $(AM_CFLAGS) $(CFLAGS_posterize)
     128@@ -2305,8 +2275,6 @@
     129 liboldmovie_plugin.la: $(liboldmovie_plugin_la_OBJECTS) $(liboldmovie_plugin_la_DEPENDENCIES) $(EXTRA_liboldmovie_plugin_la_DEPENDENCIES)
     130        $(AM_V_CCLD)$(liboldmovie_plugin_la_LINK) -rpath $(video_filterdir) $(liboldmovie_plugin_la_OBJECTS) $(liboldmovie_plugin_la_LIBADD) $(LIBS)
     131 
     132-libopencv_example_plugin.la: $(libopencv_example_plugin_la_OBJECTS) $(libopencv_example_plugin_la_DEPENDENCIES) $(EXTRA_libopencv_example_plugin_la_DEPENDENCIES)
     133-       $(AM_V_CXXLD)$(libopencv_example_plugin_la_LINK)  $(libopencv_example_plugin_la_OBJECTS) $(libopencv_example_plugin_la_LIBADD) $(LIBS)
     134 
     135 libopencv_wrapper_plugin.la: $(libopencv_wrapper_plugin_la_OBJECTS) $(libopencv_wrapper_plugin_la_DEPENDENCIES) $(EXTRA_libopencv_wrapper_plugin_la_DEPENDENCIES)
     136        $(AM_V_CCLD)$(libopencv_wrapper_plugin_la_LINK)  $(libopencv_wrapper_plugin_la_OBJECTS) $(libopencv_wrapper_plugin_la_LIBADD) $(LIBS)
     137@@ -2404,7 +2372,6 @@
     138 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmotionblur_plugin_la-motionblur.Plo@am__quote@
     139 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmotiondetect_plugin_la-motiondetect.Plo@am__quote@
     140 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liboldmovie_plugin_la-oldmovie.Plo@am__quote@
     141-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libopencv_example_plugin_la-opencv_example.Plo@am__quote@
     142 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libopencv_wrapper_plugin_la-opencv_wrapper.Plo@am__quote@
     143 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libposterize_plugin_la-posterize.Plo@am__quote@
     144 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpostproc_plugin_la-postproc.Plo@am__quote@
     145@@ -3052,12 +3019,6 @@
     146 @AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     147 @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
     148 
     149-libopencv_example_plugin_la-opencv_example.lo: opencv_example.cpp
     150-@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
     151-@am__fastdepCXX_TRUE@  $(AM_V_at)$(am__mv) $(DEPDIR)/libopencv_example_plugin_la-opencv_example.Tpo $(DEPDIR)/libopencv_example_plugin_la-opencv_example.Plo
     152-@AMDEP_TRUE@@am__fastdepCXX_FALSE@     $(AM_V_CXX)source='opencv_example.cpp' object='libopencv_example_plugin_la-opencv_example.lo' libtool=yes @AMDEPBACKSLASH@
     153-@AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     154-@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
     155 
     156 mostlyclean-libtool:
     157        -rm -f *.lo
     158Exit 1
     159--- modules/video_filter/orig.Modules.am        2015-02-02 20:42:29.000000000 +0100
     160+++ modules/video_filter/Modules.am     2016-02-24 18:22:23.000000000 +0100
     161@@ -65,7 +65,6 @@
     162 SOURCES_gradient = gradient.c
     163 SOURCES_ball = ball.c
     164 SOURCES_opencv_wrapper = opencv_wrapper.c
     165-SOURCES_opencv_example = opencv_example.cpp filter_event_info.h
     166 
     167 librotate_plugin_la_SOURCES = rotate.c
     168 librotate_plugin_la_LIBADD = ../control/libvlc_motion.la $(LIBM)
  • new file multimedia/VLC/files/files/patch-opencv_includes.diff

    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
    - +  
     1--- modules/video_filter/opencv_wrapper.c.orig  2016-02-23 10:07:58.000000000 +0100
     2+++ modules/video_filter/opencv_wrapper.c       2016-02-23 10:03:36.000000000 +0100
     3@@ -39,6 +39,7 @@
     4 #include <vlc_image.h>
     5 #include "filter_picture.h"
     6 
     7+#include <opencv2/core/fast_math.hpp>
     8 #include <opencv2/core/core_c.h>
     9 #include <opencv2/core/types_c.h>
     10 
  • new file multimedia/VLC/files/files/patch-really-no-qtkit.diff

    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
    - +  
     1--- modules/gui/macosx/orig.open.m      2016-12-17 19:55:54.000000000 +0100
     2+++ modules/gui/macosx/open.m   2016-12-17 20:26:12.000000000 +0100
     3@@ -40,7 +40,14 @@
     4 #import <IOKit/storage/IODVDMedia.h>
     5 #import <IOKit/storage/IOBDMedia.h>
     6 #import <Cocoa/Cocoa.h>
     7+#import <AvailabilityMacros.h>
     8+#if defined(MAC_OS_X_VERSION_10_12) \
     9+    && ((MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12) || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_12))
     10+#warning "Excluding all code and features based on QTKit"
     11+#else
     12 #import <QTKit/QTKit.h>
     13+#define HAVE_QTKIT
     14+#endif
     15 
     16 #import "intf.h"
     17 #import "playlist.h"
     18@@ -51,8 +58,10 @@
     19 
     20 #import <vlc_url.h>
     21 
     22+#ifdef HAVE_QTKIT
     23 NSArray *qtkvideoDevices;
     24 NSArray *qtkaudioDevices;
     25+#endif
     26 #define setEyeTVUnconnected \
     27 [o_capture_lbl setStringValue: _NS("No device is selected")]; \
     28 [o_capture_long_lbl setStringValue: _NS("No device is selected.\n\nChoose available device in above pull-down menu.\n")]; \
     29@@ -207,7 +216,9 @@
     30     [o_screen_width_lbl setStringValue: [NSString stringWithFormat:@"%@:",_NS("Subscreen width")]];
     31     [o_screen_height_lbl setStringValue: [NSString stringWithFormat:@"%@:",_NS("Subscreen height")]];
     32     [o_screen_follow_mouse_ckb setTitle: _NS("Follow the mouse")];
     33+#ifdef HAVE_QTKIT
     34     [o_screen_qtk_audio_ckb setTitle: _NS("Capture Audio")];
     35+#endif
     36     [o_eyetv_currentChannel_lbl setStringValue: _NS("Current channel:")];
     37     [o_eyetv_previousProgram_btn setTitle: _NS("Previous Channel")];
     38     [o_eyetv_nextProgram_btn setTitle: _NS("Next Channel")];
     39@@ -223,6 +234,7 @@
     40     [o_file_starttime_fld setFormatter:[[[PositionFormatter alloc] init] autorelease]];
     41     [o_file_stoptime_fld setFormatter:[[[PositionFormatter alloc] init] autorelease]];
     42 
     43+#ifdef HAVE_QTKIT
     44     [self qtkvideoDevices];
     45     [o_qtk_video_device_pop removeAllItems];
     46     msg_Dbg(VLCIntf, "Found %lu video capture devices", [qtkvideoDevices count]);
     47@@ -275,6 +287,7 @@
     48         [o_screen_qtk_audio_pop addItemWithTitle: _NS("None")];
     49         [qtkaudio_currdevice_uid release];
     50     }
     51+#endif
     52 
     53     [self setSubPanel];
     54 
     55@@ -321,7 +334,9 @@
     56     [[sharedWorkspace notificationCenter] addObserver:self selector:@selector(scanOpticalMedia:) name:NSWorkspaceDidMountNotification object:nil];
     57     [[sharedWorkspace notificationCenter] addObserver:self selector:@selector(scanOpticalMedia:) name:NSWorkspaceDidUnmountNotification object:nil];
     58 
     59+#ifdef HAVE_QTKIT
     60     [self qtkToggleUIElements:nil];
     61+#endif
     62     [self scanOpticalMedia:nil];
     63 
     64     [self setMRL: @""];
     65@@ -504,16 +519,20 @@
     66                     [o_options addObject: @"screen-follow-mouse"];
     67                 else
     68                     [o_options addObject: @"no-screen-follow-mouse"];
     69+#ifdef HAVE_QTKIT
     70                 if ([o_screen_qtk_audio_ckb state] && qtkaudio_currdevice_uid)
     71                    [o_options addObject: [NSString stringWithFormat: @"input-slave=qtsound://%@", qtkaudio_currdevice_uid]];
     72+#endif
     73             }
     74             else if ([[[o_capture_mode_pop selectedItem] title] isEqualToString: _NS("Input Devices")]) {
     75+#ifdef HAVE_QTKIT
     76                 if ([o_qtk_video_ckb state]) {
     77                     [o_options addObject: [NSString stringWithFormat: @"qtcapture-width=%i", [o_capture_width_fld intValue]]];
     78                     [o_options addObject: [NSString stringWithFormat: @"qtcapture-height=%i", [o_capture_height_fld intValue]]];
     79                     if ([o_qtk_audio_ckb state] && qtkaudio_currdevice_uid)
     80                        [o_options addObject: [NSString stringWithFormat: @"input-slave=qtsound://%@", qtkaudio_currdevice_uid]];
     81                 }
     82+#endif
     83             }
     84         }
     85 
     86@@ -539,11 +558,14 @@
     87     [o_screen_width_stp setMaxValue: item->rect.size.width];
     88     [o_screen_height_stp setMaxValue: item->rect.size.height];
     89 
     90+#ifdef HAVE_QTKIT
     91     [o_screen_qtk_audio_pop setEnabled: [o_screen_qtk_audio_ckb state]];
     92+#endif
     93 }
     94 
     95 - (IBAction)qtkChanged:(id)sender
     96 {
     97+#ifdef HAVE_QTKIT
     98     NSInteger i_selectedDevice = [o_qtk_video_device_pop indexOfSelectedItem];
     99     if ([qtkvideoDevices count] >= 1) {
     100         NSValue *sizes = [[[[qtkvideoDevices objectAtIndex:i_selectedDevice] formatDescriptions] objectAtIndex:0] attributeForKey: QTFormatDescriptionVideoEncodedPixelsSizeAttribute];
     101@@ -554,20 +576,24 @@
     102         [o_capture_height_stp setIntValue: [o_capture_height_fld intValue]];
     103         qtk_currdevice_uid = [[(QTCaptureDevice *)[qtkvideoDevices objectAtIndex:i_selectedDevice] uniqueID] stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];
     104     }
     105+#endif
     106 }
     107 
     108 - (IBAction)qtkAudioChanged:(id)sender
     109 {
     110+#ifdef HAVE_QTKIT
     111     NSInteger i_selectedDevice = [o_qtk_audio_device_pop indexOfSelectedItem];
     112     if ([qtkaudioDevices count] >= 1) {
     113         qtkaudio_currdevice_uid = [[(QTCaptureDevice *)[qtkaudioDevices objectAtIndex:i_selectedDevice] uniqueID] stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];
     114     }
     115     [o_screen_qtk_audio_pop selectItemAtIndex: i_selectedDevice];
     116     [o_qtk_audio_device_pop selectItemAtIndex: i_selectedDevice];
     117+#endif
     118 }
     119 
     120 - (IBAction)qtkToggleUIElements:(id)sender
     121 {
     122+#ifdef HAVE_QTKIT
     123     [o_qtk_audio_device_pop setEnabled:[o_qtk_audio_ckb state]];
     124     BOOL b_state = [o_qtk_video_ckb state];
     125     [o_qtk_video_device_pop setEnabled:b_state];
     126@@ -578,6 +604,7 @@
     127     [self qtkAudioChanged:sender];
     128     [self qtkChanged:sender];
     129     [self openCaptureModeChanged:sender];
     130+#endif
     131 }
     132 
     133 #pragma mark -
     134@@ -1402,18 +1429,22 @@
     135         }
     136     }
     137     else if ([[[o_capture_mode_pop selectedItem] title] isEqualToString: _NS("Input Devices")]) {
     138+#ifdef HAVE_QTKIT
     139         [self showCaptureView: o_qtk_view];
     140         if ([o_capture_width_fld intValue] <= 0)
     141             [self qtkChanged:nil];
     142 
     143         [self qtkAudioChanged:nil];
     144+#endif
     145 
     146         [self setMRL: @""];
     147 
     148+#ifdef HAVE_QTKIT
     149         if ([o_qtk_video_ckb state] && qtk_currdevice_uid)
     150             [self setMRL:[NSString stringWithFormat:@"qtcapture://%@", qtk_currdevice_uid]];
     151         else if ([o_qtk_audio_ckb state] && qtkaudio_currdevice_uid)
     152             [self setMRL:[NSString stringWithFormat:@"qtsound://%@", qtkaudio_currdevice_uid]];
     153+#endif
     154     }
     155 }
     156 
     157@@ -1597,28 +1628,40 @@
     158 
     159 - (NSArray *)qtkvideoDevices
     160 {
     161+#ifdef HAVE_QTKIT
     162     if (!qtkvideoDevices)
     163         [self qtkrefreshVideoDevices];
     164     return qtkvideoDevices;
     165+#else
     166+    return NULL;
     167+#endif
     168 }
     169 
     170 - (void)qtkrefreshVideoDevices
     171 {
     172+#ifdef HAVE_QTKIT
     173     [qtkvideoDevices release];
     174     qtkvideoDevices = [[[QTCaptureDevice inputDevicesWithMediaType:QTMediaTypeVideo] arrayByAddingObjectsFromArray:[QTCaptureDevice inputDevicesWithMediaType:QTMediaTypeMuxed]] retain];
     175+#endif
     176 }
     177 
     178 - (NSArray *)qtkaudioDevices
     179 {
     180+#ifdef HAVE_QTKIT
     181     if (!qtkaudioDevices)
     182         [self qtkrefreshAudioDevices];
     183     return qtkaudioDevices;
     184+#else
     185+    return NULL;
     186+#endif
     187 }
     188 
     189 - (void)qtkrefreshAudioDevices
     190 {
     191+#ifdef HAVE_QTKIT
     192     [qtkaudioDevices release];
     193     qtkaudioDevices = [[[QTCaptureDevice inputDevicesWithMediaType:QTMediaTypeSound] arrayByAddingObjectsFromArray:[QTCaptureDevice inputDevicesWithMediaType:QTMediaTypeMuxed]] retain];
     194+#endif
     195 }
     196 
     197 @end
  • new file multimedia/VLC/files/files/patch-simplepreferences.diff

    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
    - +  
     1diff --git modules/gui/qt4/components/simple_preferences.cpp modules/gui/qt4/components/simple_preferences.cpp
     2index 2487cc4..cfe6a3b 100644
     3--- modules/gui/qt4/components/simple_preferences.cpp
     4+++ modules/gui/qt4/components/simple_preferences.cpp
     5@@ -225,7 +225,7 @@ static int getDefaultAudioVolume(vlc_object_t *obj, const char *aout)
     6         return -1;
     7     else
     8 #ifdef __APPLE__
     9-    if (!strcmp("auhal") && module_exists("auhal"))
     10+    if (!strcmp(aout, "auhal") && module_exists("auhal"))
     11         return (config_GetFloat(obj, "auhal-volume") * 100.f + .5f)
     12                  / AOUT_VOLUME_DEFAULT;
     13     else
  • new file multimedia/VLC/files/files/patch-soundfont-path.diff

    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
    - +  
     1diff --git modules/codec/fluidsynth.c modules/codec/fluidsynth.c
     2index bdc8d24..9859aa1 100644
     3--- modules/codec/fluidsynth.c
     4+++ modules/codec/fluidsynth.c
     5@@ -125,7 +125,7 @@ static int Open (vlc_object_t *p_this)
     6     {
     7         glob_t gl;
     8 
     9-        glob ("/usr/share/sounds/sf2/*.sf2", GLOB_NOESCAPE, NULL, &gl);
     10+        glob ("@PREFIX@/share/sounds/sf2/*.sf2", GLOB_NOESCAPE, NULL, &gl);
     11         for (size_t i = 0; i < gl.gl_pathc; i++)
     12         {
     13             const char *path = gl.gl_pathv[i];
  • new file multimedia/VLC/files/files/patch-static_assert.diff

    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
    - +  
     1--- config.h.orig    2016-03-22 15:34:33.000000000 +0000
     2+++ config.h 2016-03-22 15:34:57.000000000 +0000
     3@@ -793,6 +793,7 @@
     4 /* Define to `int' if <stddef.h> does not define. */
     5 /* #undef ssize_t */
     6
     7+#define static_assert _Static_assert
     8 #include <vlc_fixups.h>
     9
     10
     11
  • new file multimedia/VLC/files/files/patch-use-NSGetEnviron.diff

    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
    - +  
     1--- modules/misc/inhibit/orig.xdg.c     2014-08-14 09:20:04.000000000 +0200
     2+++ modules/misc/inhibit/xdg.c  2017-08-18 14:11:43.000000000 +0200
     3@@ -48,7 +48,7 @@
     4     posix_spawnattr_t attr;
     5 };
     6 
     7-extern char **environ;
     8+#include <crt_externs.h>
     9 
     10 static void Timer (void *data)
     11 {
     12@@ -60,7 +60,7 @@
     13     pid_t pid;
     14 
     15     int err = posix_spawnp (&pid, "xdg-screensaver", NULL, &sys->attr,
     16-                            argv, environ);
     17+                            argv, *_NSGetEnviron());
     18     if (err == 0)
     19     {
     20         int status;
     21--- modules/stream_filter/orig.decomp.c 2015-04-13 21:54:35.000000000 +0200
     22+++ modules/stream_filter/decomp.c      2017-08-18 14:11:46.000000000 +0200
     23@@ -92,7 +92,7 @@
     24     int64_t      pts_delay;
     25 };
     26 
     27-extern char **environ;
     28+#include <crt_externs.h>
     29 
     30 static const size_t bufsize = 65536;
     31 #ifdef HAVE_VMSPLICE
     32@@ -361,7 +361,7 @@
     33                 if (!posix_spawn_file_actions_adddup2 (&actions, comp[0], 0)
     34                  && !posix_spawn_file_actions_adddup2 (&actions, uncomp[1], 1)
     35                  && !posix_spawnp (&p_sys->pid, path, &actions, NULL, argv,
     36-                                   environ))
     37+                                   *_NSGetEnviron()))
     38                 {
     39                     if (vlc_clone (&p_sys->thread, Thread, stream,
     40                                    VLC_THREAD_PRIORITY_INPUT) == 0)
  • new file multimedia/VLC/files/files/patch-vlc-for-macports.diff

    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
    - +  
     1diff --git modules/lua/vlc.c modules/lua/vlc.c
     2index df235d0..b753346 100644
     3--- modules/lua/vlc.c
     4+++ modules/lua/vlc.c
     5@@ -232,10 +232,22 @@ int vlclua_dir_list( const char *luadirname, char ***pppsz_dir_list )
     6             i++;
     7
     8 #if defined(__APPLE__)
     9-        if( likely(asprintf( &ppsz_dir_list[i],
     10+        if( strcasestr (psz_datapath, "/share") == NULL
     11+            && likely(asprintf( &ppsz_dir_list[i],
     12                              "%s"DIR_SEP"share"DIR_SEP"lua"DIR_SEP"%s",
     13                              psz_datapath, luadirname ) != -1) )
     14             i++;
     15+        // When installed through MacPorts (or Fink, or HomeBrew, or...?) we do have
     16+        // meta/reader under LibDir/lua (/opt/local/lib/vlc/lua for MacPorts's standard install prefix)
     17+        // so we add that location at the end.
     18+        char *psz_libpath = config_GetLibDir();
     19+        if( likely(psz_libpath != NULL) )
     20+        {
     21+            if( likely(asprintf( &ppsz_dir_list[i], "%s"DIR_SEP"lua"DIR_SEP"%s",
     22+                                 psz_libpath, luadirname ) != -1) )
     23+                i++;
     24+            free( psz_libpath );
     25+        }
     26 #endif
     27         free( psz_datapath );
     28     }
     29diff --git src/darwin/dirs.c src/darwin/dirs.c
     30index 381729c..9174602 100644
     31--- src/darwin/dirs.c
     32+++ src/darwin/dirs.c
     33@@ -43,14 +43,20 @@
     34 # define MAXPATHLEN 1024
     35 #endif
     36 
     37-char *config_GetLibDir (void)
     38+// 20150205: we should do case-insensitive filename comparisons. HFS is case-insensitive by default,
     39+// and while it strives to preserve case there is no guarantee that case folding will never occur,
     40+// especially in directory components.
     41+
     42+// @p libDirIsPosix is set to true in if getLibDir() detects we're installed
     43+// in a (linux-specific) posix way, like e.g. MacPorts would do.
     44+char *getLibDir (bool *libDirIsPosix)
     45 {
     46+    *libDirIsPosix = FALSE;
     47     /* Get the full program path and name */
     48     /* First try to see if we are linked to the framework */
     49-    for (unsigned i = 0; i < _dyld_image_count(); i++)
     50-    {
     51+    for (unsigned i = 0; i < _dyld_image_count(); i++) {
     52         const char *psz_img_name = _dyld_get_image_name(i);
     53-        const char *p = strstr( psz_img_name, "VLCKit.framework/Versions/" );
     54+        const char *p = strcasestr( psz_img_name, "VLCKit.framework/Versions/" );
     55 
     56         /* Check for "VLCKit.framework/Versions/Current/VLCKit",
     57          * as well as "VLCKit.framework/Versions/A/VLCKit" and
     58@@ -61,18 +67,18 @@ char *config_GetLibDir (void)
     59             p += strcspn( p, "/" );
     60 
     61             /* If the string ends with VLCKit then we've found a winner */
     62-            if (!strcmp( p, "/VLCKit"))
     63+            if (!strcasecmp( p, "/VLCKit"))
     64                 return strdup( dirname(psz_img_name) );
     65         }
     66 
     67-        /* Do we end by "VLC"? If so we are the legacy VLC.app that doesn't
     68+        /* Do we end by "MacOS/VLC"? If so we are the legacy VLC.app that doesn't
     69          * link to VLCKit. */
     70         size_t len = strlen(psz_img_name);
     71-        if (len >= 3 && !strcmp( psz_img_name + len - 3, "VLC"))
     72+        if (len >= 9 && !strcasecmp( psz_img_name + len - 9, "MacOS/VLC"))
     73             return strdup( dirname(psz_img_name) );
     74 
     75         /* Do we end by "VLC-Plugin"? oh, we must be the NPAPI plugin */
     76-        if (len >= 10 && !strcmp( psz_img_name + len - 10, "VLC-Plugin"))
     77+        if (len >= 10 && !strcasecmp( psz_img_name + len - 10, "VLC-Plugin"))
     78             return strdup( dirname(psz_img_name) );
     79     }
     80 
     81@@ -84,6 +90,7 @@ char *config_GetLibDir (void)
     82         char *path = NULL;
     83         asprintf(&path, "%s/"PACKAGE, incompletepath);
     84         free(incompletepath);
     85+        *libDirIsPosix = TRUE;
     86         return path;
     87     }
     88 
     89@@ -91,15 +98,37 @@ char *config_GetLibDir (void)
     90     abort ();
     91 }
     92 
     93+char *config_GetLibDir (void)
     94+{
     95+    bool isPosixStub;
     96+    return getLibDir (&isPosixStub);
     97+}
     98+
     99 char *config_GetDataDir (void)
     100 {
     101     const char *path = getenv ("VLC_DATA_PATH");
     102     if (path)
     103         return strdup (path);
     104 
     105-    char *vlcpath = config_GetLibDir ();
     106-    char *datadir;
     107+    bool libDirIsPosix;
     108+    char *vlcpath = getLibDir (&libDirIsPosix);
     109+    char *datadir = NULL;
     110 
     111+    if (libDirIsPosix) {
     112+        // vlcpath should point to something like /opt/local/lib/vlc
     113+        // if so, we can chop off the /lib/vlc bit, and then add /share
     114+        // like we would otherwise.
     115+        char *p = strcasestr(vlcpath, "/lib/");
     116+        if (p != NULL) {
     117+            *p = '\0';
     118+        }
     119+        else {
     120+            // something else ... return PKGDATADIR
     121+            free(vlcpath);
     122+            datadir = strdup(PKGDATADIR);
     123+            return datadir;
     124+        }
     125+    }
     126     if (asprintf (&datadir, "%s/share", vlcpath) == -1)
     127         datadir = NULL;
     128 
     129@@ -137,16 +166,24 @@ static char *getAppDependentDir(vlc_userdir_t type)
     130     }
     131 
     132     // Default fallback
     133-    const char *name = "org.videolan.vlc";
     134-
     135-    CFBundleRef mainBundle = CFBundleGetMainBundle();
     136-    if (mainBundle) {
     137-        CFStringRef identifierAsNS = CFBundleGetIdentifier(mainBundle);
     138-        if (identifierAsNS) {
     139-            char identifier[256];
     140-            Boolean ret = CFStringGetCString(identifierAsNS, identifier, sizeof(identifier), kCFStringEncodingUTF8);
     141-            if (ret)
     142-                name = identifier;           
     143+    char name[256] = "org.videolan.vlc";
     144+    bool libDirIsPosix;
     145+    char *vlcpath = getLibDir(&libDirIsPosix);
     146+    if (vlcpath) {
     147+        free(vlcpath);
     148+    }
     149+
     150+    if (!libDirIsPosix) {
     151+        CFBundleRef mainBundle = CFBundleGetMainBundle();
     152+        if (mainBundle) {
     153+            CFStringRef identifierAsNS = CFBundleGetIdentifier(mainBundle);
     154+            if (identifierAsNS) {
     155+                char identifier[256];
     156+                Boolean ret = CFStringGetCString(identifierAsNS, identifier, sizeof(identifier), kCFStringEncodingUTF8);
     157+                // Don't use an empty identifier (= the application that links to us doesn't have a CFBundleIdentifier set).
     158+                if (ret && strlen(identifier))
     159+                    strcpy(name, identifier);
     160+            }
     161         }
     162     }
     163 
  • new file multimedia/VLC/files/files/patch-vlc-no-O4.diff

    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
    - +  
     1diff --git configure.ac configure.ac
     2index a085ac3..f737b2d 100644
     3--- configure.ac
     4+++ configure.ac
     5@@ -940,10 +942,10 @@ AS_IF([test "${enable_optimizations}" != "no"], [
     6   dnl -O4 and -O3 only in production builds
     7   AS_IF([test "${enable_debug}" = "no"], [
     8     VLC_SAVE_FLAGS
     9-    CFLAGS="${CFLAGS} -O4"
     10-    CXXFLAGS="${CXXFLAGS} -O4"
     11-    OBJCFLAGS="${OBJCFLAGS} -O4"
     12-    AC_CACHE_CHECK([if $CC accepts -O4], [ac_cv_c_o4], [
     13+    CFLAGS="${CFLAGS} -O3"
     14+    CXXFLAGS="${CXXFLAGS} -O3"
     15+    OBJCFLAGS="${OBJCFLAGS} -O3"
     16+    AC_CACHE_CHECK([if $CC accepts -O3], [ac_cv_c_o4], [
     17       AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
     18         ac_cv_c_o4=yes
     19       ], [
  • new file multimedia/VLC/files/files/patch-vlc-no-qt5.diff

    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
    - +  
     1diff --git configure.ac configure.ac
     2index a085ac3..8c6eb3d 100644
     3--- configure.ac
     4+++ configure.ac
     5@@ -3701,7 +3701,7 @@ AC_ARG_ENABLE(qt, [
     6   ])
     7 ])
     8 AS_IF([test "${enable_qt}" != "no"], [
     9-  PKG_CHECK_MODULES([QT], [Qt5Core >= 5.1.0 Qt5Widgets Qt5Gui], [
     10+  PKG_CHECK_MODULES([QT], [Qt5Core >= 6.1.0 Qt5Widgets Qt5Gui], [
     11       PKG_CHECK_MODULES([QTX11], [Qt5X11Extras], [
     12           VLC_ADD_LIBS([qt4],[${QTX11_LIBS}])
     13           VLC_ADD_CXXFLAGS([qt4],[${QTX11_CFLAGS} -DQT5_HAS_X11])
  • new file multimedia/VLC/files/files/patch-vlc-qt-configureac.diff

    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
    - +  
     1diff --git configure.ac configure.ac
     2index a085ac3..f0b2c0a 100644
     3--- configure.ac
     4+++ configure.ac
     5@@ -69,6 +69,7 @@ AM_PROG_CC_C_O
     6 AC_PROG_CXX
     7 AC_PROG_CPP
     8 AC_PROG_OBJC
     9+AC_PROG_OBJCXX
     10 _AM_DEPENDENCIES([OBJC])
     11 AC_PROG_EGREP
     12 AC_PROG_MAKE_SET
     13diff --git modules/gui/qt4/Makefile.am modules/gui/qt4/Makefile.am
     14index 1a564cf..ff4ea4c 100644
     15--- modules/gui/qt4/Makefile.am
     16+++ modules/gui/qt4/Makefile.am
     17@@ -26,6 +26,7 @@ libqt4_plugin_la_LIBADD += $(X_LIBS) $(X_PRE_LIB) -lX11
     18 endif
     19 endif
     20 if HAVE_DARWIN
     21+libqt4_plugin_la_OBJCXXFLAGS = $(AM_CXXFLAGS) $(QT_CFLAGS) $(CXXFLAGS_qt4)
     22 libqt4_plugin_la_LDFLAGS += -Wl,-framework,Cocoa
     23 endif
     24
     25@@ -118,6 +119,9 @@ libqt4_plugin_la_SOURCES = \
     26 if HAVE_WIN32
     27 libqt4_plugin_la_SOURCES += main_interface_win32.cpp
     28 endif
     29+if HAVE_DARWIN
     30+libqt4_plugin_la_SOURCES += util/searchlineedit_mac.mm
     31+endif
     32
     33 # Meta-object compilation
     34
  • new file multimedia/VLC/files/files/patch-vlc-qt4mac.diff

    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
    - +  
     1diff --git modules/gui/qt4/util/searchlineedit.cpp modules/gui/qt4/util/searchlineedit.cpp
     2index 94744ec..e83625d 100644
     3--- modules/gui/qt4/util/searchlineedit.cpp
     4+++ modules/gui/qt4/util/searchlineedit.cpp
     5@@ -103,7 +103,7 @@ void ClickLineEdit::focusOutEvent( QFocusEvent *ev )
     6 }
     7 #endif
     8 
     9-#ifndef Q_OS_MAC
     10+#ifndef Q_OS_MAC_UNUSED
     11 SearchLineEdit::SearchLineEdit( QWidget *parent ) : QLineEdit( parent )
     12 {
     13     clearButton = new QFramelessButton( this );
     14@@ -202,4 +202,14 @@ void SearchLineEdit::searchEditingFinished()
     15     emit searchDelayedChanged( text() );
     16 }
     17 
     18+// #else
     19+//
     20+// void SearchLineEdit::updateText( const QString& text )
     21+// {
     22+// }
     23+//
     24+// void SearchLineEdit::searchEditingFinished()
     25+// {
     26+// }
     27+
     28 #endif
     29diff --git modules/gui/qt4/util/searchlineedit.hpp modules/gui/qt4/util/searchlineedit.hpp
     30index a09b9bc..8d9e2b7 100644
     31--- modules/gui/qt4/util/searchlineedit.hpp
     32+++ modules/gui/qt4/util/searchlineedit.hpp
     33@@ -72,7 +72,7 @@ private:
     34 };
     35 #endif
     36 
     37-#ifndef Q_OS_MAC
     38+#ifndef Q_OS_MAC_UNUSED
     39 class QFramelessButton;
     40 class SearchLineEdit : public QLineEdit
     41 {
     42@@ -99,28 +99,33 @@ private slots:
     43 signals:
     44     void searchDelayedChanged( const QString& );
     45 };
     46-#else
     47-
     48-/* On Mac, we try to use the native NSSearchField */
     49-#include <QMacCocoaViewContainer>
     50-
     51-class SearchLineEdit : public QMacCocoaViewContainer
     52-{
     53-    Q_OBJECT
     54-
     55-public:
     56-    SearchLineEdit(QWidget *parent = 0);
     57-    virtual ~SearchLineEdit() {}
     58-
     59-    virtual QSize sizeHint() const { return QSize(150, 40); }
     60-
     61-public slots:
     62-    void clear() {}
     63-
     64-signals:
     65-    void searchDelayedChanged( const QString& );
     66-    void textEdited( const QString& );
     67-};
     68+// #else
     69+//
     70+// /* On Mac, we try to use the native NSSearchField */
     71+// #include <QMacCocoaViewContainer>
     72+//
     73+// class SearchLineEdit : public QMacCocoaViewContainer
     74+// {
     75+//     Q_OBJECT
     76+//
     77+// public:
     78+//     SearchLineEdit(QWidget *parent = 0);
     79+//     virtual ~SearchLineEdit() {}
     80+//
     81+//     virtual QSize sizeHint() const { return QSize(150, 40); }
     82+//
     83+// public slots:
     84+//     void clear() {}
     85+//
     86+// // moc does not look at #ifdefs, so we must provide the same slots and signals
     87+// private slots:
     88+//     void updateText( const QString& );
     89+//     void searchEditingFinished();
     90+//
     91+// signals:
     92+//     void searchDelayedChanged( const QString& );
     93+//     void textEdited( const QString& );
     94+// };
     95 #endif
     96 
     97 #endif
  • new file multimedia/VLC/files/files/static_assert.patch

    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
    - +  
     1diff --git include/vlc_fixups.h include/vlc_fixups.h
     2index b448d83..638b864 100644
     3--- include/vlc_fixups.h
     4+++ include/vlc_fixups.h
     5@@ -239,8 +239,8 @@ static inline locale_t newlocale(int mask, const char * locale, locale_t base)
     6 }
     7 #endif
     8 
     9-#if !defined (HAVE_STATIC_ASSERT)
     10-# define _Static_assert(x, s) ((void) sizeof (struct { unsigned:-!(x); }))
     11+#if !defined (HAVE_STATIC_ASSERT) && !defined (static_assert)
     12+# define _Static_assert(x, s) ((void) sizeof (struct { unsigned a[(x) ? 1 : -1];}))
     13 # define static_assert _Static_assert
     14 #endif
     15