[c5c522c] | 1 | #!/bin/bash |
---|
| 2 | # $Id: ffmpeg.SlackBuild,v 1.82 2016/07/07 12:46:21 root Exp root $ |
---|
| 3 | # Copyright 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016 Eric Hameleers, Eindhoven, NL |
---|
| 4 | # All rights reserved. |
---|
| 5 | # |
---|
| 6 | # Permission to use, copy, modify, and distribute this software for |
---|
| 7 | # any purpose with or without fee is hereby granted, provided that |
---|
| 8 | # the above copyright notice and this permission notice appear in all |
---|
| 9 | # copies. |
---|
| 10 | # |
---|
| 11 | # THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED |
---|
| 12 | # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
---|
| 13 | # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
---|
| 14 | # IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR |
---|
| 15 | # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
---|
| 16 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
---|
| 17 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF |
---|
| 18 | # USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
---|
| 19 | # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
---|
| 20 | # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT |
---|
| 21 | # OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
---|
| 22 | # SUCH DAMAGE. |
---|
| 23 | # ----------------------------------------------------------------------------- |
---|
| 24 | # |
---|
| 25 | # Slackware SlackBuild script |
---|
| 26 | # =========================== |
---|
| 27 | # By: Eric Hameleers <alien@slackware.com> |
---|
| 28 | # For: ffmpeg |
---|
| 29 | # Descr: software to record, convert and stream audio and video |
---|
| 30 | # URL: http://ffmpeg.org/ |
---|
| 31 | # Needs: yasm (only compile-time) |
---|
| 32 | # Changelog: |
---|
| 33 | # 20070519-1: 19/May/2007 by Eric Hameleers <alien@slackware.com> |
---|
| 34 | # * Initial build. |
---|
| 35 | # Note that the version is set to the current date |
---|
| 36 | # (using `date +%Y%d%m` output) when you build ffmpeg |
---|
| 37 | # from source using this SlackBuild. |
---|
| 38 | # You can override this behaviour by prepending a specific |
---|
| 39 | # value for VERSION to the build command, like so: |
---|
| 40 | # VERSION=20070519 ./ffmpeg.SlackBuild |
---|
| 41 | # 20070612-1: 12/jun/2007 by Eric Hameleers <alien@slackware.com> |
---|
| 42 | # * Update. Also, make sure that the script actually works |
---|
| 43 | # for newer snapshots if they should be downloaded. |
---|
| 44 | # 20071006-1: 06/oct/2007 by Eric Hameleers <alien@slackware.com> |
---|
| 45 | # * Update. Added documentation of the included libraries. |
---|
| 46 | # 20071209-1: 09/dec/2007 by Eric Hameleers <alien@slackware.com> |
---|
| 47 | # * Update of ffmpeg snapshot plus several of the support libs. |
---|
| 48 | # Re-added AMR libraries, added libgsm and 1394 (firewire) |
---|
| 49 | # support, and messed up the SlackBuild script pretty good. |
---|
| 50 | # Added a download function for checking out SVN/CVS snapshots, |
---|
| 51 | # which can easily be expanded for multiple snapshots. |
---|
| 52 | # 20080303-1: 03/mar/2008 by Eric Hameleers <alien@slackware.com> |
---|
| 53 | # * Update of ffmpeg and x264 snapshots to their latest versions. |
---|
| 54 | # Added dirac codec support. Internally use variable FFMPEG |
---|
| 55 | # instead of VERSION to determine the version of ffmpeg to use |
---|
| 56 | # (allows me to use a SVN revision number instead of timestamp). |
---|
| 57 | # r14080-1: 05/aug/2008 by Eric Hameleers <alien@slackware.com> |
---|
| 58 | # * Update of almost all composing libraries. The dirac reference |
---|
| 59 | # implementation library was replaced by schroedinger. |
---|
| 60 | # This version of the package includes shared libraries which |
---|
| 61 | # allows other programs to link to avcodec. |
---|
| 62 | # If you install yasm, the SlackBuild will be able to use a |
---|
| 63 | # very recent version of the x264 library, else it will fallback |
---|
| 64 | # to a version that compiles with Slackware's 'asm'. |
---|
| 65 | # r16039-1: 09/dec/2008 by Eric Hameleers <alien@slackware.com> |
---|
| 66 | # * Updated to the 20081209 snapshot. Also updated x264 and lame |
---|
| 67 | # codecs, removed liba52 (because ffmpeg now has it's own native |
---|
| 68 | # implementation) and added speex codec. |
---|
| 69 | # r16043-1: 10/dec/2008 by Eric Hameleers <alien@slackware.com> |
---|
| 70 | # * Update. Also updated libraw1394 & libdc1394 to their 2.x |
---|
| 71 | # versions and made small adaptations so that the script actually |
---|
| 72 | # produces working binaries on x86_64 |
---|
| 73 | # 0.5-1: 20/mar/2009 by Eric Hameleers <alien@slackware.com> |
---|
| 74 | # * First new official release in ages. Add x264 presets to the |
---|
| 75 | # package (idea borrowed from the script at slackbuilds.org). |
---|
| 76 | # 0.5-2: 13/may/2009 by Eric Hameleers <alien@slackware.com> |
---|
| 77 | # * Updates to faac/faad/schro |
---|
| 78 | # r20056-1: 27/sep/2009 by Eric Hameleers <alien@slackware.com> |
---|
| 79 | # * Update. AMR implementation from OpenCORE with a free license |
---|
| 80 | # allows to add AMR support to the distributable package. |
---|
| 81 | # Also updated the X264 snapshot and libgsm. |
---|
| 82 | # r22900-1: 26/apr/2010 by Eric Hameleers <alien@slackware.com> |
---|
| 83 | # * New snapshot. Updated the schroedinger codec, which is now |
---|
| 84 | # on par speed-wise with the dirac codec. Also updated the x264 |
---|
| 85 | # snapshot (x264 can now produce blu-ray compliant video), |
---|
| 86 | # and updated the lame and dc1394 versions. Added support for |
---|
| 87 | # RTMP(E) - flash - streams through librtmp. |
---|
| 88 | # r23357-1: 28/may/2010 by Eric Hameleers <alien@slackware.com> |
---|
| 89 | # * New snapshot. Added libvpx plus patches for ffmpeg which |
---|
| 90 | # enable support for WebM/VP8 (google-donated new video format). |
---|
| 91 | # 0.6-1: 18/jun/2010 by Eric Hameleers <alien@slackware.com> |
---|
| 92 | # * A stable release. The internal libvpx library was updated to |
---|
| 93 | # 0.9.1 (no patching needed now), rtmpdump to 2.2e and x264 |
---|
| 94 | # to a recent snapshot. |
---|
| 95 | # I also added VAAPI hardware acceleration support. Look further |
---|
| 96 | # down in this script (in the header of the "make_libva" function) |
---|
| 97 | # how you can benefit from GPU-accelerated encoding/decoding. |
---|
| 98 | # 0.6.1-1: 02/feb/2011 by Eric Hameleers <alien@slackware.com> |
---|
| 99 | # * I forgot to update to a newer stable release. |
---|
| 100 | # Updated internal codecs where available. |
---|
| 101 | # 0.6.3-1: 12/may/2011 by Eric Hameleers <alien@slackware.com> |
---|
| 102 | # * Updated for Slackware 13.37. |
---|
| 103 | # 0.8.2-1: 11/aug/2011 by Eric Hameleers <alien@slackware.com> |
---|
| 104 | # * Update. Add opencore's new AMR-WB and AAC encoders created |
---|
| 105 | # for Android by VisualOn: 'libvo-amrwnenc' and 'libvo-aacenc'. |
---|
| 106 | # And updated every built-in support library to their latest |
---|
| 107 | # version. |
---|
| 108 | # 0.8.5-1: 07/oct/2011 by Eric Hameleers <alien@slackware.com> |
---|
| 109 | # * New release. Also updated versions of internal vpx and x264 |
---|
| 110 | # libraries. Fix the compilation in case the x264 libraries are |
---|
| 111 | # already installed on the system. |
---|
| 112 | # 0.8.6-1: 08/nov/2011 by Eric Hameleers <alien@slackware.com> |
---|
| 113 | # * New release. Also updated versions of internal lame, orc, |
---|
| 114 | # x264 libraries. |
---|
| 115 | # 0.8.7-1: 22/nov/2011 by Eric Hameleers <alien@slackware.com> |
---|
| 116 | # * New release. |
---|
| 117 | # 0.9-1: 13/dec/2011 by Eric Hameleers <alien@slackware.com> |
---|
| 118 | # * New release. Added internal libass (subtitle) and v4l2 support. |
---|
| 119 | # 0.10.2-1: 05/may/2012 by Eric Hameleers <alien@slackware.com> |
---|
| 120 | # * New release. |
---|
| 121 | # 0.10.3-1: 26/may/2012 by Eric Hameleers <alien@slackware.com> |
---|
| 122 | # * Update. |
---|
| 123 | # 0.11-1: 03/jun/2012 by Eric Hameleers <alien@slackware.com> |
---|
| 124 | # * Update. |
---|
| 125 | # 0.11.2-1: 27/sep/2012 by Eric Hameleers <alien@slackware.com> |
---|
| 126 | # * Update. |
---|
| 127 | # 1.1.2-1: 13/feb/2013 by Eric Hameleers <alien@slackware.com> |
---|
| 128 | # * Update. Also updated many internal libraries. |
---|
| 129 | # Added ogg opus decoder. |
---|
| 130 | # 1.2-1: 13/apr/2013 by Eric Hameleers <alien@slackware.com> |
---|
| 131 | # * Update. |
---|
| 132 | # 2.1-1: 26/dec/2013 by Eric Hameleers <alien@slackware.com> |
---|
| 133 | # * Update. |
---|
| 134 | # 2.2.1-1: 02/may/2014 by Eric Hameleers <alien@slackware.com> |
---|
| 135 | # * Update. Add teletext subtitle support. |
---|
| 136 | # 2.4.3-1: 12/nov/2014 by Eric Hameleers <alien@slackware.com> |
---|
| 137 | # * Update. Added fdk-aac codec by Android Open Source Project, |
---|
| 138 | # and X.265 (HEVC) codec by Videolan project.. |
---|
| 139 | # 2.7.2-1: 07/sep/2015 by Eric Hameleers <alien@slackware.com> |
---|
| 140 | # * Update. Also updated internal libraries: fdkaac, libass, |
---|
| 141 | # libva, libvdpau, speex, x264, x265 |
---|
| 142 | # 2.8-1: 24/sep/2015 by Eric Hameleers <alien@slackware.com> |
---|
| 143 | # * Update. Enabled SSL support (openssl in the non-free package, |
---|
| 144 | # gnutls in the patent-free package). |
---|
| 145 | # Updated internal libraries: libvpx, x264. |
---|
| 146 | # 3.1.1-1: 06/jul/2016 by Eric Hameleers <alien@slackware.com> |
---|
| 147 | # * Update. Updated internal libraries: opus, orc, v4l, vaapi, |
---|
| 148 | # vpx, x264, x265. |
---|
| 149 | # Support for libvo-aacenc was dropped from ffmpeg. |
---|
| 150 | # |
---|
| 151 | # Run 'sh ffmpeg.SlackBuild' to build a Slackware package. |
---|
| 152 | # The package (.txz) plus descriptive .txt file are created in /tmp . |
---|
| 153 | # Install using 'installpkg'. |
---|
| 154 | # |
---|
| 155 | # ----------------------------------------------------------------------------- |
---|
| 156 | |
---|
| 157 | # -- PATENT ALERT! -- |
---|
| 158 | # FFmpeg can be built with MP3 audio encoder (needed for FLV videos) and AAC |
---|
| 159 | # audio encoder (used in MP4) but these libraries are 'contaminated' |
---|
| 160 | # with patents from Fraunhofer, Apple etc. |
---|
| 161 | # You can build these patended algorithms into ffmpeg, and if you are an |
---|
| 162 | # ordinary end user, no one will bother you for using them. |
---|
| 163 | # For the binaries based on this SlackBuild that I distribute, it is a |
---|
| 164 | # different story. I am not allowed to distribute binary packages that |
---|
| 165 | # incorporate non-free code. So here you go. My Slackware package was built |
---|
| 166 | # with "USE_PATENTS=NO" i.e. without using the lame mp3 and aac libs. |
---|
| 167 | #USE_PATENTS="NO" |
---|
| 168 | USE_PATENTS=${USE_PATENTS:-"YES"} |
---|
| 169 | |
---|
| 170 | # I don't care if the user says "no" or "NO": |
---|
| 171 | USE_PATENTS=$(echo $USE_PATENTS | tr 'a-z' 'A-Z') |
---|
| 172 | |
---|
| 173 | PRGNAM=ffmpeg |
---|
| 174 | VERSION=${VERSION:-3.1.1} |
---|
| 175 | BUILD=${BUILD:-1} |
---|
| 176 | NUMJOBS=${NUMJOBS:--j7} |
---|
| 177 | TAG=${TAG:-"alien"} |
---|
| 178 | |
---|
| 179 | DOCS="COPYING* CREDITS Changelog MAINTAINERS README* \ |
---|
| 180 | doc/TODO doc/*.txt doc/*.html" |
---|
| 181 | DOCS_AACPLUS="AUTHORS COPYING* ChangeLog NEWS README TODO" |
---|
| 182 | DOCS_AMR="AUTHORS COPYING ChangeLog LICENSE NEWS README" |
---|
| 183 | DOCS_AMRWBENC="AUTHORS COPYING ChangeLog LICENSE NEWS NOTICE README" |
---|
| 184 | DOCS_ASS="COPYING Changelog" |
---|
| 185 | DOCS_AVC1394="AUTHORS COPYING ChangeLog INSTALL NEWS README" |
---|
| 186 | DOCS_DC1394="AUTHORS COPYING ChangeLog INSTALL NEWS README" |
---|
| 187 | DOCS_FAAC="AUTHORS COPYING* ChangeLog NEWS README* TODO" |
---|
| 188 | DOCS_FAAD2="AUTHORS COPYING* ChangeLog NEWS README* TODO" |
---|
| 189 | DOCS_FDKAAC="ChangeLog NOTICE" |
---|
| 190 | DOCS_FRIBIDI="AUTHORS COPYING ChangeLog NEWS README THANKS TODO" |
---|
| 191 | DOCS_GSM="COPYRIGHT ChangeLog* INSTALL MACHINES MANIFEST README" |
---|
| 192 | DOCS_LAME="API COPYING ChangeLog HACKING LICENSE README STYLEGUIDE TODO USAGE" |
---|
| 193 | DOCS_LIBVA="COPYING" |
---|
| 194 | DOCS_LIBZVBI="AUTHORS BUGS COPYING COPYING.LIB ChangeLog INSTALL NEWS README TODO" |
---|
| 195 | DOCS_OPUS="AUTHORS COPYING ChangeLog NEWS README" |
---|
| 196 | DOCS_ORC="COPYING README TODO" |
---|
| 197 | DOCS_RAW1394="AUTHORS COPYING ChangeLog INSTALL NEWS README" |
---|
| 198 | DOCS_RTMP="AUTHORS COPYING ChangeLog README" |
---|
| 199 | DOCS_SCHROEDINGER="AUTHORS COPYING* NEWS TODO" |
---|
| 200 | DOCS_SPEEX=" AUTHORS COPYING ChangeLog NEWS README* TODO" |
---|
| 201 | DOCS_V4L2="COPYING* ChangeLog README* TODO" |
---|
| 202 | DOCS_VDPAU="AUTHORS COPYING ChangeLog NEWS README" |
---|
| 203 | DOCS_VPX="AUTHORS CHANGELOG LICENSE README" |
---|
| 204 | DOCS_X264="AUTHORS COPYING" |
---|
| 205 | DOCS_X265="AUTHORS COPYING" |
---|
| 206 | |
---|
| 207 | # Support libraries: |
---|
| 208 | AACPLUS=2.0.2 |
---|
| 209 | AMRWBENC=0.1.3 |
---|
| 210 | AMR=0.1.3 |
---|
| 211 | ASS=0.12.1 |
---|
| 212 | AVC1394=0.5.4 |
---|
| 213 | DC1394=2.1.2 |
---|
| 214 | FAAC=1.28 |
---|
| 215 | FAAD2=2.7 |
---|
| 216 | FDKAAC=0.1.4 |
---|
| 217 | FRIBIDI=0.19.6 |
---|
| 218 | GSM=1.0.13 |
---|
| 219 | LAME=3.99.5 |
---|
| 220 | LIBVA=1.6.2 |
---|
| 221 | LIBZVBI=0.2.35 |
---|
| 222 | OPUS=1.1.2 |
---|
| 223 | ORC=0.4.25 |
---|
| 224 | RAW1394=2.0.5 |
---|
| 225 | RTMP=2.3 |
---|
| 226 | SCHROEDINGER=1.0.11 |
---|
| 227 | SPEEX=1.2rc2 |
---|
| 228 | V4L=1.10.1 |
---|
| 229 | VDPAU=1.1.1 |
---|
| 230 | VPX=1.5.0 |
---|
| 231 | X264=20160706-2245 |
---|
| 232 | X265=1.9 |
---|
| 233 | |
---|
| 234 | # Where do we look for sources? |
---|
| 235 | SRCDIR=$(cd $(dirname $0); pwd) |
---|
| 236 | |
---|
| 237 | # Place to build (TMP) package (PKG) and output (OUTPUT) the program: |
---|
| 238 | TMP=${TMP:-/tmp/build} |
---|
| 239 | PKG=$TMP/package-$PRGNAM |
---|
| 240 | OUTPUT=${OUTPUT:-/tmp} |
---|
| 241 | |
---|
| 242 | # Check for yasm, abort if not found: |
---|
| 243 | if ! which yasm >/dev/null 2>&1 ; then |
---|
| 244 | echo "##" |
---|
| 245 | echo "## The 'yasm' program does not seem to be installed." |
---|
| 246 | echo "## The X264/VP8 codec compilation needs yasm (nasm will not do)!" |
---|
| 247 | echo "## Aborting the build." |
---|
| 248 | echo "##" |
---|
| 249 | exit 1 |
---|
| 250 | fi |
---|
| 251 | |
---|
| 252 | # --------------------------------------------------------------------------- |
---|
| 253 | # Source tarballs and source URLs. |
---|
| 254 | # Sources which are not patented should have SRCPAT[n]="NO" |
---|
| 255 | # Sources which are patented should have SRCPAT[n]="YES" which prevents then |
---|
| 256 | # from being downloaded and used if we build a patent-free package. |
---|
| 257 | # --------------------------------------------------------------------------- |
---|
| 258 | |
---|
| 259 | # FFMPEG sources: |
---|
| 260 | if [ "$VERSION" == "HEAD" ]; then |
---|
| 261 | # We check out git's HEAD: |
---|
| 262 | BRANCH="master" |
---|
| 263 | GITURI=git://git.videolan.org/ffmpeg.git |
---|
| 264 | SRCVER=$(date +%Y%m%d) |
---|
| 265 | SRCURL[0]="" |
---|
| 266 | elif [ "$(echo $VERSION | cut -c1-2)" == "20" ]; then |
---|
| 267 | # We check out git at a specific date: |
---|
| 268 | BRANCH="master" |
---|
| 269 | GITURI=git://git.videolan.org/ffmpeg.git |
---|
| 270 | SRCVER=$VERSION |
---|
| 271 | SRCURL[0]="" |
---|
| 272 | else |
---|
| 273 | BRANCH="" |
---|
| 274 | GITURI="" |
---|
| 275 | SRCVER=$VERSION |
---|
| 276 | SRCURL[0]="http://ffmpeg.org/releases/ffmpeg-${SRCVER}.tar.bz2" |
---|
| 277 | fi |
---|
| 278 | |
---|
| 279 | SOURCE[0]="$SRCDIR/ffmpeg-${SRCVER}.tar.bz2" |
---|
| 280 | SRCPAT[0]="NO" |
---|
| 281 | |
---|
| 282 | # Orc (oil runtime compiler) is a dependency for schroedinger |
---|
| 283 | SOURCE[1]="$SRCDIR/orc-${ORC}.tar.xz" |
---|
| 284 | SRCURL[1]="https://gstreamer.freedesktop.org/src/orc/orc-${ORC}.tar.xz" |
---|
| 285 | SRCPAT[1]="NO" |
---|
| 286 | |
---|
| 287 | # Dirac video codec support by schroedinger: |
---|
| 288 | SOURCE[2]="$SRCDIR/schroedinger-${SCHROEDINGER}.tar.gz" |
---|
| 289 | SRCURL[2]="http://www.diracvideo.org/download/schroedinger/schroedinger-${SCHROEDINGER}.tar.gz" |
---|
| 290 | SRCPAT[2]="NO" |
---|
| 291 | |
---|
| 292 | # SPEEX audio codec: |
---|
| 293 | SOURCE[3]="$SRCDIR/speex-${SPEEX}.tar.gz" |
---|
| 294 | SRCURL[3]="http://downloads.us.xiph.org/releases/speex/speex-${SPEEX}.tar.gz" |
---|
| 295 | SRCPAT[3]="NO" |
---|
| 296 | |
---|
| 297 | # X264 encoder - for H264/AVC video streams, for static linking |
---|
| 298 | SOURCE[4]="$SRCDIR/x264-snapshot-${X264}.tar.bz2" |
---|
| 299 | SRCURL[4]="ftp://ftp.videolan.org/pub/videolan/x264/snapshots/x264-snapshot-${X264}.tar.bz2" |
---|
| 300 | SRCPAT[4]="NO" |
---|
| 301 | |
---|
| 302 | # FAAD2 support: |
---|
| 303 | SOURCE[5]="$SRCDIR/faad2-$FAAD2.tar.gz" |
---|
| 304 | SRCURL[5]="http://downloads.sourceforge.net/faac/faad2-$FAAD2.tar.gz" |
---|
| 305 | SRCPAT[5]="NO" |
---|
| 306 | |
---|
| 307 | # GSM support: |
---|
| 308 | SOURCE[6]="$SRCDIR/gsm-$GSM.tar.gz" |
---|
| 309 | SRCURL[6]="http://osxwinebuilder.googlecode.com/files/gsm-$GSM.tar.gz" |
---|
| 310 | SRCPAT[6]="NO" |
---|
| 311 | |
---|
| 312 | # Lame is used for the audio in FLV videos; will statically link with ffmpeg |
---|
| 313 | SOURCE[7]="$SRCDIR/lame-$LAME.tar.gz" |
---|
| 314 | SRCURL[7]="http://downloads.sourceforge.net/lame/lame-$LAME.tar.gz" |
---|
| 315 | SRCPAT[7]="YES" |
---|
| 316 | |
---|
| 317 | # Library to support the AVC (Audio/Video Control) Digital Interface Command Set |
---|
| 318 | SOURCE[8]="$SRCDIR/libavc1394-${AVC1394}.tar.gz" |
---|
| 319 | SRCURL[8]="http://downloads.sourceforge.net/libavc1394/libavc1394-${AVC1394}.tar.gz" |
---|
| 320 | SRCPAT[8]="NO" |
---|
| 321 | |
---|
| 322 | # Library needed to control IEEE 1394 (firewire-) based cameras |
---|
| 323 | SOURCE[9]="$SRCDIR/libraw1394-${RAW1394}.tar.gz" |
---|
| 324 | SRCURL[9]="http://downloads.sourceforge.net/libraw1394/libraw1394-${RAW1394}.tar.gz" |
---|
| 325 | SRCPAT[9]="NO" |
---|
| 326 | |
---|
| 327 | SOURCE[10]="$SRCDIR/libdc1394-${DC1394}.tar.gz" |
---|
| 328 | SRCURL[10]="http://downloads.sourceforge.net/libdc1394/libdc1394-${DC1394}.tar.gz" |
---|
| 329 | SRCPAT[10]="NO" |
---|
| 330 | |
---|
| 331 | # librtmp library, supporting RTMP streams |
---|
| 332 | SOURCE[11]="$SRCDIR/rtmpdump-${RTMP}.tgz" |
---|
| 333 | SRCURL[11]="http://rtmpdump.mplayerhq.hu/download/rtmpdump-${RTMP}.tgz" |
---|
| 334 | SRCPAT[11]="NO" |
---|
| 335 | |
---|
| 336 | # libvpx library, containing the VP8 codec |
---|
| 337 | SOURCE[12]="$SRCDIR/libvpx-${VPX}.tar.bz2" |
---|
| 338 | SRCURL[12]="http://storage.googleapis.com/downloads.webmproject.org/releases/webm/libvpx-${VPX}.tar.bz2" |
---|
| 339 | SRCPAT[12]="NO" |
---|
| 340 | |
---|
| 341 | # Library supporting VAAPI (GPU-accelerated video playback interface) |
---|
| 342 | SOURCE[13]="$SRCDIR/libva-${LIBVA}.tar.bz2" |
---|
| 343 | SRCURL[13]="http://www.freedesktop.org/software/vaapi/releases/libva/libva-${LIBVA}.tar.bz2" |
---|
| 344 | SRCPAT[13]="NO" |
---|
| 345 | |
---|
| 346 | # AMR-WB encoder libraries used to encode 3GPP audio |
---|
| 347 | SOURCE[14]="$SRCDIR/vo-amrwbenc-${AMRWBENC}.tar.gz" |
---|
| 348 | SRCURL[14]="http://downloads.sourceforge.net/opencore-amr/vo-amrwbenc-${AMRWBENC}.tar.gz" |
---|
| 349 | SRCPAT[14]="NO" |
---|
| 350 | |
---|
| 351 | # AMR-NB de/encoder and WB decoder libraries used to de/encode 3GPP audio |
---|
| 352 | SOURCE[15]="$SRCDIR/opencore-amr-${AMR}.tar.gz" |
---|
| 353 | SRCURL[15]="http://downloads.sourceforge.net/opencore-amr/opencore-amr-${AMR}.tar.gz" |
---|
| 354 | SRCPAT[15]="NO" |
---|
| 355 | |
---|
| 356 | # FAAC library, for AAC (MP4 audio) encoding |
---|
| 357 | SOURCE[16]="$SRCDIR/faac-$FAAC.tar.gz" |
---|
| 358 | SRCURL[16]="http://downloads.sourceforge.net/faac/faac-$FAAC.tar.gz" |
---|
| 359 | SRCPAT[16]="YES" |
---|
| 360 | |
---|
| 361 | # Unicode BiDirectional algorithm library, requirement for libass. |
---|
| 362 | SOURCE[17]="$SRCDIR/fribidi-${FRIBIDI}.tar.bz2" |
---|
| 363 | SRCURL[17]="http://fribidi.org/download/fribidi-${FRIBIDI}.tar.bz2" |
---|
| 364 | SRCPAT[17]="NO" |
---|
| 365 | |
---|
| 366 | # Libass - portable library for SSA/ASS subtitles rendering |
---|
| 367 | SOURCE[18]="$SRCDIR/libass-$ASS.tar.xz" |
---|
| 368 | SRCURL[18]="https://github.com/libass/libass/releases/download/${ASS}/libass-$ASS.tar.xz" |
---|
| 369 | SRCPAT[18]="NO" |
---|
| 370 | |
---|
| 371 | # Collection of video4linux support libraries |
---|
| 372 | SOURCE[19]="$SRCDIR/v4l-utils-${V4L}.tar.bz2" |
---|
| 373 | SRCURL[19]="http://linuxtv.org/downloads/v4l-utils/v4l-utils-${V4L}.tar.bz2" |
---|
| 374 | SRCPAT[19]="NO" |
---|
| 375 | |
---|
| 376 | # opus codec: |
---|
| 377 | SOURCE[20]="$SRCDIR/opus-${OPUS}.tar.gz" |
---|
| 378 | SRCURL[20]="http://downloads.xiph.org/releases/opus/opus-${OPUS}.tar.gz" |
---|
| 379 | SRCPAT[20]="NO" |
---|
| 380 | |
---|
| 381 | # VDPAU for video hardware acceleration: |
---|
| 382 | SOURCE[21]="$SRCDIR/libvdpau-${VDPAU}.tar.gz" |
---|
| 383 | SRCURL[21]="http://people.freedesktop.org/~aplattner/vdpau/libvdpau-${VDPAU}.tar.gz" |
---|
| 384 | SRCPAT[21]="NO" |
---|
| 385 | |
---|
| 386 | # libzvbi for teletext subtitle processing: |
---|
| 387 | SOURCE[22]="$SRCDIR/zvbi-${LIBZVBI}.tar.bz2" |
---|
| 388 | SRCURL[22]="http://downloads.sourceforge.net/zapping/zvbi-${LIBZVBI}.tar.bz2" |
---|
| 389 | SRCPAT[22]="NO" |
---|
| 390 | |
---|
| 391 | # fdk-aac en/decoder from the Android Open Source Project (opencore-amr): |
---|
| 392 | SOURCE[23]="$SRCDIR/fdk-aac-${FDKAAC}.tar.gz" |
---|
| 393 | SRCURL[23]="http://downloads.sourceforge.net/opencore-amr/fdk-aac-${FDKAAC}.tar.gz" |
---|
| 394 | SRCPAT[23]="YES" |
---|
| 395 | |
---|
| 396 | # Videolan's HEVC (x265) codec: |
---|
| 397 | SOURCE[24]="$SRCDIR/x265-${X265}.tar.gz" |
---|
| 398 | SRCURL[24]="http://github.com/videolan/x265/archive/${X265}.tar.gz" |
---|
| 399 | SRCPAT[24]="NO" |
---|
| 400 | |
---|
| 401 | ## HE-AAC+ v2 shared library: |
---|
| 402 | #SOURCE[XX]="$SRCDIR/libaacplus-$AACPLUS.tar.gz" |
---|
| 403 | #SRCURL[XX]="http://tipok.ath.cx/downloads/media/aac+/libaacplus/libaacplus-${AACPLUS}.tar.gz" |
---|
| 404 | #SRCPAT[XX]="YES" |
---|
| 405 | # |
---|
| 406 | ## HE-AAC+ v2 reference implementation: |
---|
| 407 | #SOURCE[XX]="$SRCDIR/26410-800.zip" |
---|
| 408 | #SRCURL[XX]="http://www.3gpp.org/ftp/Specs/archive/26_series/26.410/26410-800.zip" |
---|
| 409 | #SRCPAT[XX]="YES" |
---|
| 410 | |
---|
| 411 | |
---|
| 412 | # Use the src_checkout() function if no downloadable tarball exists. |
---|
| 413 | # This function checks out sources from SVN/CVS and creates a tarball of them. |
---|
| 414 | src_checkout() { |
---|
| 415 | # Param #1 : index in the SOURCE[] array. |
---|
| 416 | # Param #2 : full path to where SOURCE[$i] tarball should be created. |
---|
| 417 | # Determine the tarball extension: |
---|
| 418 | PEXT=$(echo "${2}" | sed -r -e 's/.*[^.].(tar.xz|tar.gz|tar.bz2|tgz).*/\1/') |
---|
| 419 | case "$PEXT" in |
---|
| 420 | "tar.xz") TARCOMP="J" ;; |
---|
| 421 | "tar.gz") TARCOMP="z" ;; |
---|
| 422 | "tgz") TARCOMP="z" ;; |
---|
| 423 | "tar.bz2") TARCOMP="j" ;; |
---|
| 424 | *) echo "Archive can only have extension 'tar.xz', '.tar.gz' '.tar.bz2' or '.tgz'" ; exit 1 ;; |
---|
| 425 | esac |
---|
| 426 | case ${1} in |
---|
| 427 | 0) # ffmpeg-${VERSION} |
---|
| 428 | mkdir ${PRGNAM}_temp_checkout_$$ \ |
---|
| 429 | && cd ${PRGNAM}_temp_checkout_$$ |
---|
| 430 | |
---|
| 431 | if [ "$VERSION" = "HEAD" ]; then |
---|
| 432 | # Checkout without downloading version history (fast!): |
---|
| 433 | echo "Checking out HEAD from '$GITURI':" |
---|
| 434 | git clone --depth=1 ${GITURI} ${PRGNAM}-${SRCVER} |
---|
| 435 | else |
---|
| 436 | # Checkout code from a certain branch and/or date; this will take a |
---|
| 437 | # long time because we have to clone the complete git-repository first: |
---|
| 438 | echo "Checking out $BRANCH at date $SRCVER from '$GITURI':" |
---|
| 439 | git clone ${GITURI} ${PRGNAM}-${SRCVER} \ |
---|
| 440 | && cd ${PRGNAM}-${SRCVER} \ |
---|
| 441 | && git checkout $BRANCH \ |
---|
| 442 | && git checkout $(git rev-list -n 1 --before="`date -d $SRCVER`" $BRANC |
---|
| 443 | H) \ |
---|
| 444 | && cd .. |
---|
| 445 | fi |
---|
| 446 | chown -R root:root . \ |
---|
| 447 | && tar --exclude .git -${TARCOMP}cf ${2} ${PRGNAM}-${SRCVER} |
---|
| 448 | cd .. |
---|
| 449 | rm -rf ${PRGNAM}_temp_checkout_$$ |
---|
| 450 | # If VERSION was "HEAD" we still want a date to appear in the pkgname: |
---|
| 451 | VERSION=${SRCVER} |
---|
| 452 | ;; |
---|
| 453 | 13) # We clone the git of libvpx at a certain date: |
---|
| 454 | mkdir libvpx-${VPX} \ |
---|
| 455 | && cd libvpx-${VPX} \ |
---|
| 456 | && git clone git://review.webmproject.org/libvpx.git . \ |
---|
| 457 | && git checkout $(git rev-list -n 1 --before="`date -d $VPX`" master) \ |
---|
| 458 | && chown -R root:root . \ |
---|
| 459 | && cd .. \ |
---|
| 460 | && tar --exclude .git -${TARCOMP}cf ${2} libvpx-${VPX} |
---|
| 461 | rm -rf libvpx-${VPX} |
---|
| 462 | ;; |
---|
| 463 | *) # Do nothing |
---|
| 464 | ;; |
---|
| 465 | esac |
---|
| 466 | } |
---|
| 467 | |
---|
| 468 | if [ "${USE_PATENTS}" == "YES" ]; then |
---|
| 469 | echo "" |
---|
| 470 | echo "**" |
---|
| 471 | echo "** This build uses patented code (MP3 and AAC encoders)" |
---|
| 472 | echo "** Run the command 'USE_PATENTS=NO $0 $*' to avoid patent issues." |
---|
| 473 | echo "**" |
---|
| 474 | echo "" |
---|
| 475 | sleep 1 |
---|
| 476 | fi |
---|
| 477 | |
---|
| 478 | ## |
---|
| 479 | ## --- with a little luck, you won't have to edit below this point --- ## |
---|
| 480 | ## |
---|
| 481 | |
---|
| 482 | # Automatically determine the architecture we're building on: |
---|
| 483 | MARCH=$( uname -m ) |
---|
| 484 | if [ -z "$ARCH" ]; then |
---|
| 485 | case "$MARCH" in |
---|
| 486 | i?86) export ARCH=i486 ;; |
---|
| 487 | armv7hl) export ARCH=$MARCH ;; |
---|
| 488 | arm*) export ARCH=arm ;; |
---|
| 489 | # Unless $ARCH is already set, use uname -m for all other archs: |
---|
| 490 | *) export ARCH=$MARCH ;; |
---|
| 491 | esac |
---|
| 492 | fi |
---|
| 493 | |
---|
| 494 | case "$ARCH" in |
---|
| 495 | i486) SLKCFLAGS="-O2 -march=i486 -mtune=i686" |
---|
| 496 | SLKLDFLAGS=""; LIBDIRSUFFIX="" |
---|
| 497 | ;; |
---|
| 498 | x86_64) SLKCFLAGS="-O2 -fPIC" |
---|
| 499 | SLKLDFLAGS="-L/usr/lib64 -fPIC"; LIBDIRSUFFIX="64" |
---|
| 500 | ;; |
---|
| 501 | arm*) SLKCFLAGS="-O2 -march=armv5te" |
---|
| 502 | SLKLDFLAGS=""; LIBDIRSUFFIX="" |
---|
| 503 | ;; |
---|
| 504 | armv7hl) SLKCFLAGS="-O2 -march=armv7-a -mfpu=vfpv3-d16" |
---|
| 505 | SLKLDFLAGS=""; LIBDIRSUFFIX="" |
---|
| 506 | ;; |
---|
| 507 | *) SLKCFLAGS="-O2" |
---|
| 508 | SLKLDFLAGS=""; LIBDIRSUFFIX="" |
---|
| 509 | ;; |
---|
| 510 | esac |
---|
| 511 | |
---|
| 512 | case "$ARCH" in |
---|
| 513 | arm*) TARGET=$ARCH-slackware-linux-gnueabi ;; |
---|
| 514 | *) TARGET=$ARCH-slackware-linux ;; |
---|
| 515 | esac |
---|
| 516 | |
---|
| 517 | # Exit the script on errors: |
---|
| 518 | set -e |
---|
| 519 | #trap 'echo "$0 FAILED at line $LINENO!" | tee $OUTPUT/error-${PRGNAM}.log' ERR |
---|
| 520 | # Catch unitialized variables: |
---|
| 521 | set -u |
---|
| 522 | P1=${1:-1} |
---|
| 523 | |
---|
| 524 | # Save old umask and set to 0022: |
---|
| 525 | _UMASK_=$(umask) |
---|
| 526 | umask 0022 |
---|
| 527 | |
---|
| 528 | # Create working directories: |
---|
| 529 | mkdir -p $TMP/tmp-$PRGNAM # location to build the source |
---|
| 530 | if [ "$P1" != "--oldbuild" ]; then |
---|
| 531 | # If the "--oldbuild" parameter is present, we keep |
---|
| 532 | # the old build files and continue; |
---|
| 533 | # By default we remove the remnants of previous build and continue: |
---|
| 534 | rm -rf $TMP/tmp-$PRGNAM/* $OUTPUT/*${PRGNAM}*.log |
---|
| 535 | fi |
---|
| 536 | mkdir -p $PKG # place for the package to be built |
---|
| 537 | rm -rf $PKG/* # We always erase old package's contents: |
---|
| 538 | mkdir -p $OUTPUT # place for the package to be saved |
---|
| 539 | |
---|
| 540 | # Source file availability: |
---|
| 541 | |
---|
| 542 | # Regular URL downloads follow: |
---|
| 543 | for (( i = 0; i < ${#SOURCE[*]}; i++ )) ; do |
---|
| 544 | # Only download patented code if we are allowing it: |
---|
| 545 | if [ "${USE_PATENTS}" == "YES" -o "${SRCPAT[$i]}" != "YES" ]; then |
---|
| 546 | if ! [ -f ${SOURCE[$i]} ]; then |
---|
| 547 | echo "Source '$(basename ${SOURCE[$i]})' not available yet..." |
---|
| 548 | # Check if the $SRCDIR is writable at all - if not, download to $OUTPUT |
---|
| 549 | [ -w "$SRCDIR" ] || SOURCE[$i]="$OUTPUT/$(basename ${SOURCE[$i]})" |
---|
| 550 | if ! [ "x${SRCURL[$i]}" == "x" ]; then |
---|
| 551 | echo "Will download file to $(dirname $SOURCE[$i])" |
---|
| 552 | if ! $(wget --no-check-certificate -nv -T 20 -O "${SOURCE[$i]}" "${SRCURL[$i]}"); then |
---|
| 553 | echo "Downloading '$(basename ${SOURCE[$i]})' failed.. aborting the build." |
---|
| 554 | mv -f "${SOURCE[$i]}" "${SOURCE[$i]}".FAIL |
---|
| 555 | exit 1 |
---|
| 556 | fi |
---|
| 557 | else |
---|
| 558 | # Try if we have a SVN/CVS download routine for ${SOURCE[$i]} |
---|
| 559 | echo "Will checkout sources to $(dirname $SOURCE[$i])" |
---|
| 560 | src_checkout $i "${SOURCE[$i]}" |
---|
| 561 | fi |
---|
| 562 | if [ ! -f "${SOURCE[$i]}" -o ! -s "${SOURCE[$i]}" ]; then |
---|
| 563 | echo "File '$(basename ${SOURCE[$i]})' not available.. aborting the build." |
---|
| 564 | exit 1 |
---|
| 565 | fi |
---|
| 566 | fi |
---|
| 567 | fi |
---|
| 568 | done |
---|
| 569 | |
---|
| 570 | if [ "$P1" == "--download" ]; then |
---|
| 571 | echo "Download complete." |
---|
| 572 | exit 0 |
---|
| 573 | fi |
---|
| 574 | |
---|
| 575 | # --- PACKAGE BUILDING --- |
---|
| 576 | |
---|
| 577 | echo "++" |
---|
| 578 | echo "|| $PRGNAM-$VERSION" |
---|
| 579 | echo "++" |
---|
| 580 | |
---|
| 581 | cd $TMP/tmp-$PRGNAM |
---|
| 582 | if [ "$P1" != "--oldbuild" ]; then |
---|
| 583 | echo "Extracting the source archive(s) for $PRGNAM..." |
---|
| 584 | for (( i = 0; i < ${#SOURCE[*]}; i++ )) ; do |
---|
| 585 | # Only extract patented code if we are allowing it: |
---|
| 586 | if [ "${USE_PATENTS}" == "YES" -o "${SRCPAT[$i]}" != "YES" ]; then |
---|
| 587 | if $(file ${SOURCE[$i]} | grep -qi ": zip"); then |
---|
| 588 | unzip ${SOURCE[$i]} |
---|
| 589 | else |
---|
| 590 | tar -xvf ${SOURCE[$i]} |
---|
| 591 | fi |
---|
| 592 | fi |
---|
| 593 | done |
---|
| 594 | fi |
---|
| 595 | chown -R root:root * |
---|
| 596 | chmod -R u+w,go+r-w,a+X-s * |
---|
| 597 | |
---|
| 598 | # --- BUILDING --- |
---|
| 599 | |
---|
| 600 | echo Building ... |
---|
| 601 | |
---|
| 602 | # We will be installing static libs into the following directory: |
---|
| 603 | # (when linking ffmpeg together, these libs will be found & used) |
---|
| 604 | mkdir -p $TMP/tmp-$PRGNAM/ffmpegdeps/usr/{bin,include,lib,man} |
---|
| 605 | FFMPEGDEPSDIR="$TMP/tmp-$PRGNAM/ffmpegdeps" |
---|
| 606 | |
---|
| 607 | # ----------------------------------------------------------------------------- |
---|
| 608 | # Compile lame libraries |
---|
| 609 | # The ffmpeg will use these |
---|
| 610 | # ----------------------------------------------------------------------------- |
---|
| 611 | make_lame() |
---|
| 612 | { |
---|
| 613 | echo -e "**\n** lame ...\n**" |
---|
| 614 | cd $TMP/tmp-$PRGNAM/lame-${LAME} |
---|
| 615 | # Fix compilation on x86 (xmmintrin.h error: inlining failed) |
---|
| 616 | cat $SRCDIR/patches/lame_x86-xmmintrin.patch | patch -p1 --verbose \ |
---|
| 617 | 2>&1 |
---|
| 618 | |
---|
| 619 | CFLAGS="$SLKCFLAGS" \ |
---|
| 620 | CXXFLAGS="$SLKCFLAGS" \ |
---|
| 621 | LDFLAGS="$SLKLDFLAGS" \ |
---|
| 622 | ./configure \ |
---|
| 623 | --prefix=/usr \ |
---|
| 624 | --libdir=/usr/lib${LIBDIRSUFFIX} \ |
---|
| 625 | --enable-static \ |
---|
| 626 | --disable-shared \ |
---|
| 627 | --program-prefix= \ |
---|
| 628 | --program-suffix= \ |
---|
| 629 | --build=$TARGET \ |
---|
| 630 | 2>&1 |
---|
| 631 | make ${NUMJOBS} 2>&1 |
---|
| 632 | # Install lame into a temp location so ffmpeg can pickup the library |
---|
| 633 | make install DESTDIR=$FFMPEGDEPSDIR \ |
---|
| 634 | 2>&1 |
---|
| 635 | # Add DOCS to the ffmpegdeps to have it added to ffmpeg package later: |
---|
| 636 | mkdir -p $FFMPEGDEPSDIR/doc/lame |
---|
| 637 | cp -a $DOCS_LAME $FFMPEGDEPSDIR/doc/lame/ || true |
---|
| 638 | cd - |
---|
| 639 | } |
---|
| 640 | |
---|
| 641 | |
---|
| 642 | # ----------------------------------------------------------------------------- |
---|
| 643 | # Compile amr wideband/narrowband library |
---|
| 644 | # The ffmpeg will use these |
---|
| 645 | # ----------------------------------------------------------------------------- |
---|
| 646 | make_amr() |
---|
| 647 | { |
---|
| 648 | echo -e "**\n** amr ...\n**" |
---|
| 649 | cd $TMP/tmp-$PRGNAM/opencore-amr-${AMR} |
---|
| 650 | LDFLAGS="$SLKLDFLAGS" \ |
---|
| 651 | CXXFLAGS="$SLKCFLAGS" \ |
---|
| 652 | CFLAGS="$SLKCFLAGS" \ |
---|
| 653 | ./configure \ |
---|
| 654 | --prefix=/usr \ |
---|
| 655 | --libdir=/usr/lib${LIBDIRSUFFIX} \ |
---|
| 656 | --mandir=/usr/man \ |
---|
| 657 | --localstatedir=/var \ |
---|
| 658 | --sysconfdir=/etc \ |
---|
| 659 | --disable-shared \ |
---|
| 660 | --program-prefix= \ |
---|
| 661 | --program-suffix= \ |
---|
| 662 | --build=$TARGET \ |
---|
| 663 | 2>&1 |
---|
| 664 | make $NUMJOBS 2>&1 |
---|
| 665 | make install DESTDIR=$FFMPEGDEPSDIR PREFIX=/usr LIBDIR=/usr/lib${LIBDIRSUFFIX} \ |
---|
| 666 | 2>&1 |
---|
| 667 | # Add DOCS to the ffmpegdeps to have it added to ffmpeg package later: |
---|
| 668 | mkdir -p $FFMPEGDEPSDIR/doc/amr |
---|
| 669 | cp -a $DOCS_AMR $FFMPEGDEPSDIR/doc/amr || true |
---|
| 670 | cd - |
---|
| 671 | } |
---|
| 672 | |
---|
| 673 | |
---|
| 674 | # ----------------------------------------------------------------------------- |
---|
| 675 | # Compile VisualOn amr wideband encoder library |
---|
| 676 | # The ffmpeg will use these |
---|
| 677 | # ----------------------------------------------------------------------------- |
---|
| 678 | make_amrwbenc() |
---|
| 679 | { |
---|
| 680 | echo -e "**\n** amrwbenc ...\n**" |
---|
| 681 | cd $TMP/tmp-$PRGNAM/vo-amrwbenc-${AMRWBENC} |
---|
| 682 | LDFLAGS="$SLKLDFLAGS" \ |
---|
| 683 | CXXFLAGS="$SLKCFLAGS" \ |
---|
| 684 | CFLAGS="$SLKCFLAGS" \ |
---|
| 685 | ./configure \ |
---|
| 686 | --prefix=/usr \ |
---|
| 687 | --libdir=/usr/lib${LIBDIRSUFFIX} \ |
---|
| 688 | --mandir=/usr/man \ |
---|
| 689 | --localstatedir=/var \ |
---|
| 690 | --sysconfdir=/etc \ |
---|
| 691 | --disable-shared \ |
---|
| 692 | --program-prefix= \ |
---|
| 693 | --program-suffix= \ |
---|
| 694 | --build=$TARGET \ |
---|
| 695 | 2>&1 |
---|
| 696 | make $NUMJOBS 2>&1 |
---|
| 697 | make install DESTDIR=$FFMPEGDEPSDIR PREFIX=/usr LIBDIR=/usr/lib${LIBDIRSUFFIX} \ |
---|
| 698 | 2>&1 |
---|
| 699 | # Add DOCS to the ffmpegdeps to have it added to ffmpeg package later: |
---|
| 700 | mkdir -p $FFMPEGDEPSDIR/doc/amrwbenc |
---|
| 701 | cp -a $DOCS_AMRWBENC $FFMPEGDEPSDIR/doc/amrwbenc || true |
---|
| 702 | cd - |
---|
| 703 | } |
---|
| 704 | |
---|
| 705 | |
---|
| 706 | # ----------------------------------------------------------------------------- |
---|
| 707 | # Compile fdk-aac library |
---|
| 708 | # The ffmpeg will use these |
---|
| 709 | # ----------------------------------------------------------------------------- |
---|
| 710 | make_fdkaac() |
---|
| 711 | { |
---|
| 712 | echo -e "**\n** fdkaac ...\n**" |
---|
| 713 | cd $TMP/tmp-$PRGNAM/fdk-aac-${FDKAAC} |
---|
| 714 | |
---|
| 715 | CFLAGS="$SLKCFLAGS" \ |
---|
| 716 | CXXFLAGS="$SLKCFLAGS" \ |
---|
| 717 | LDFLAGS="$SLKLDFLAGS" \ |
---|
| 718 | ./configure \ |
---|
| 719 | --prefix=/usr \ |
---|
| 720 | --libdir=/usr/lib${LIBDIRSUFFIX} \ |
---|
| 721 | --enable-static \ |
---|
| 722 | --disable-shared \ |
---|
| 723 | --program-prefix= \ |
---|
| 724 | --program-suffix= \ |
---|
| 725 | --build=$TARGET \ |
---|
| 726 | 2>&1 |
---|
| 727 | make ${NUMJOBS} 2>&1 |
---|
| 728 | # Install fdkaac into a temp location so ffmpeg can pickup the library |
---|
| 729 | make install DESTDIR=$FFMPEGDEPSDIR \ |
---|
| 730 | 2>&1 |
---|
| 731 | # Add DOCS to the ffmpegdeps to have it added to ffmpeg package later: |
---|
| 732 | mkdir -p $FFMPEGDEPSDIR/doc/fdkaac |
---|
| 733 | cp -a $DOCS_FDKAAC $FFMPEGDEPSDIR/doc/fdkaac || true |
---|
| 734 | cd - |
---|
| 735 | } |
---|
| 736 | |
---|
| 737 | |
---|
| 738 | # ----------------------------------------------------------------------------- |
---|
| 739 | # Compile x265 library |
---|
| 740 | # The ffmpeg will use these |
---|
| 741 | # ----------------------------------------------------------------------------- |
---|
| 742 | make_x265() |
---|
| 743 | { |
---|
| 744 | echo -e "**\n** x265 ...\n**" |
---|
| 745 | PREVDIR=$(pwd) |
---|
| 746 | cd $TMP/tmp-$PRGNAM/x265-${X265} |
---|
| 747 | |
---|
| 748 | mkdir -p build_x265 |
---|
| 749 | cd build_x265 |
---|
| 750 | cmake ../source \ |
---|
| 751 | -DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \ |
---|
| 752 | -DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \ |
---|
| 753 | -DCMAKE_LDFLAGS:STRING="$SLKLDFLAGS" \ |
---|
| 754 | -DCMAKE_INSTALL_PREFIX=/usr \ |
---|
| 755 | -DLIB_INSTALL_DIR=lib${LIBDIRSUFFIX} \ |
---|
| 756 | -DENABLE_SHARED=OFF \ |
---|
| 757 | 2>&1 |
---|
| 758 | make ${NUMJOBS} 2>&1 |
---|
| 759 | # Install x265 into a temp location so ffmpeg can pickup the library |
---|
| 760 | make install DESTDIR=$FFMPEGDEPSDIR \ |
---|
| 761 | 2>&1 |
---|
| 762 | cd - |
---|
| 763 | # Add DOCS to the ffmpegdeps to have it added to ffmpeg package later: |
---|
| 764 | mkdir -p $FFMPEGDEPSDIR/doc/x265 |
---|
| 765 | cp -a $DOCS_X265 $FFMPEGDEPSDIR/doc/x265 || true |
---|
| 766 | cd $PREVDIR |
---|
| 767 | } |
---|
| 768 | |
---|
| 769 | |
---|
| 770 | # ----------------------------------------------------------------------------- |
---|
| 771 | # Compile aacplus library |
---|
| 772 | # The ffmpeg will use this |
---|
| 773 | # ----------------------------------------------------------------------------- |
---|
| 774 | make_aacplus () |
---|
| 775 | { |
---|
| 776 | echo -e "**\n** aacplus ...\n**" |
---|
| 777 | cd $TMP/tmp-$PRGNAM/libaacplus-${AACPLUS} |
---|
| 778 | |
---|
| 779 | # This needs the sources of the HE-AAC+ reference implementation: |
---|
| 780 | cp $SRCDIR/26410-800.zip src/ |
---|
| 781 | |
---|
| 782 | [ ! -x configure ] && autoreconf -vif |
---|
| 783 | |
---|
| 784 | CFLAGS="$SLKCFLAGS" \ |
---|
| 785 | CXXFLAGS="$SLKCFLAGS" \ |
---|
| 786 | LDFLAGS="$SLKLDFLAGS" \ |
---|
| 787 | ./configure \ |
---|
| 788 | --prefix=/usr \ |
---|
| 789 | --libdir=/usr/lib${LIBDIRSUFFIX} \ |
---|
| 790 | --enable-static \ |
---|
| 791 | --disable-shared \ |
---|
| 792 | --program-prefix= \ |
---|
| 793 | --program-suffix= \ |
---|
| 794 | --build=$TARGET \ |
---|
| 795 | 2>&1 |
---|
| 796 | # Do not use parallel make here: |
---|
| 797 | make 2>&1 |
---|
| 798 | # Install aacplus into a temp location so ffmpeg can pickup the library |
---|
| 799 | make install DESTDIR=$FFMPEGDEPSDIR \ |
---|
| 800 | 2>&1 |
---|
| 801 | # Add DOCS to the ffmpegdeps to have it added to ffmpeg package later: |
---|
| 802 | mkdir -p $FFMPEGDEPSDIR/doc/aacplus |
---|
| 803 | cp -a $DOCS_AACPLUS $FFMPEGDEPSDIR/doc/aacplus || true |
---|
| 804 | cd - |
---|
| 805 | } |
---|
| 806 | |
---|
| 807 | # ----------------------------------------------------------------------------- |
---|
| 808 | # Compile dc1394, avc1394 and raw1394 libraries |
---|
| 809 | # The ffmpeg will use these |
---|
| 810 | # ----------------------------------------------------------------------------- |
---|
| 811 | make_1394() |
---|
| 812 | { |
---|
| 813 | echo -e "**\n** 1394 ...\n**" |
---|
| 814 | OLDDIR=$(pwd) |
---|
| 815 | cd $TMP/tmp-$PRGNAM/libraw1394-${RAW1394} |
---|
| 816 | CFLAGS="$SLKCFLAGS" \ |
---|
| 817 | CXXFLAGS="$SLKCFLAGS" \ |
---|
| 818 | LDFLAGS="$SLKLDFLAGS" \ |
---|
| 819 | ./configure \ |
---|
| 820 | --prefix=/usr \ |
---|
| 821 | --libdir=/usr/lib${LIBDIRSUFFIX} \ |
---|
| 822 | --mandir=/usr/man \ |
---|
| 823 | --enable-static \ |
---|
| 824 | --disable-shared \ |
---|
| 825 | --program-prefix= \ |
---|
| 826 | --program-suffix= \ |
---|
| 827 | --build=$TARGET \ |
---|
| 828 | 2>&1 |
---|
| 829 | make ${NUMJOBS} 2>&1 |
---|
| 830 | # Install libraw1394 into a temp location so ffmpeg can pickup the library |
---|
| 831 | make install DESTDIR=$FFMPEGDEPSDIR \ |
---|
| 832 | 2>&1 |
---|
| 833 | # Add DOCS to the ffmpegdeps to have it added to ffmpeg package later: |
---|
| 834 | mkdir -p $FFMPEGDEPSDIR/doc/libraw1394 |
---|
| 835 | cp -a $DOCS_RAW1394 $FFMPEGDEPSDIR/doc/libraw1394 || true |
---|
| 836 | |
---|
| 837 | echo -e "**\n**" |
---|
| 838 | |
---|
| 839 | cd $TMP/tmp-$PRGNAM/libavc1394-${AVC1394} |
---|
| 840 | |
---|
| 841 | CFLAGS="-I$FFMPEGDEPSDIR/usr/include $SLKCFLAGS" \ |
---|
| 842 | CPPFLAGS="-I$FFMPEGDEPSDIR/usr/include $SLKCFLAGS" \ |
---|
| 843 | LDFLAGS="-L$FFMPEGDEPSDIR/usr/lib${LIBDIRSUFFIX} $SLKLDFLAGS" \ |
---|
| 844 | PKG_CONFIG_PATH="$FFMPEGDEPSDIR/usr/lib${LIBDIRSUFFIX}/pkgconfig" \ |
---|
| 845 | LIBRAW1394_CFLAGS="-I$FFMPEGDEPSDIR/usr/include" \ |
---|
| 846 | LIBRAW1394_LIBS="-L$FFMPEGDEPSDIR/usr/lib${LIBDIRSUFFIX} -lraw1394" \ |
---|
| 847 | ./configure \ |
---|
| 848 | --prefix=/usr \ |
---|
| 849 | --libdir=/usr/lib${LIBDIRSUFFIX} \ |
---|
| 850 | --enable-static \ |
---|
| 851 | --disable-shared \ |
---|
| 852 | --program-prefix= \ |
---|
| 853 | --program-suffix= \ |
---|
| 854 | --build=$TARGET \ |
---|
| 855 | 2>&1 |
---|
| 856 | make ${NUMJOBS} 2>&1 |
---|
| 857 | # Install libavc1394 into a temp location so ffmpeg can pickup the library |
---|
| 858 | make install DESTDIR=$FFMPEGDEPSDIR 2>&1 |
---|
| 859 | # Add DOCS to the ffmpegdeps to have it added to ffmpeg package later: |
---|
| 860 | mkdir -p $FFMPEGDEPSDIR/doc/libavc1394 |
---|
| 861 | cp -a $DOCS_AVC1394 $FFMPEGDEPSDIR/doc/libavc1394 || true |
---|
| 862 | |
---|
| 863 | echo -e "**\n**" |
---|
| 864 | |
---|
| 865 | cd $TMP/tmp-$PRGNAM/libdc1394-${DC1394} |
---|
| 866 | |
---|
| 867 | # Make sure that the static libraw1394 is found in the ffmpegdeps: |
---|
| 868 | CFLAGS="-I$FFMPEGDEPSDIR/usr/include $SLKCFLAGS" \ |
---|
| 869 | CPPFLAGS="-I$FFMPEGDEPSDIR/usr/include $SLKCFLAGS" \ |
---|
| 870 | LDFLAGS="-L$FFMPEGDEPSDIR/usr/lib${LIBDIRSUFFIX} $SLKLDFLAGS" \ |
---|
| 871 | PKG_CONFIG_PATH="$FFMPEGDEPSDIR/usr/lib${LIBDIRSUFFIX}/pkgconfig" \ |
---|
| 872 | ./configure \ |
---|
| 873 | --prefix=/usr \ |
---|
| 874 | --libdir=/usr/lib${LIBDIRSUFFIX} \ |
---|
| 875 | --enable-static \ |
---|
| 876 | --disable-shared \ |
---|
| 877 | --disable-examples \ |
---|
| 878 | --program-prefix= \ |
---|
| 879 | --program-suffix= \ |
---|
| 880 | --build=$TARGET \ |
---|
| 881 | 2>&1 |
---|
| 882 | make ${NUMJOBS} 2>&1 |
---|
| 883 | # Install libdc1394 into a temp location so ffmpeg can pickup the library |
---|
| 884 | make install DESTDIR=$FFMPEGDEPSDIR \ |
---|
| 885 | 2>&1 |
---|
| 886 | # Fix the pkgconfig file to get rid of unresolved symbols at runtime: |
---|
| 887 | sed -i -e "/^Libs:/s/$/ -lavc1394 -lraw1394/" $FFMPEGDEPSDIR/usr/lib${LIBDIRSUFFIX}/pkgconfig/libdc1394-2.pc |
---|
| 888 | # Add DOCS to the ffmpegdeps to have it added to ffmpeg package later: |
---|
| 889 | mkdir -p $FFMPEGDEPSDIR/doc/libdc1394 |
---|
| 890 | cp -a $DOCS_DC1394 $FFMPEGDEPSDIR/doc/libdc1394 || true |
---|
| 891 | |
---|
| 892 | cd $OLDDIR |
---|
| 893 | } |
---|
| 894 | |
---|
| 895 | |
---|
| 896 | # ----------------------------------------------------------------------------- |
---|
| 897 | # Compile faac library |
---|
| 898 | # The ffmpeg will use these |
---|
| 899 | # ----------------------------------------------------------------------------- |
---|
| 900 | make_faac() |
---|
| 901 | { |
---|
| 902 | echo -e "**\n** faac ...\n**" |
---|
| 903 | cd $TMP/tmp-$PRGNAM/faac-${FAAC} |
---|
| 904 | |
---|
| 905 | # Newer gcc/glibc will bail out otherwise: |
---|
| 906 | cat $SRCDIR/patches/faac_gcc44.diff | patch -p1 --verbose \ |
---|
| 907 | 2>&1 |
---|
| 908 | |
---|
| 909 | #sh bootstrap |
---|
| 910 | CFLAGS="$SLKCFLAGS" \ |
---|
| 911 | CXXFLAGS="$SLKCFLAGS" \ |
---|
| 912 | LDFLAGS="$SLKLDFLAGS" \ |
---|
| 913 | ./configure \ |
---|
| 914 | --prefix=/usr \ |
---|
| 915 | --libdir=/usr/lib${LIBDIRSUFFIX} \ |
---|
| 916 | --enable-static \ |
---|
| 917 | --disable-shared \ |
---|
| 918 | --with-mp4v2 \ |
---|
| 919 | --program-prefix= \ |
---|
| 920 | --program-suffix= \ |
---|
| 921 | --build=$TARGET \ |
---|
| 922 | 2>&1 |
---|
| 923 | make ${NUMJOBS} 2>&1 |
---|
| 924 | # Install faac into a temp location so ffmpeg can pickup the library |
---|
| 925 | make install DESTDIR=$FFMPEGDEPSDIR \ |
---|
| 926 | 2>&1 |
---|
| 927 | # Add DOCS to the ffmpegdeps to have it added to ffmpeg package later: |
---|
| 928 | mkdir -p $FFMPEGDEPSDIR/doc/faac |
---|
| 929 | cp -a $DOCS_FAAC $FFMPEGDEPSDIR/doc/faac || true |
---|
| 930 | cd - |
---|
| 931 | } |
---|
| 932 | |
---|
| 933 | |
---|
| 934 | # ----------------------------------------------------------------------------- |
---|
| 935 | # Compile faad2 |
---|
| 936 | # ----------------------------------------------------------------------------- |
---|
| 937 | make_faad2() |
---|
| 938 | { |
---|
| 939 | echo -e "**\n** faad2 ...\n**" |
---|
| 940 | #mv $TMP/tmp-$PRGNAM/faad2 $TMP/tmp-$PRGNAM/faad2-${FAAD2} |
---|
| 941 | cd $TMP/tmp-$PRGNAM/faad2-${FAAD2} |
---|
| 942 | #autoreconf -vif |
---|
| 943 | CFLAGS="$SLKCFLAGS" \ |
---|
| 944 | CXXFLAGS="$SLKCFLAGS" \ |
---|
| 945 | LDFLAGS="$SLKLDFLAGS" \ |
---|
| 946 | ./configure \ |
---|
| 947 | --prefix=/usr \ |
---|
| 948 | --libdir=/usr/lib${LIBDIRSUFFIX} \ |
---|
| 949 | --without-xmms \ |
---|
| 950 | --enable-static \ |
---|
| 951 | --disable-shared \ |
---|
| 952 | --program-prefix= \ |
---|
| 953 | --program-suffix= \ |
---|
| 954 | --build=$TARGET \ |
---|
| 955 | 2>&1 |
---|
| 956 | # No longer available: |
---|
| 957 | #--with-mp4v2 \ |
---|
| 958 | # Gives errors "faad bitstream value not allowed by specification": |
---|
| 959 | #--with-drm \ |
---|
| 960 | make ${NUMJOBS} 2>&1 |
---|
| 961 | # Install faad2 into a temp location so ffmpeg can pickup the library |
---|
| 962 | make install DESTDIR=$FFMPEGDEPSDIR \ |
---|
| 963 | 2>&1 |
---|
| 964 | # Add DOCS to the ffmpegdeps to have it added to ffmpeg package later: |
---|
| 965 | mkdir -p $FFMPEGDEPSDIR/doc/faad2 |
---|
| 966 | cp -a $DOCS_FAAD2 $FFMPEGDEPSDIR/doc/faad2 || true |
---|
| 967 | cd - |
---|
| 968 | } |
---|
| 969 | |
---|
| 970 | |
---|
| 971 | # ----------------------------------------------------------------------------- |
---|
| 972 | # Compile speex codec |
---|
| 973 | # ----------------------------------------------------------------------------- |
---|
| 974 | make_speex() |
---|
| 975 | { |
---|
| 976 | echo -e "**\n** speex ...\n**" |
---|
| 977 | cd $TMP/tmp-$PRGNAM/speex-$SPEEX |
---|
| 978 | CFLAGS="$SLKCFLAGS" \ |
---|
| 979 | CXXFLAGS="$SLKCFLAGS" \ |
---|
| 980 | LDFLAGS="$SLKLDFLAGS" \ |
---|
| 981 | ./configure \ |
---|
| 982 | --prefix=/usr \ |
---|
| 983 | --libdir=/usr/lib${LIBDIRSUFFIX} \ |
---|
| 984 | --enable-static \ |
---|
| 985 | --disable-shared \ |
---|
| 986 | --program-prefix= \ |
---|
| 987 | --program-suffix= \ |
---|
| 988 | --build=$TARGET \ |
---|
| 989 | 2>&1 |
---|
| 990 | make ${NUMJOBS} 2>&1 |
---|
| 991 | # Install speex into a temp location so ffmpeg can pickup the library |
---|
| 992 | echo -e "\n**\n**\n" |
---|
| 993 | make install DESTDIR=$FFMPEGDEPSDIR \ |
---|
| 994 | 2>&1 |
---|
| 995 | # Add DOCS to the ffmpegdeps to have it added to ffmpeg package later: |
---|
| 996 | mkdir -p $FFMPEGDEPSDIR/doc/speex/ |
---|
| 997 | cp $DOCS_SPEEX $FFMPEGDEPSDIR/doc/speex/ || true |
---|
| 998 | cd - |
---|
| 999 | } |
---|
| 1000 | |
---|
| 1001 | |
---|
| 1002 | # ----------------------------------------------------------------------------- |
---|
| 1003 | # Compile x264 |
---|
| 1004 | # ----------------------------------------------------------------------------- |
---|
| 1005 | make_x264() |
---|
| 1006 | { |
---|
| 1007 | echo -e "**\n** x264 ...\n**" |
---|
| 1008 | if [ "$ARCH" = "x86_64" ]; then |
---|
| 1009 | ARCHOPTS="--enable-pic" |
---|
| 1010 | else |
---|
| 1011 | ARCHOPTS="" |
---|
| 1012 | fi |
---|
| 1013 | cd $TMP/tmp-$PRGNAM/x264-snapshot-${X264} |
---|
| 1014 | CFLAGS="$SLKCFLAGS" \ |
---|
| 1015 | CXXFLAGS="$SLKCFLAGS" \ |
---|
| 1016 | LDFLAGS="$SLKLDFLAGS" \ |
---|
| 1017 | ./configure \ |
---|
| 1018 | --prefix=/usr \ |
---|
| 1019 | --libdir=/usr/lib${LIBDIRSUFFIX} \ |
---|
| 1020 | --enable-static \ |
---|
| 1021 | --disable-cli \ |
---|
| 1022 | $ARCHOPTS \ |
---|
| 1023 | 2>&1 |
---|
| 1024 | make ${NUMJOBS} 2>&1 |
---|
| 1025 | # Install x264 into a temp location so ffmpeg can pickup the library |
---|
| 1026 | make install DESTDIR=$FFMPEGDEPSDIR \ |
---|
| 1027 | 2>&1 |
---|
| 1028 | # Add DOCS to the ffmpegdeps to have it added to ffmpeg package later: |
---|
| 1029 | mkdir -p $FFMPEGDEPSDIR/doc/x264 |
---|
| 1030 | cp -a $DOCS_X264 $FFMPEGDEPSDIR/doc/x264 || true |
---|
| 1031 | cd - |
---|
| 1032 | } |
---|
| 1033 | |
---|
| 1034 | |
---|
| 1035 | # ----------------------------------------------------------------------------- |
---|
| 1036 | # Compile gsm |
---|
| 1037 | # ----------------------------------------------------------------------------- |
---|
| 1038 | make_gsm() |
---|
| 1039 | { |
---|
| 1040 | echo -e "**\n** gsm ...\n**" |
---|
| 1041 | GSMMAJ=$(echo $GSM | cut -d. -f1,2) |
---|
| 1042 | GSMPL=$(echo $GSM | cut -d. -f3) |
---|
| 1043 | mv $TMP/tmp-$PRGNAM/gsm-${GSMMAJ}-pl${GSMPL} $TMP/tmp-$PRGNAM/gsm-${GSM} |
---|
| 1044 | cd $TMP/tmp-$PRGNAM/gsm-${GSM} |
---|
| 1045 | # Without this, x86_64 builds will fail: |
---|
| 1046 | sed -i -e "/^CCFLAGS/s,-O2 ,$SLKCFLAGS ," \ |
---|
| 1047 | -e "s,^# LDFLAGS.*,LDFLAGS = $SLKLDFLAGS," Makefile |
---|
| 1048 | make ${NUMJOBS} 2>&1 |
---|
| 1049 | # Install gsm into a temp location so ffmpeg can pickup the library |
---|
| 1050 | make install 2>&1 |
---|
| 1051 | mkdir -p $FFMPEGDEPSDIR/usr/{bin,include/gsm,lib${LIBDIRSUFFIX}} |
---|
| 1052 | cp bin/* $FFMPEGDEPSDIR/usr/bin/ |
---|
| 1053 | cp inc/gsm.h $FFMPEGDEPSDIR/usr/include/gsm/ |
---|
| 1054 | ln -sf gsm/gsm.h $FFMPEGDEPSDIR/usr/include/gsm.h |
---|
| 1055 | cp lib/* $FFMPEGDEPSDIR/usr/lib${LIBDIRSUFFIX}/ |
---|
| 1056 | # Add DOCS to the ffmpegdeps to have it added to ffmpeg package later: |
---|
| 1057 | mkdir -p $FFMPEGDEPSDIR/doc/gsm |
---|
| 1058 | cp -a $DOCS_GSM $FFMPEGDEPSDIR/doc/gsm || true |
---|
| 1059 | cd - |
---|
| 1060 | } |
---|
| 1061 | |
---|
| 1062 | |
---|
| 1063 | # ----------------------------------------------------------------------------- |
---|
| 1064 | # Compile orc |
---|
| 1065 | # ----------------------------------------------------------------------------- |
---|
| 1066 | make_orc() |
---|
| 1067 | { |
---|
| 1068 | echo -e "**\n** orc ...\n**" |
---|
| 1069 | cd $TMP/tmp-$PRGNAM/orc-$ORC |
---|
| 1070 | CFLAGS="$SLKCFLAGS" \ |
---|
| 1071 | CXXFLAGS="$SLKCFLAGS" \ |
---|
| 1072 | LDFLAGS="$SLKLDFLAGS" \ |
---|
| 1073 | ./configure \ |
---|
| 1074 | --prefix=$FFMPEGDEPSDIR/usr \ |
---|
| 1075 | --libdir=$FFMPEGDEPSDIR/usr/lib${LIBDIRSUFFIX} \ |
---|
| 1076 | --enable-static \ |
---|
| 1077 | --disable-shared \ |
---|
| 1078 | --program-prefix= \ |
---|
| 1079 | --program-suffix= \ |
---|
| 1080 | --build=$TARGET \ |
---|
| 1081 | 2>&1 |
---|
| 1082 | make ${NUMJOBS} 2>&1 |
---|
| 1083 | # Install orc into a temp location so schroedinger can pickup the library |
---|
| 1084 | echo -e "\n**\n**\n" |
---|
| 1085 | # We used --prefix=$FFMPEGDEPSDIR/usr so that schroedinger's build will find the |
---|
| 1086 | # headers in the $FFMPEGDEPSDIR instead of the filesystem root: |
---|
| 1087 | make install 2>&1 |
---|
| 1088 | # Add DOCS to the ffmpeg deps to have it added to ffmpeg package later: |
---|
| 1089 | mkdir -p $FFMPEGDEPSDIR/doc/orc/ |
---|
| 1090 | cp ${DOCS_ORC} $FFMPEGDEPSDIR/doc/orc/ || true |
---|
| 1091 | cd - |
---|
| 1092 | } |
---|
| 1093 | |
---|
| 1094 | |
---|
| 1095 | # ----------------------------------------------------------------------------- |
---|
| 1096 | # Compile schroedinger |
---|
| 1097 | # ----------------------------------------------------------------------------- |
---|
| 1098 | make_schroedinger() |
---|
| 1099 | { |
---|
| 1100 | echo -e "**\n** schroedinger ...\n**" |
---|
| 1101 | if [ "$ARCH" = "x86_64" ]; then |
---|
| 1102 | ARCHOPTS="--with-pic" |
---|
| 1103 | else |
---|
| 1104 | ARCHOPTS="" |
---|
| 1105 | fi |
---|
| 1106 | cd $TMP/tmp-$PRGNAM/schroedinger-$SCHROEDINGER |
---|
| 1107 | |
---|
| 1108 | # Do not try to build the testsuite, it gives errors about multiple definitions: |
---|
| 1109 | cat $SRCDIR/patches/schroedinger_notests.patch | patch -p1 --verbose \ |
---|
| 1110 | 2>&1 |
---|
| 1111 | |
---|
| 1112 | # Because of the patch, run autoreconf: |
---|
| 1113 | autoreconf -vif |
---|
| 1114 | |
---|
| 1115 | CFLAGS="$SLKCFLAGS" \ |
---|
| 1116 | CXXFLAGS="$SLKCFLAGS" \ |
---|
| 1117 | LDFLAGS="-L$FFMPEGDEPSDIR/usr/lib${LIBDIRSUFFIX} $SLKLDFLAGS" \ |
---|
| 1118 | PKG_CONFIG_PATH="$FFMPEGDEPSDIR/usr/lib${LIBDIRSUFFIX}/pkgconfig" \ |
---|
| 1119 | ./configure \ |
---|
| 1120 | --prefix=$FFMPEGDEPSDIR/usr \ |
---|
| 1121 | --libdir=$FFMPEGDEPSDIR/usr/lib${LIBDIRSUFFIX} \ |
---|
| 1122 | --enable-static \ |
---|
| 1123 | --disable-shared \ |
---|
| 1124 | --program-prefix= \ |
---|
| 1125 | --program-suffix= \ |
---|
| 1126 | $ARCHOPTS \ |
---|
| 1127 | --build=$TARGET \ |
---|
| 1128 | 2>&1 |
---|
| 1129 | make ${NUMJOBS} 2>&1 |
---|
| 1130 | # Install schroedinger into a temp location so ffmpeg can pickup the library |
---|
| 1131 | echo -e "\n**\n**\n" |
---|
| 1132 | make install 2>&1 |
---|
| 1133 | # Or else the ffmpeg build wil fail: |
---|
| 1134 | cp schroedinger.pc \ |
---|
| 1135 | $FFMPEGDEPSDIR/usr/lib${LIBDIRSUFFIX}/pkgconfig/schroedinger.pc |
---|
| 1136 | cp schroedinger.pc \ |
---|
| 1137 | $FFMPEGDEPSDIR/usr/lib${LIBDIRSUFFIX}/pkgconfig/schroedinger-1.0.pc |
---|
| 1138 | ( cd $FFMPEGDEPSDIR/usr/include |
---|
| 1139 | ln -sf schroedinger-1.0/schroedinger |
---|
| 1140 | ) |
---|
| 1141 | # Add DOCS to the ffmpegdeps to have it added to ffmpeg package later: |
---|
| 1142 | mkdir -p $FFMPEGDEPSDIR/doc/schroedinger/ |
---|
| 1143 | cp -a $DOCS_SCHROEDINGER $FFMPEGDEPSDIR/doc/schroedinger/ || true |
---|
| 1144 | cd - |
---|
| 1145 | } |
---|
| 1146 | |
---|
| 1147 | |
---|
| 1148 | # ----------------------------------------------------------------------------- |
---|
| 1149 | # Compile rtmpdump |
---|
| 1150 | # ----------------------------------------------------------------------------- |
---|
| 1151 | make_rtmp() |
---|
| 1152 | { |
---|
| 1153 | echo -e "**\n** rtmp ...\n**" |
---|
| 1154 | cd $TMP/tmp-$PRGNAM/rtmpdump-$RTMP |
---|
| 1155 | make -C librtmp prefix=/usr OPT="$SLKCFLAGS" all librtmp.pc \ |
---|
| 1156 | 2>&1 |
---|
| 1157 | # Install librtmp into a temp location so ffmpeg can pickup the library |
---|
| 1158 | echo -e "\n**\n**\n" |
---|
| 1159 | mkdir -p $FFMPEGDEPSDIR/usr/{include/librtmp,lib${LIBDIRSUFFIX}/pkgconfig} |
---|
| 1160 | cp -a librtmp/librtmp.a $FFMPEGDEPSDIR/usr/lib${LIBDIRSUFFIX} |
---|
| 1161 | cp -a librtmp/{amf.h,http.h,log.h,rtmp.h} $FFMPEGDEPSDIR/usr/include/librtmp |
---|
| 1162 | cp -a librtmp/librtmp.pc $FFMPEGDEPSDIR/usr/lib${LIBDIRSUFFIX}/pkgconfig |
---|
| 1163 | # Add DOCS to the ffmpegdeps to have it added to ffmpeg package later: |
---|
| 1164 | mkdir -p $FFMPEGDEPSDIR/doc/rtmp/ |
---|
| 1165 | cp -a $DOCS_RTMP $FFMPEGDEPSDIR/doc/rtmp/ || true |
---|
| 1166 | cd - |
---|
| 1167 | } |
---|
| 1168 | |
---|
| 1169 | |
---|
| 1170 | # ----------------------------------------------------------------------------- |
---|
| 1171 | # Compile libvdpau |
---|
| 1172 | # ----------------------------------------------------------------------------- |
---|
| 1173 | make_vdpau() |
---|
| 1174 | { |
---|
| 1175 | echo -e "**\n** vdpau ...\n**" |
---|
| 1176 | cd $TMP/tmp-$PRGNAM/libvdpau-$VDPAU |
---|
| 1177 | |
---|
| 1178 | CFLAGS="$SLKCFLAGS" \ |
---|
| 1179 | CXXFLAGS="$SLKCFLAGS" \ |
---|
| 1180 | LDFLAGS="$SLKLDFLAGS" \ |
---|
| 1181 | ./configure \ |
---|
| 1182 | --prefix=/usr \ |
---|
| 1183 | --libdir=/usr/lib${LIBDIRSUFFIX} \ |
---|
| 1184 | --enable-static \ |
---|
| 1185 | --disable-documentation \ |
---|
| 1186 | --program-prefix= \ |
---|
| 1187 | --program-suffix= \ |
---|
| 1188 | --build=$TARGET \ |
---|
| 1189 | 2>&1 |
---|
| 1190 | make ${NUMJOBS} 2>&1 |
---|
| 1191 | # Strip the static lib to prevent linking errors in 64-bit, |
---|
| 1192 | find . -name "*.a" | xargs strip --strip-unneeded |
---|
| 1193 | # Install vdpau into a temp location so ffmpeg can pickup the library |
---|
| 1194 | echo -e "\n**\n**\n" |
---|
| 1195 | make install DESTDIR=$FFMPEGDEPSDIR \ |
---|
| 1196 | 2>&1 |
---|
| 1197 | # Remove the .so and .la files; we want static linking: |
---|
| 1198 | rm -f $FFMPEGDEPSDIR/usr/lib${LIBDIRSUFFIX}/libvdpau*.so* |
---|
| 1199 | rm -f $FFMPEGDEPSDIR/usr/lib${LIBDIRSUFFIX}/libvdpau*.la |
---|
| 1200 | rm -f $FFMPEGDEPSDIR/usr/lib${LIBDIRSUFFIX}/vdpau/libvdpau*.so* |
---|
| 1201 | rm -f $FFMPEGDEPSDIR/usr/lib${LIBDIRSUFFIX}/vdpau/libvdpau*.la |
---|
| 1202 | # Add DOCS to the ffmpegdeps to have it added to ffmpeg package later: |
---|
| 1203 | mkdir -p $FFMPEGDEPSDIR/doc/vdpau/ |
---|
| 1204 | cp $DOCS_VDPAU $FFMPEGDEPSDIR/doc/vdpau/ || true |
---|
| 1205 | cd - |
---|
| 1206 | } |
---|
| 1207 | |
---|
| 1208 | |
---|
| 1209 | # ----------------------------------------------------------------------------- |
---|
| 1210 | # Compile VP8 |
---|
| 1211 | # ----------------------------------------------------------------------------- |
---|
| 1212 | make_vpx() |
---|
| 1213 | { |
---|
| 1214 | echo -e "**\n** vpx ...\n**" |
---|
| 1215 | cd $TMP/tmp-$PRGNAM/libvpx-${VPX} |
---|
| 1216 | |
---|
| 1217 | case "$ARCH" in |
---|
| 1218 | i?86) |
---|
| 1219 | ARCHOPTS="--target=x86-linux-gcc" |
---|
| 1220 | ;; |
---|
| 1221 | x86_64) |
---|
| 1222 | ARCHOPTS="--target=${ARCH}-linux-gcc --enable-pic" |
---|
| 1223 | ;; |
---|
| 1224 | armv7hl) |
---|
| 1225 | ARCHOPTS="--target=armv7-linux-gcc --enable-pic" |
---|
| 1226 | cat $SRCDIR/patches/libvpx_fix-armhf-link.patch | patch -p1 --verbose |
---|
| 1227 | export AS=as |
---|
| 1228 | export AR=ar |
---|
| 1229 | export CROSS="${TARGET}-" |
---|
| 1230 | ;; |
---|
| 1231 | arm*) |
---|
| 1232 | ARCHOPTS="--target=armv5te-linux-gcc --enable-pic" |
---|
| 1233 | export AS=as |
---|
| 1234 | export AR=ar |
---|
| 1235 | export CROSS="${TARGET}-" |
---|
| 1236 | ;; |
---|
| 1237 | *) |
---|
| 1238 | ARCHOPTS="--target=${ARCH}-linux-gcc" |
---|
| 1239 | ;; |
---|
| 1240 | esac |
---|
| 1241 | |
---|
| 1242 | CFLAGS="-I$FFMPEGDEPSDIR/usr/include $SLKCFLAGS" \ |
---|
| 1243 | CXXFLAGS="-I$FFMPEGDEPSDIR/usr/include $SLKCFLAGS" \ |
---|
| 1244 | LDFLAGS="-L$FFMPEGDEPSDIR/usr/lib${LIBDIRSUFFIX} $SLKLDFLAGS" \ |
---|
| 1245 | PKG_CONFIG_PATH="$FFMPEGDEPSDIR/usr/lib${LIBDIRSUFFIX}/pkgconfig" \ |
---|
| 1246 | ./configure \ |
---|
| 1247 | --prefix=$FFMPEGDEPSDIR/usr \ |
---|
| 1248 | --libdir=$FFMPEGDEPSDIR/usr/lib${LIBDIRSUFFIX} \ |
---|
| 1249 | --disable-examples \ |
---|
| 1250 | --disable-debug-libs \ |
---|
| 1251 | --disable-debug \ |
---|
| 1252 | --disable-unit-tests \ |
---|
| 1253 | --enable-postproc \ |
---|
| 1254 | --enable-runtime-cpu-detect \ |
---|
| 1255 | --enable-vp8 \ |
---|
| 1256 | --enable-vp9 \ |
---|
| 1257 | --enable-vp9-postproc \ |
---|
| 1258 | $ARCHOPTS \ |
---|
| 1259 | 2>&1 |
---|
| 1260 | make ${NUMJOBS} 2>&1 |
---|
| 1261 | # Install libvpx into a temp location so ffmpeg can pickup the library |
---|
| 1262 | make install 2>&1 |
---|
| 1263 | # Add DOCS to the ffmpegdeps to have it added to ffmpeg package later: |
---|
| 1264 | mkdir -p $FFMPEGDEPSDIR/doc/vpx |
---|
| 1265 | cp -a $DOCS_VPX $FFMPEGDEPSDIR/doc/vpx/ || true |
---|
| 1266 | cd - |
---|
| 1267 | } |
---|
| 1268 | |
---|
| 1269 | |
---|
| 1270 | # ----------------------------------------------------------------------------- |
---|
| 1271 | # Compile libva |
---|
| 1272 | # ----------------------------------------------------------------------------- |
---|
| 1273 | make_libva() |
---|
| 1274 | { |
---|
| 1275 | echo -e "**\n** libva ...\n**" |
---|
| 1276 | cd $TMP/tmp-$PRGNAM/libva-$LIBVA |
---|
| 1277 | |
---|
| 1278 | # |
---|
| 1279 | # == NOTE ON VAAPI == |
---|
| 1280 | # |
---|
| 1281 | # VAAPI can enable hardware accelerated playback for MPEG-2/4, H.264/AVC |
---|
| 1282 | # and VC-1 video on certain graphics hardware. |
---|
| 1283 | # The VAAPI support in this ffmeeg package depends on VA drivers that you have |
---|
| 1284 | # to install yourself for your specific hardware. The drivers should go into |
---|
| 1285 | # directory /usr/lib${LIBDIRSUFFIX}/va/drivers . |
---|
| 1286 | # If you install my libva package you can get MPEG-2 hardware acceleration on |
---|
| 1287 | # Intel graphics. If you additionally install my vdpau-video package, then you |
---|
| 1288 | # get hardware acceleration on Nvidia graphics (with nvidia's binary driver). |
---|
| 1289 | # If you own an Ati card and use the fglrx driver, then you can achieve |
---|
| 1290 | # hardware acceleration by installing the xvba-video driver from here: |
---|
| 1291 | # http://www.splitted-desktop.com/~gbeauchesne/xvba-video/ (since I do not own |
---|
| 1292 | # Ati hardware I can not build a package for xvba-video myself) |
---|
| 1293 | |
---|
| 1294 | CFLAGS="$SLKCFLAGS" \ |
---|
| 1295 | CXXFLAGS="$SLKCFLAGS" \ |
---|
| 1296 | LDFLAGS="$SLKLDFLAGS" \ |
---|
| 1297 | ./configure \ |
---|
| 1298 | --prefix=/usr \ |
---|
| 1299 | --libdir=/usr/lib${LIBDIRSUFFIX} \ |
---|
| 1300 | --enable-dummy-driver \ |
---|
| 1301 | --enable-shared \ |
---|
| 1302 | --enable-static \ |
---|
| 1303 | --program-prefix= \ |
---|
| 1304 | --program-suffix= \ |
---|
| 1305 | --build=$TARGET \ |
---|
| 1306 | 2>&1 |
---|
| 1307 | make ${NUMJOBS} 2>&1 |
---|
| 1308 | # Strip the static lib to prevent linking errors in 64-bit, |
---|
| 1309 | find . -name "*.a" | xargs strip --strip-unneeded |
---|
| 1310 | # Install libva into a temp location so ffmpeg can pickup the library |
---|
| 1311 | echo -e "\n**\n**\n" |
---|
| 1312 | make install DESTDIR=$FFMPEGDEPSDIR \ |
---|
| 1313 | 2>&1 |
---|
| 1314 | # Remove the .so and .la files; we want static linking (but still use |
---|
| 1315 | # the drivers in $(libdir)/va/drivers): |
---|
| 1316 | rm -f $FFMPEGDEPSDIR/usr/lib${LIBDIRSUFFIX}/libva*.so* |
---|
| 1317 | rm -f $FFMPEGDEPSDIR/usr/lib${LIBDIRSUFFIX}/libva*.la |
---|
| 1318 | # Add DOCS to the ffmpegdeps to have it added to ffmpeg package later: |
---|
| 1319 | mkdir -p $FFMPEGDEPSDIR/doc/libva |
---|
| 1320 | cp -a $DOCS_LIBVA $FFMPEGDEPSDIR/doc/libva/ || true |
---|
| 1321 | cd - |
---|
| 1322 | } |
---|
| 1323 | |
---|
| 1324 | |
---|
| 1325 | # ----------------------------------------------------------------------------- |
---|
| 1326 | # Compile fribidi |
---|
| 1327 | # ----------------------------------------------------------------------------- |
---|
| 1328 | make_fribidi() |
---|
| 1329 | { |
---|
| 1330 | echo -e "**\n** fribidi ...\n**" |
---|
| 1331 | cd $TMP/tmp-$PRGNAM/fribidi-$FRIBIDI |
---|
| 1332 | if [ "$ARCH" = "x86_64" ]; then |
---|
| 1333 | ARCHOPTS="--with-pic" |
---|
| 1334 | else |
---|
| 1335 | ARCHOPTS="" |
---|
| 1336 | fi |
---|
| 1337 | |
---|
| 1338 | # Allow for internal use of the library: |
---|
| 1339 | cat $SRCDIR/patches/fribidi.patch | patch -p1 --verbose \ |
---|
| 1340 | 2>&1 |
---|
| 1341 | |
---|
| 1342 | # And since we patched the Makefile.am we have to bootstrap: |
---|
| 1343 | rm -f configure |
---|
| 1344 | ./bootstrap |
---|
| 1345 | |
---|
| 1346 | CFLAGS="$SLKCFLAGS" \ |
---|
| 1347 | CXXFLAGS="$SLKCFLAGS" \ |
---|
| 1348 | LDFLAGS="$SLKLDFLAGS" \ |
---|
| 1349 | ./configure \ |
---|
| 1350 | --prefix=$FFMPEGDEPSDIR/usr \ |
---|
| 1351 | --libdir=$FFMPEGDEPSDIR/usr/lib${LIBDIRSUFFIX} \ |
---|
| 1352 | --enable-static \ |
---|
| 1353 | --disable-shared \ |
---|
| 1354 | --program-prefix= \ |
---|
| 1355 | --program-suffix= \ |
---|
| 1356 | $ARCHOPTS \ |
---|
| 1357 | --build=$TARGET \ |
---|
| 1358 | 2>&1 |
---|
| 1359 | make ${NUMJOBS} 2>&1 |
---|
| 1360 | # Install fribidi into a temp location so ffmpeg can pickup the library |
---|
| 1361 | echo -e "\n**\n**\n" |
---|
| 1362 | make install 2>&1 |
---|
| 1363 | # Add DOCS to the ffmpegdeps to have it added to ffmpeg package later: |
---|
| 1364 | mkdir -p $FFMPEGDEPSDIR/doc/fribidi |
---|
| 1365 | cp -a $DOCS_FRIBIDI $FFMPEGDEPSDIR/doc/fribidi/ || true |
---|
| 1366 | cd - |
---|
| 1367 | } |
---|
| 1368 | |
---|
| 1369 | |
---|
| 1370 | # ----------------------------------------------------------------------------- |
---|
| 1371 | # Compile libass |
---|
| 1372 | # ----------------------------------------------------------------------------- |
---|
| 1373 | make_ass() |
---|
| 1374 | { |
---|
| 1375 | echo -e "**\n** ass ...\n**" |
---|
| 1376 | cd $TMP/tmp-$PRGNAM/libass-$ASS |
---|
| 1377 | CFLAGS="-I$FFMPEGDEPSDIR/usr/include $SLKCFLAGS" \ |
---|
| 1378 | CXXFLAGS="-I$FFMPEGDEPSDIR/usr/include $SLKCFLAGS" \ |
---|
| 1379 | LDFLAGS="-L$FFMPEGDEPSDIR/usr/lib${LIBDIRSUFFIX} $SLKLDFLAGS" \ |
---|
| 1380 | PKG_CONFIG_PATH="$FFMPEGDEPSDIR/usr/lib${LIBDIRSUFFIX}/pkgconfig" \ |
---|
| 1381 | ./configure \ |
---|
| 1382 | --prefix=$FFMPEGDEPSDIR/usr \ |
---|
| 1383 | --libdir=$FFMPEGDEPSDIR/usr/lib${LIBDIRSUFFIX} \ |
---|
| 1384 | --enable-static \ |
---|
| 1385 | --disable-shared \ |
---|
| 1386 | --program-prefix= \ |
---|
| 1387 | --program-suffix= \ |
---|
| 1388 | --build=$TARGET \ |
---|
| 1389 | 2>&1 |
---|
| 1390 | make ${NUMJOBS} 2>&1 |
---|
| 1391 | # Install libass into a temp location so ffmpeg can pickup the library |
---|
| 1392 | echo -e "\n**\n**\n" |
---|
| 1393 | make install 2>&1 |
---|
| 1394 | # Add DOCS to the ffmpegdeps to have it added to ffmpeg package later: |
---|
| 1395 | mkdir -p $FFMPEGDEPSDIR/doc/libass |
---|
| 1396 | cp -a $DOCS_ASS $FFMPEGDEPSDIR/doc/libass/ || true |
---|
| 1397 | cd - |
---|
| 1398 | } |
---|
| 1399 | |
---|
| 1400 | |
---|
| 1401 | # ----------------------------------------------------------------------------- |
---|
| 1402 | # Compile v4l libraries |
---|
| 1403 | # ----------------------------------------------------------------------------- |
---|
| 1404 | make_v4l() |
---|
| 1405 | { |
---|
| 1406 | echo -e "**\n** v4l ...\n**" |
---|
| 1407 | cd $TMP/tmp-$PRGNAM/v4l-utils-${V4L} |
---|
| 1408 | |
---|
| 1409 | mkdir ${FFMPEGDEPSDIR}/etc |
---|
| 1410 | |
---|
| 1411 | export CFLAGS="$SLKCFLAGS" |
---|
| 1412 | export CPPFLAGS="$SLKCFLAGS" |
---|
| 1413 | export LDFLAGS="$SLKLDFLAGS -ljpeg" |
---|
| 1414 | ./configure \ |
---|
| 1415 | --prefix=$FFMPEGDEPSDIR/usr \ |
---|
| 1416 | --libdir=$FFMPEGDEPSDIR/usr/lib${LIBDIRSUFFIX} \ |
---|
| 1417 | --sysconfdir=/etc \ |
---|
| 1418 | --with-udevdir=/lib/udev \ |
---|
| 1419 | --enable-static \ |
---|
| 1420 | --disable-shared \ |
---|
| 1421 | --disable-libdvbv5 \ |
---|
| 1422 | --enable-libv4l \ |
---|
| 1423 | --disable-v4l-utils \ |
---|
| 1424 | --disable-qv4l2 \ |
---|
| 1425 | --program-prefix= \ |
---|
| 1426 | --program-suffix= \ |
---|
| 1427 | --build=$TARGET \ |
---|
| 1428 | 2>&1 |
---|
| 1429 | |
---|
| 1430 | make ${NUMJOBS} LINKTYPE=static 2>&1 |
---|
| 1431 | # Strip the static lib to prevent linking errors in 64-bit, |
---|
| 1432 | # and fix the pkg-config file (to fix unresolved symbols) |
---|
| 1433 | find . -name "*.a" | xargs strip --strip-unneeded |
---|
| 1434 | sed -i "/^Libs: /s/$/ -lv4l2 -lv4lconvert -ljpeg/" lib/libv4l1/libv4l1.pc |
---|
| 1435 | sed -i "/^Libs: /s/ -lv4l2/ -lv4l2 -lv4lconvert -ljpeg/" lib/libv4l2/libv4l2.pc |
---|
| 1436 | # Install libv4l into a temp directory so that ffmpeg can pick it up later: |
---|
| 1437 | make install LINKTYPE=static \ |
---|
| 1438 | sysconfdir=$FFMPEGDEPSDIR/etc \ |
---|
| 1439 | man1dir=$FFMPEGDEPSDIR/usr/man/man1 \ |
---|
| 1440 | keytablesystemdir=$FFMPEGDEPSDIR/lib/udev/rc_keymaps \ |
---|
| 1441 | udevrulesdir=$FFMPEGDEPSDIR/lib/udev/rules.d \ |
---|
| 1442 | 2>&1 |
---|
| 1443 | # Add DOCS to the ffmpegdeps to have it added to ffmpeg package later: |
---|
| 1444 | mkdir -p $FFMPEGDEPSDIR/doc/v4l-utils |
---|
| 1445 | cp -a $DOCS_V4L2 $FFMPEGDEPSDIR/doc/v4l-utils/ || true |
---|
| 1446 | |
---|
| 1447 | cd - |
---|
| 1448 | } |
---|
| 1449 | |
---|
| 1450 | |
---|
| 1451 | # ----------------------------------------------------------------------------- |
---|
| 1452 | # Compile ogg opus libraries |
---|
| 1453 | # ----------------------------------------------------------------------------- |
---|
| 1454 | make_opus() |
---|
| 1455 | { |
---|
| 1456 | echo -e "**\n** opus ...\n**" |
---|
| 1457 | cd $TMP/tmp-$PRGNAM/opus-${OPUS} |
---|
| 1458 | |
---|
| 1459 | CFLAGS="$SLKCFLAGS" \ |
---|
| 1460 | CXXFLAGS="$SLKCFLAGS" \ |
---|
| 1461 | LDFLAGS="$SLKLDFLAGS" \ |
---|
| 1462 | ./configure \ |
---|
| 1463 | --prefix=$FFMPEGDEPSDIR/usr \ |
---|
| 1464 | --libdir=$FFMPEGDEPSDIR/usr/lib${LIBDIRSUFFIX} \ |
---|
| 1465 | --enable-static \ |
---|
| 1466 | --disable-shared \ |
---|
| 1467 | --disable-doc \ |
---|
| 1468 | --program-prefix= \ |
---|
| 1469 | --program-suffix= \ |
---|
| 1470 | --build=$TARGET \ |
---|
| 1471 | 2>&1 |
---|
| 1472 | # Install opus into a temp location so ffmpeg can pickup the library |
---|
| 1473 | make install 2>&1 |
---|
| 1474 | # Add DOCS to the ffmpegdeps to have it added to ffmpeg package later: |
---|
| 1475 | mkdir -p $FFMPEGDEPSDIR/doc/opus/ |
---|
| 1476 | cp $DOCS_OPUS $FFMPEGDEPSDIR/doc/opus/ || true |
---|
| 1477 | cd - |
---|
| 1478 | } |
---|
| 1479 | |
---|
| 1480 | |
---|
| 1481 | # ---------------------------------------------------------------------------- |
---|
| 1482 | # Compile libzvbi, a library that allows ffmpeg to process teletext subtitles |
---|
| 1483 | # ---------------------------------------------------------------------------- |
---|
| 1484 | |
---|
| 1485 | make_zvbi() |
---|
| 1486 | { |
---|
| 1487 | echo -e "**\n** zvbi ...\n**" |
---|
| 1488 | cd $TMP/tmp-$PRGNAM/zvbi-${LIBZVBI} |
---|
| 1489 | CFLAGS="$SLKCFLAGS" \ |
---|
| 1490 | CXXFLAGS="$SLKCFLAGS" \ |
---|
| 1491 | LDFLAGS="$SLKLDFLAGS" \ |
---|
| 1492 | ./configure \ |
---|
| 1493 | --prefix=$FFMPEGDEPSDIR/usr \ |
---|
| 1494 | --libdir=$FFMPEGDEPSDIR/usr/lib${LIBDIRSUFFIX} \ |
---|
| 1495 | --enable-static \ |
---|
| 1496 | --disable-shared \ |
---|
| 1497 | --program-prefix= \ |
---|
| 1498 | --program-suffix= \ |
---|
| 1499 | --build=$TARGET \ |
---|
| 1500 | 2>&1 |
---|
| 1501 | make 2>&1 |
---|
| 1502 | # Install zvbi into a temp location so ffmpeg can pickup the library |
---|
| 1503 | make install 2>&1 |
---|
| 1504 | # Add DOCS to the ffmpegdeps to have it added to ffmpeg package later: |
---|
| 1505 | mkdir -p $FFMPEGDEPSDIR/doc/zvbi/ |
---|
| 1506 | cp $DOCS_LIBZVBI $FFMPEGDEPSDIR/doc/zvbi/ || true |
---|
| 1507 | cd - |
---|
| 1508 | } |
---|
| 1509 | |
---|
| 1510 | |
---|
| 1511 | # ----------------------------------------------------------------------------- |
---|
| 1512 | # Compile ffmpeg with additional support for - |
---|
| 1513 | # LAME (MP3), XVID, AAC (MP4), FAAD2 , SPEEX, X264, GSM, SCHROEDINGER |
---|
| 1514 | # ----------------------------------------------------------------------------- |
---|
| 1515 | make_ffmpeg() |
---|
| 1516 | { |
---|
| 1517 | echo -e "**\n** ffmpeg ...\n**" |
---|
| 1518 | OLDDIR=$(pwd) |
---|
| 1519 | cd $TMP/tmp-$PRGNAM |
---|
| 1520 | # Take care of snaphot directory: |
---|
| 1521 | if [ -d ffmpeg-export-* ]; then |
---|
| 1522 | rm -rf ffmpeg-${VERSION} |
---|
| 1523 | mv ffmpeg-export-* ffmpeg-${VERSION} |
---|
| 1524 | fi |
---|
| 1525 | |
---|
| 1526 | # Only use non-free code if we are allowing it: |
---|
| 1527 | if [ "${USE_PATENTS}" == "YES" ]; then |
---|
| 1528 | USE_NONFREE="--enable-libmp3lame \ |
---|
| 1529 | --enable-libfaac \ |
---|
| 1530 | --enable-libfdk-aac \ |
---|
| 1531 | --enable-openssl \ |
---|
| 1532 | --enable-nonfree" |
---|
| 1533 | # to be added once I get it to work: --enable-libaacplus \ |
---|
| 1534 | else |
---|
| 1535 | USE_NONFREE="--enable-gnutls" |
---|
| 1536 | fi |
---|
| 1537 | |
---|
| 1538 | cd $TMP/tmp-$PRGNAM/ffmpeg-${VERSION} |
---|
| 1539 | |
---|
| 1540 | if [ "$ARCH" = "x86_64" ]; then |
---|
| 1541 | ARCHOPTS="--arch=x86_64 --enable-pic" |
---|
| 1542 | else |
---|
| 1543 | ARCHOPTS="" |
---|
| 1544 | fi |
---|
| 1545 | |
---|
| 1546 | # Fix SDL header location: |
---|
| 1547 | sed -e '/#include/ s,<SDL,<SDL/SDL,' -i ffplay.c |
---|
| 1548 | |
---|
| 1549 | # Or else orc's library will not be used in the static linking (orc is listed |
---|
| 1550 | # as a private lib for schroedinger): |
---|
| 1551 | sed -i -e "s/pkg_config --libs/pkg_config --static --libs/" \ |
---|
| 1552 | configure |
---|
| 1553 | |
---|
| 1554 | # Stamp the version into the source: |
---|
| 1555 | [ -f version.sh ] && sed -i -e "s/UNKNOWN/$VERSION/" version.sh |
---|
| 1556 | |
---|
| 1557 | TMPDIR="$TMP" \ |
---|
| 1558 | CFLAGS="-I$FFMPEGDEPSDIR/usr/include $SLKCFLAGS -I/usr/X11R6/include/" \ |
---|
| 1559 | CPPFLAGS="-I$FFMPEGDEPSDIR/usr/include -I$FFMPEGDEPSDIR/usr/include/SDL -I/usr/X11R6/include/" \ |
---|
| 1560 | CXXFLAGS="-I$FFMPEGDEPSDIR/usr/include -I$FFMPEGDEPSDIR/usr/include/SDL $SLKCFLAGS -I/usr/X11R6/include/" \ |
---|
| 1561 | LDFLAGS="-L$FFMPEGDEPSDIR/usr/lib${LIBDIRSUFFIX} $SLKLDFLAGS -lpng -lXext" \ |
---|
| 1562 | PKG_CONFIG_PATH="$FFMPEGDEPSDIR/usr/lib${LIBDIRSUFFIX}/pkgconfig" \ |
---|
| 1563 | PATH="$FFMPEGDEPSDIR/usr/bin:$PATH" \ |
---|
| 1564 | ./configure \ |
---|
| 1565 | --prefix=/usr \ |
---|
| 1566 | --libdir=/usr/lib${LIBDIRSUFFIX} \ |
---|
| 1567 | --shlibdir=/usr/lib${LIBDIRSUFFIX} \ |
---|
| 1568 | --docdir=/usr/doc/${PRGNAM}-${VERSION} \ |
---|
| 1569 | --mandir=/usr/man \ |
---|
| 1570 | --enable-gpl \ |
---|
| 1571 | --enable-version3 \ |
---|
| 1572 | --enable-avfilter \ |
---|
| 1573 | --enable-avresample \ |
---|
| 1574 | --enable-libass \ |
---|
| 1575 | --enable-libdc1394 \ |
---|
| 1576 | --enable-libgsm \ |
---|
| 1577 | --enable-libopencore-amrnb \ |
---|
| 1578 | --enable-libopencore-amrwb \ |
---|
| 1579 | --enable-libopus \ |
---|
| 1580 | --enable-libschroedinger \ |
---|
| 1581 | --enable-libspeex \ |
---|
| 1582 | --enable-libtheora \ |
---|
| 1583 | --enable-libv4l2 \ |
---|
| 1584 | --enable-libvo-amrwbenc \ |
---|
| 1585 | --enable-libvorbis \ |
---|
| 1586 | --enable-libvpx \ |
---|
| 1587 | --enable-libx264 \ |
---|
| 1588 | --enable-libx265 \ |
---|
| 1589 | --enable-libzvbi \ |
---|
| 1590 | --enable-postproc \ |
---|
| 1591 | --enable-runtime-cpudetect \ |
---|
| 1592 | --enable-vaapi \ |
---|
| 1593 | --enable-vdpau \ |
---|
| 1594 | --enable-memalign-hack \ |
---|
| 1595 | --enable-pthreads \ |
---|
| 1596 | --enable-x11grab \ |
---|
| 1597 | --enable-bzlib \ |
---|
| 1598 | --enable-zlib \ |
---|
| 1599 | --enable-shared \ |
---|
| 1600 | --enable-static \ |
---|
| 1601 | --disable-debug \ |
---|
| 1602 | ${USE_NONFREE} \ |
---|
| 1603 | $ARCHOPTS \ |
---|
| 1604 | --extra-cflags="-I$FFMPEGDEPSDIR/usr/include -I$FFMPEGDEPSDIR/usr/include/SDL -DRUNTIME_CPUDETECT" \ |
---|
| 1605 | --extra-ldflags="-L$FFMPEGDEPSDIR/usr/lib${LIBDIRSUFFIX} -L/usr/X11R6/lib/ -ldl -lssl -lcrypto -lz -lusb" \ |
---|
| 1606 | --pkg-config-flags="--static" \ |
---|
| 1607 | 2>&1 |
---|
| 1608 | # Use ffmpeg's own implementation: |
---|
| 1609 | #--enable-librtmp \ |
---|
| 1610 | # Need to add "-lfftw3f" to --extra-ldflags if libaacplus gets used |
---|
| 1611 | make ${NUMJOBS} 2>&1 |
---|
| 1612 | |
---|
| 1613 | cd $OLDDIR |
---|
| 1614 | } |
---|
| 1615 | |
---|
| 1616 | # |
---|
| 1617 | # OK, we packaged the compile process for the various software libraries |
---|
| 1618 | # into convenient functions... let's call them one by one now: |
---|
| 1619 | # |
---|
| 1620 | |
---|
| 1621 | #if [ 'xy' != 'xy' ]; then # use this block if you want to skip a lot |
---|
| 1622 | |
---|
| 1623 | # Needed before ffmpeg: |
---|
| 1624 | # Based on the value of $USE_PATENTS enable or disable non-free code: |
---|
| 1625 | if [ "${USE_PATENTS}" = "YES" ]; then |
---|
| 1626 | make_lame |
---|
| 1627 | make_faac |
---|
| 1628 | #make_aacplus |
---|
| 1629 | make_fdkaac |
---|
| 1630 | fi |
---|
| 1631 | |
---|
| 1632 | make_amr |
---|
| 1633 | make_amrwbenc |
---|
| 1634 | make_1394 |
---|
| 1635 | make_v4l |
---|
| 1636 | make_opus |
---|
| 1637 | make_speex |
---|
| 1638 | make_gsm |
---|
| 1639 | #make_rtmp |
---|
| 1640 | make_orc |
---|
| 1641 | make_schroedinger |
---|
| 1642 | make_x264 |
---|
| 1643 | make_x265 |
---|
| 1644 | make_vpx |
---|
| 1645 | make_libva |
---|
| 1646 | make_vdpau |
---|
| 1647 | make_fribidi |
---|
| 1648 | make_ass |
---|
| 1649 | make_zvbi |
---|
| 1650 | |
---|
| 1651 | #fi # end of 'xy' |
---|
| 1652 | |
---|
| 1653 | # ffmpeg uses the above static libraries: |
---|
| 1654 | make_ffmpeg |
---|
| 1655 | |
---|
| 1656 | # End of compilation, proceed to packaging the binaries: |
---|
| 1657 | cd $TMP/tmp-${PRGNAM}/ffmpeg-${VERSION} |
---|
| 1658 | |
---|
| 1659 | # Install all the needed stuff to the package dir |
---|
| 1660 | make DESTDIR=$PKG install 2>&1 |tee $OUTPUT/install-${PRGNAM}.log |
---|
| 1661 | |
---|
| 1662 | # Add x264 & vpx presets. See 'Preset files' in the man pages. |
---|
| 1663 | echo "** Adding ffmpeg presets:" |
---|
| 1664 | mkdir -p $PKG/usr/share/ffmpeg |
---|
| 1665 | cp -a presets/*.ffpreset $PKG/usr/share/ffmpeg/ |
---|
| 1666 | |
---|
| 1667 | # The pkg-config files are full of library dependencies which we built |
---|
| 1668 | # statically, so we need to edit those out so that programs that try to link |
---|
| 1669 | # against our ffmpeg will not get confused: |
---|
| 1670 | echo "** Fixing up pkgconfig files:" |
---|
| 1671 | for PCFILE in $(ls $PKG/usr/lib${LIBDIRSUFFIX}/pkgconfig/*.pc) ; do |
---|
| 1672 | sed -i -e 's/-lraw1394//g' -e 's/-lavc1394//g' -e 's/-ldc1394//g' \ |
---|
| 1673 | -e 's/-lspeex//g' -e 's/-lgsm//g' -e 's/-lrtmp//g' \ |
---|
| 1674 | -e 's/-lopencore-amrnb//g' -e 's/-lopencore-amrwb//g' \ |
---|
| 1675 | -e 's/-lfaac//g' -e 's/-lfaad//g' \ |
---|
| 1676 | -e 's/-lvo-amrwbenc//g' -e 's/-lfdk-aac//g' \ |
---|
| 1677 | -e 's/-lmp3lame//g' \ |
---|
| 1678 | -e 's/-lopus//g' \ |
---|
| 1679 | -e 's/-lschroedinger-[^ ]*//g' -e 's/-lorc-[^ ]*//g' \ |
---|
| 1680 | -e 's/-lx264//g' -e 's/-lx265//g' -e 's/-lvpx//g' -e 's/-lzvbi//g' \ |
---|
| 1681 | -e "s#-L/tmp/build/tmp-ffmpeg/ffmpegdeps/usr/lib${LIBDIRSUFFIX}##" \ |
---|
| 1682 | $PCFILE |
---|
| 1683 | done |
---|
| 1684 | |
---|
| 1685 | # Add a configuration file for the ffserver: |
---|
| 1686 | mkdir -p $PKG/etc |
---|
| 1687 | cp -a doc/ffserver.conf $PKG/etc/ffserver.conf.new |
---|
| 1688 | |
---|
| 1689 | # Add this to the doinst.sh: |
---|
| 1690 | ! [ -d $PKG/install ] && mkdir -p $PKG/install |
---|
| 1691 | cat <<EOINS >> $PKG/install/doinst.sh |
---|
| 1692 | # Handle the incoming configuration files: |
---|
| 1693 | config() { |
---|
| 1694 | for infile in \$1; do |
---|
| 1695 | NEW="\$infile" |
---|
| 1696 | OLD="\`dirname \$NEW\`/\`basename \$NEW .new\`" |
---|
| 1697 | # If there's no config file by that name, mv it over: |
---|
| 1698 | if [ ! -r \$OLD ]; then |
---|
| 1699 | mv \$NEW \$OLD |
---|
| 1700 | elif [ "\`cat \$OLD | md5sum\`" = "\`cat \$NEW | md5sum\`" ]; then |
---|
| 1701 | # toss the redundant copy |
---|
| 1702 | rm \$NEW |
---|
| 1703 | fi |
---|
| 1704 | # Otherwise, we leave the .new copy for the admin to consider... |
---|
| 1705 | done |
---|
| 1706 | } |
---|
| 1707 | |
---|
| 1708 | config etc/ffserver.conf.new |
---|
| 1709 | |
---|
| 1710 | EOINS |
---|
| 1711 | |
---|
| 1712 | # Add documentation (for all the deps as well) |
---|
| 1713 | mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION |
---|
| 1714 | cp -a $DOCS $PKG/usr/doc/$PRGNAM-$VERSION || true |
---|
| 1715 | # Add all the supporting packages' documentation too: |
---|
| 1716 | cp -a $FFMPEGDEPSDIR/doc/* $PKG/usr/doc/$PRGNAM-$VERSION || true |
---|
| 1717 | cp -a $SRCDIR/patches $PKG/usr/doc/$PRGNAM-$VERSION/ 2>/dev/null || true |
---|
| 1718 | cat $SRCDIR/$(basename $0) > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild |
---|
| 1719 | find $PKG/usr/doc -type f -exec chmod 644 {} \; |
---|
| 1720 | chown -R root:root $PKG/usr/doc/$PRGNAM-$VERSION/* |
---|
| 1721 | |
---|
| 1722 | # Compress the man page(s) |
---|
| 1723 | if [ -d $PKG/usr/man ]; then |
---|
| 1724 | find $PKG/usr/man -type f -name "*.?" -exec gzip -9f {} \; |
---|
| 1725 | for i in $(find $PKG/usr/man -type l -name "*.?") ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done |
---|
| 1726 | fi |
---|
| 1727 | |
---|
| 1728 | # Strip binaries |
---|
| 1729 | find $PKG | xargs file | grep -e "executable" -e "shared object" \ |
---|
| 1730 | | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null |
---|
| 1731 | |
---|
| 1732 | # Add package description: |
---|
| 1733 | mkdir -p $PKG/install |
---|
| 1734 | cat $SRCDIR/slack-desc > $PKG/install/slack-desc |
---|
| 1735 | if [ -f $SRCDIR/doinst.sh ]; then |
---|
| 1736 | cat $SRCDIR/doinst.sh >> $PKG/install/doinst.sh |
---|
| 1737 | fi |
---|
| 1738 | |
---|
| 1739 | # Build the package: |
---|
| 1740 | cd $PKG |
---|
| 1741 | makepkg --linkadd y --chown n $OUTPUT/${PRGNAM}-${VERSION}-${ARCH}-${BUILD}${TAG}.txz 2>&1 |
---|
| 1742 | cd $OUTPUT |
---|
| 1743 | md5sum ${PRGNAM}-${VERSION}-${ARCH}-${BUILD}${TAG}.txz > ${PRGNAM}-${VERSION}-${ARCH}-${BUILD}${TAG}.txz.md5 |
---|
| 1744 | cd - |
---|
| 1745 | cat $PKG/install/slack-desc | grep "^${PRGNAM}" > $OUTPUT/${PRGNAM}-${VERSION}-${ARCH}-${BUILD}${TAG}.txt |
---|
| 1746 | |
---|
| 1747 | # Restore the original umask: |
---|
| 1748 | umask ${_UMASK_} |
---|
| 1749 | |
---|