Ticket #50697: patch-VLC-ffmpeg-contrib.diff

File patch-VLC-ffmpeg-contrib.diff, 4.0 KB (added by dbevans (David B. Evans), 9 years ago)

Very rough poc patch to build a static ffmpeg using contrib

  • Portfile

     
    6565                    port:avahi \
    6666                    port:bzip2 \
    6767                    port:faad2 \
    68                     path:lib/libavcodec.dylib:ffmpeg \
    6968                    port:flac \
    7069                    port:fluidsynth \
    7170                    port:fontconfig \
     
    131130                    port:x264 \
    132131                    port:x265
    133132
     133# build upstream specified ffmpeg version 2.7.git as a static library
     134# using VLC's contrib build method. The rest comes from MacPorts
     135# https://wiki.videolan.org/UnixCompile/#The_.22Contrib.22_method
     136
     137# additional build dependencies required for the contrib build
     138
     139depends_build-append \
     140                    port:yasm \
     141                    port:git
     142
    134143# the +qt5 and/or +qt4 variants of port:opencv currently lead to build errors
    135144pre-configure {
    136145    if {![active_variants opencv "" {qt4 qt5}]} {
     
    139148        after building you can reactivate your preferred opencv variant"
    140149        return -code error "Install or activate port:opencv without a qt variant before building ${subport}"
    141150    }
     151
     152# setup and build contrib modules restricting build to ffmpeg and its (very) few recommended dependencies.
     153# see ${worksrcpath}/contrib/src/ffmpeg/rules.mak
     154
     155    xinstall -d ${worksrcpath}/contrib/native
     156    system "cd ${worksrcpath}/contrib/native && ../bootstrap && cat ${filespath}/config.mak.settings >> config.mak && make"
    142157}
    143158
    144159# VLC 2.2.2 should have full Lua 5.3 compatibility, for now, depend on port:lua52
     
    168183                    patch-vlc-no-O4.diff \
    169184                    patch-opencv_includes.diff
    170185
     186# patch contrib/src/ffmpeg/rules.mak to enable libavresample
     187# necessary for VLC to build
     188
     189patchfiles-append   ffmpeg-rules.mak.patch
     190
    171191# The opencv example apparently builds on 10.11 but I'm having issues with it on 10.9
    172192# it doesn't appear to be indispensable, so simply skip it.
    173193patchfiles-append   patch-no-opencv_example.diff
     
    206226
    207227# Other
    208228configure.args-append \
    209                     --with-contrib=${worksrcpath}/contrib \
     229                    --with-contrib \
    210230                    --disable-debug --disable-update-check --enable-gnutls \
    211231                    --disable-notify --disable-dbus --enable-lua \
    212232                    --disable-gnomevfs --disable-growl --disable-macosx-vlc-app
     
    300320
    301321variant pulse description {Enable PulseAudio support} {
    302322    depends_lib-append      port:pulseaudio
    303     configure.args-replace  --disable-pulse --enable-pulse 
     323    configure.args-replace  --disable-pulse --enable-pulse
    304324}
    305325
    306326variant x11 {
     
    354374    configure.args-delete   --disable-macosx \
    355375                            --enable-samplerate \
    356376                            --disable-realrtsp
    357     configure.args-append   --enable-macosx 
     377    configure.args-append   --enable-macosx
    358378    # taken from VLC's own configure.sh script for OS X:
    359379    configure.args-append   --disable-samplerate \
    360380                            --enable-merge-ffmpeg \
  • files/config.mak.settings

     
     1PKGS_DISABLE := a52 caca faad2 gcrypt gettext gme goom growl \
     2                kate live555 lua matroska mpcdec postproc shout sidplay2 sparkle \
     3                tiger upnp vncserver zvbi
     4PKGS_ENABLE := ffmpeg
  • files/ffmpeg-rules.mak.patch

     
     1--- contrib/src/ffmpeg/rules.mak.orig   2016-04-30 00:34:57.000000000 -0700
     2+++ contrib/src/ffmpeg/rules.mak        2016-04-30 00:35:15.000000000 -0700
     3@@ -29,7 +29,7 @@
     4        --disable-protocol=concat \
     5        --disable-bsfs \
     6        --disable-bzlib \
     7-       --disable-avresample
     8+       --enable-avresample
     9 
     10 ifdef USE_FFMPEG
     11 FFMPEGCONF += \