Ticket #54480: VLC.diff

File VLC.diff, 8.4 KB (added by RJVB (René Bertin), 7 years ago)
  • Portfile

    old new  
    2929    homepage            http://www.videolan.org/vlc/libvlc.html
    3030}
    3131
    32 subport ffmpeg-VLC {}
    33 set FFMPEG_VLC_PREFIX   ${prefix}/lib/vlc/ffmpeg
     32set use_ffmpeg_VLC      no
     33
     34if {[tbool use_ffmpeg_VLC]} {
     35    subport ffmpeg-VLC {}
     36    set FFMPEG_VLC_PREFIX   ${prefix}/lib/vlc/ffmpeg
     37}
    3438
    3539if {${subport} eq ${name}} {
    3640    conflicts           lib${name} libVLC-devel VLC-devel
     
    4448###################  ports VLC and libVLC  ###################
    4549##
    4650if {(${subport} eq ${name}) || (${subport} eq "lib${name}")} {
    47     version             2.2.4
    48     revision            8
     51    version             2.2.6
    4952    license             GPL-2
    5053
    5154    platforms           darwin
     
    5457    distname            vlc-${version}
    5558    use_xz              yes
    5659
    57     checksums           rmd160  2fe178bb9a4b2ad5ca0294d3e52ceb992b22e8ee \
    58                         sha256  1632e91d2a0087e0ef4c3fb4c95c3c2890f7715a9d1d43ffd46329f428cf53be
     60    checksums           rmd160  b2727834bcbbf0d274e3a0b4a3317f3b914f9ad4 \
     61                        sha256  c403d3accd9a400eb2181c958f3e7bc5524fe5738425f4253d42883b425a42a8
    5962
    6063    if {[info exist ::env(MACPORTS_COMPRESS_WORKDIR)] && $::env(MACPORTS_COMPRESS_WORKDIR)} {
    6164        # Enable HFS compression.
     
    6770
    6871    depends_build       port:pkgconfig
    6972
    70     depends_lib         port:ffmpeg-VLC \
    71                         port:a52dec \
     73    if {[tbool use_ffmpeg_VLC]} {
     74        depends_lib-append \
     75                        port:ffmpeg-FFMPEG_VLC_PREFIX
     76    }
     77    depends_lib-append  port:a52dec \
    7278                        port:avahi \
    7379                        port:bzip2 \
    7480                        port:faad2 \
     
    189195                        static_assert.patch \
    190196                        no-sparkle.patch \
    191197                        patch-vlc-no-O4.diff \
    192                         patch-ffmpegVLC.diff \
    193198                        patch-soundfont-path.diff
     199    if {[tbool use_ffmpeg_VLC]} {
     200        patchfiles-append \
     201                        patch-ffmpegVLC.diff
     202    } else {
     203        patchfiles-append \
     204                        patch-ffmpeg3-compat.diff
     205    }
    194206
    195207    post-patch {
    196208        if {[string match *clang* ${configure.cxx}] && ${configure.cxx_stdlib} == "libc++"} {
     
    201213
    202214        reinplace "s|@PREFIX@|${prefix}|g" ${worksrcpath}/modules/codec/fluidsynth.c
    203215
    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}
     216        if {[tbool use_ffmpeg_VLC]} {
     217            # patch source using ffmpeg to use the correct header file locations
     218            foreach dir {libavcodec libavformat libavresample libavutil libpostproc libswresample libswscale} {
     219                foreach module {access codec/avcodec demux/avformat hw/vdpau packetizer video_chroma} {
     220                    foreach cf [glob -nocomplain ${worksrcpath}/modules/${module}/*.c] {
     221                        reinplace "s|${dir}/|${dir}-VLC/|g" ${cf}
     222                    }
     223                    foreach cf [glob -nocomplain ${worksrcpath}/modules/${module}/*.h] {
     224                        reinplace "s|${dir}/|${dir}-VLC/|g" ${cf}
     225                    }
    212226                }
     227                reinplace "s|${dir}/|${dir}-VLC/|g" ${worksrcpath}/configure.ac ${worksrcpath}/configure
    213228            }
    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" \
     229            reinplace "s|postproc/|postproc-VLC/|g" ${worksrcpath}/configure.ac ${worksrcpath}/configure
     230            reinplace "s|libpostproc/|libpostproc-VLC/|g" ${worksrcpath}/modules/video_filter/postproc.c
     231            reinplace "s|HAVE_LIBAVUTIL_AV|HAVE_LIBAVUTIL_VLC_AV|g" \
    219232                ${worksrcpath}/modules/codec/avcodec/avcommon.h \
    220233                ${worksrcpath}/modules/codec/avcodec/avcommon_compat.h
    221         reinplace "s|HAVE_LIBAVFORMAT_AV|HAVE_LIBAVFORMAT_VLC_AV|g" \
     234            reinplace "s|HAVE_LIBAVFORMAT_AV|HAVE_LIBAVFORMAT_VLC_AV|g" \
    222235                ${worksrcpath}/modules/codec/avcodec/avcommon.h \
    223236                ${worksrcpath}/modules/codec/avcodec/avcommon_compat.h
    224         reinplace "s|HAVE_LIBAVCODEC_AV|HAVE_LIBAVCODEC_VLC_AV|g" \
     237            reinplace "s|HAVE_LIBAVCODEC_AV|HAVE_LIBAVCODEC_VLC_AV|g" \
    225238                ${worksrcpath}/modules/codec/avcodec/avcommon.h \
    226239                ${worksrcpath}/modules/codec/avcodec/avcommon_compat.h
    227         reinplace "s|HAVE_LIBSWSCALE_SW|HAVE_LIBSWSCALE_VLC_SW|g" \
     240            reinplace "s|HAVE_LIBSWSCALE_SW|HAVE_LIBSWSCALE_VLC_SW|g" \
    228241                ${worksrcpath}/modules/codec/avcodec/avcommon.h \
    229242                ${worksrcpath}/modules/codec/avcodec/avcommon_compat.h
     243        }
    230244    }
    231245    post-configure {
    232246        system -W ${worksrcpath} "patch -Np0 -i ${filespath}/patch-static_assert.diff"
     
    240254
    241255    configure.env-append \
    242256                        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 \
     257    if {[tbool use_ffmpeg_VLC]} {
     258        # splice in ffmpeg-VLC's pkgconfig path, hoping that PKG_CONFIG_PATH hasn't been set by anyone else
     259        configure.env-append \
    245260                        PKG_CONFIG_PATH=${FFMPEG_VLC_PREFIX}/lib/pkgconfig
     261    }
    246262    build.args-append   DESTDIR=${worksrcpath}/dest_ignore V=1
    247263
    248264    # gl.c:121:3: error: Platform not recognized.
     
    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 ^\ :
     
    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##