]> git.sesse.net Git - casparcg/commitdiff
[build] Added the modified build script based on an old version of https://github...
authorHelge Norberg <helge.norberg@svt.se>
Fri, 27 Jan 2017 18:43:29 +0000 (19:43 +0100)
committerHelge Norberg <helge.norberg@svt.se>
Fri, 27 Jan 2017 18:43:29 +0000 (19:43 +0100)
dependencies64/ffmpeg/ffmpeg-build-linux/.gitignore [new file with mode: 0644]
dependencies64/ffmpeg/ffmpeg-build-linux/LICENSE [new file with mode: 0644]
dependencies64/ffmpeg/ffmpeg-build-linux/README.md [new file with mode: 0644]
dependencies64/ffmpeg/ffmpeg-build-linux/build-ubuntu.sh [new file with mode: 0755]
dependencies64/ffmpeg/ffmpeg-build-linux/build.sh [new file with mode: 0755]
dependencies64/ffmpeg/ffmpeg-build-linux/env.source [new file with mode: 0644]
dependencies64/ffmpeg/ffmpeg-build-linux/fetchurl [new file with mode: 0755]

diff --git a/dependencies64/ffmpeg/ffmpeg-build-linux/.gitignore b/dependencies64/ffmpeg/ffmpeg-build-linux/.gitignore
new file mode 100644 (file)
index 0000000..237ede1
--- /dev/null
@@ -0,0 +1,2 @@
+build/
+target/
diff --git a/dependencies64/ffmpeg/ffmpeg-build-linux/LICENSE b/dependencies64/ffmpeg/ffmpeg-build-linux/LICENSE
new file mode 100644 (file)
index 0000000..5b69cfd
--- /dev/null
@@ -0,0 +1,14 @@
+Copyright (c) 2010(s), zimbatm and contributors.
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
+REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
+INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+PERFORMANCE OF THIS SOFTWARE.
+
diff --git a/dependencies64/ffmpeg/ffmpeg-build-linux/README.md b/dependencies64/ffmpeg/ffmpeg-build-linux/README.md
new file mode 100644 (file)
index 0000000..b2835ba
--- /dev/null
@@ -0,0 +1,67 @@
+FFmpeg static build
+===================
+
+Three scripts to make a static build of ffmpeg with all the latest codecs (webm + h264).
+
+Just follow the instructions below. Once you have the build dependencies,
+just run ./build.sh, wait and you should get the ffmpeg binary in target/bin
+
+Build dependencies
+------------------
+
+    # Debian & Ubuntu
+    $ apt-get install build-essential curl tar
+
+       # OS X
+       # install XCode, it can be found at http://developer.apple.com/
+       # (apple login needed)
+       # <FIXME???>
+
+Build & "install"
+-----------------
+
+    $ ./build.sh or build-ubuntu.sh
+    # ... wait ...
+    # binaries can be found in ./target/bin/
+
+NOTE: If you're going to use the h264 presets, make sure to copy them along the binaries. For ease, you can put them in your home folder like this:
+
+    $ mkdir ~/.ffmpeg
+    $ cp ./target/share/ffmpeg/*.ffpreset ~/.ffmpeg
+
+Debug
+-----
+
+On the top-level of the project, run:
+
+       $ . env.source
+       
+You can then enter the source folders and make the compilation yourself
+
+       $ cd build/ffmpeg-*
+       $ ./configure --prefix=$TARGET_DIR #...
+       # ...
+
+Remaining links
+---------------
+
+I'm not sure it's a good idea to statically link those, but it probably
+means the executable won't work across distributions or even across releases.
+
+    # On Ubuntu 10.04:
+    $ ldd ./target/bin/ffmpeg 
+       not a dynamic executable
+
+    # on OSX 10.6.4:
+    $ otool -L ffmpeg 
+       ffmpeg:
+               /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.2.0)
+
+TODO
+----
+
+ * Add some tests to check that video output is correctly generated
+   this would help upgrading the package without too much work
+ * OSX's xvidcore does not detect yasm correctly
+ * remove remaining libs
diff --git a/dependencies64/ffmpeg/ffmpeg-build-linux/build-ubuntu.sh b/dependencies64/ffmpeg/ffmpeg-build-linux/build-ubuntu.sh
new file mode 100755 (executable)
index 0000000..83e9ed5
--- /dev/null
@@ -0,0 +1,5 @@
+#!/bin/bash
+
+sudo apt-get install build-essential curl tar pkg-config
+
+./build.sh
diff --git a/dependencies64/ffmpeg/ffmpeg-build-linux/build.sh b/dependencies64/ffmpeg/ffmpeg-build-linux/build.sh
new file mode 100755 (executable)
index 0000000..cf40d27
--- /dev/null
@@ -0,0 +1,450 @@
+#!/bin/sh
+
+set -e
+set -u
+
+jflag=
+jval=2
+
+while getopts 'j:' OPTION
+do
+  case $OPTION in
+  j)   jflag=1
+               jval="$OPTARG"
+               ;;
+  ?)   printf "Usage: %s: [-j concurrency_level] (hint: your cores + 20%%)\n" $(basename $0) >&2
+               exit 2
+               ;;
+  esac
+done
+shift $(($OPTIND - 1))
+
+if [ "$jflag" ]
+then
+  if [ "$jval" ]
+  then
+    printf "Option -j specified (%d)\n" $jval
+  fi
+fi
+
+cd `dirname $0`
+ENV_ROOT=`pwd`
+. ./env.source
+
+rm -rf "$BUILD_DIR" "$TARGET_DIR"
+mkdir -p "$BUILD_DIR" "$TARGET_DIR"
+
+# NOTE: this is a fetchurl parameter, nothing to do with the current script
+#export TARGET_DIR_DIR="$BUILD_DIR"
+
+echo "#### FFmpeg static build, by STVS SA ####"
+cd $BUILD_DIR
+../fetchurl "http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz"
+../fetchurl "http://zlib.net/zlib-1.2.8.tar.gz"
+../fetchurl "http://www.bzip.org/1.0.6/bzip2-1.0.6.tar.gz"
+#../fetchurl "http://downloads.sf.net/project/libpng/libpng15/older-releases/1.5.14/libpng-1.5.14.tar.gz"
+../fetchurl "http://downloads.xiph.org/releases/ogg/libogg-1.3.2.tar.gz"
+../fetchurl "http://downloads.xiph.org/releases/vorbis/libvorbis-1.3.5.tar.gz"
+../fetchurl "http://downloads.xiph.org/releases/theora/libtheora-1.1.1.tar.bz2"
+../fetchurl "http://storage.googleapis.com/downloads.webmproject.org/releases/webm/libvpx-1.4.0.tar.bz2"
+#../fetchurl "http://downloads.sourceforge.net/project/faac/faac-src/faac-1.28/faac-1.28.tar.bz2"
+../fetchurl "ftp://ftp.videolan.org/pub/x264/snapshots/last_x264.tar.bz2"
+../fetchurl "http://downloads.xvid.org/downloads/xvidcore-1.3.3.tar.gz"
+../fetchurl "http://downloads.sourceforge.net/project/lame/lame/3.99/lame-3.99.5.tar.gz"
+../fetchurl "http://downloads.xiph.org/releases/opus/opus-1.1.tar.gz"
+../fetchurl "http://www.freedesktop.org/software/fontconfig/release/fontconfig-2.11.94.tar.bz2"
+../fetchurl "http://www.ffmpeg.org/releases/ffmpeg-2.7.tar.bz2"
+../fetchurl "http://downloads.sourceforge.net/project/expat/expat/2.1.0/expat-2.1.0.tar.gz"
+../fetchurl "ftp://ftp.gnutls.org/gcrypt/gnutls/v3.3/gnutls-3.3.15.tar.xz"
+../fetchurl "https://ftp.gnu.org/gnu/nettle/nettle-2.7.1.tar.gz"
+../fetchurl "https://gmplib.org/download/gmp/gmp-6.0.0a.tar.xz"
+../fetchurl "https://github.com/libass/libass/archive/0.12.2.tar.gz"
+../fetchurl "http://fribidi.org/download/fribidi-0.19.6.tar.bz2"
+../fetchurl "ftp://ftp.videolan.org/pub/videolan/libbluray/0.8.1/libbluray-0.8.1.tar.bz2"
+../fetchurl "http://tukaani.org/xz/xz-5.2.1.tar.xz"
+../fetchurl "http://pkgs.fedoraproject.org/lookaside/pkgs/libgme/game-music-emu-0.6.0.tar.bz2/b98fafb737bc889dc65e7a8b94bd1bf5/game-music-emu-0.6.0.tar.bz2"
+../fetchurl "http://ffmpeg.zeranoe.com/builds/source/external_libraries/libilbc-20141214-git-ef04ebe.tar.xz"
+../fetchurl "http://downloads.sourceforge.net/project/modplug-xmms/libmodplug/0.8.8.5/libmodplug-0.8.8.5.tar.gz?r=&ts=1440421934&use_mirror=vorboss"
+../fetchurl "http://downloads.sourceforge.net/project/opencore-amr/opencore-amr/opencore-amr-0.1.3.tar.gz"
+../fetchurl "http://rtmpdump.mplayerhq.hu/download/rtmpdump-2.3.tgz"
+../fetchurl "https://www.openssl.org/source/old/1.0.2/openssl-1.0.2a.tar.gz"
+../fetchurl "http://downloads.sourceforge.net/project/soxr/soxr-0.1.1-Source.tar.xz"
+../fetchurl "https://github.com/georgmartius/vid.stab/archive/release-0.98.tar.gz"
+../fetchurl "http://download.savannah.gnu.org/releases/freetype/freetype-2.5.5.tar.bz2"
+../fetchurl "http://ffmpeg.zeranoe.com/builds/source/external_libraries/libgsm-1.0.13-4.tar.xz"
+../fetchurl "http://ffmpeg.zeranoe.com/builds/source/external_libraries/openjpeg-1.5.2.tar.xz"
+../fetchurl "http://pkgs.fedoraproject.org/lookaside/pkgs/orc/orc-0.4.18.tar.gz/1a2552e8d127526c48d644fe6437b377/orc-0.4.18.tar.gz"
+../fetchurl "http://ftp.cs.stanford.edu/pub/exim/pcre/pcre-8.36.tar.bz2"
+../fetchurl "http://78.108.103.11/MIRROR/ftp/png/src/history/libpng12/libpng-1.2.53.tar.bz2"
+../fetchurl "http://ffmpeg.zeranoe.com/builds/source/external_libraries/schroedinger-1.0.11.tar.xz"
+../fetchurl "http://ffmpeg.zeranoe.com/builds/source/external_libraries/speex-1.2rc2.tar.xz"
+../fetchurl "http://ftp.gnu.org/gnu/libtasn1/libtasn1-4.5.tar.gz"
+../fetchurl "http://ffmpeg.zeranoe.com/builds/source/external_libraries/twolame-0.3.13.tar.xz"
+../fetchurl "http://www.freedesktop.org/software/vaapi/releases/libva/libva-1.5.1.tar.bz2"
+../fetchurl "http://ffmpeg.zeranoe.com/builds/source/external_libraries/vo-aacenc-0.1.3.tar.xz"
+../fetchurl "http://ffmpeg.zeranoe.com/builds/source/external_libraries/vo-amrwbenc-0.1.2.tar.xz"
+../fetchurl "http://ffmpeg.zeranoe.com/builds/source/external_libraries/wavpack-4.75.0.tar.xz"
+../fetchurl "http://ffmpeg.zeranoe.com/builds/source/external_libraries/libwebp-0.4.3.tar.xz"
+../fetchurl "http://ffmpeg.zeranoe.com/builds/source/external_libraries/x265-1.7.tar.xz"
+../fetchurl "ftp://xmlsoft.org/libxml2/libxml2-2.9.2.tar.gz"
+
+echo "*** Building libxml2 ***"
+cd $BUILD_DIR/libxml2*
+./configure --prefix=$TARGET_DIR --enable-shared
+make -j $jval
+make install || echo "Make install failed, continuing"
+
+echo "*** Building x265 ***"
+cd $BUILD_DIR/x265*/source
+cmake .
+make -j $jval
+make DESTDIR=$TARGET_DIR install
+
+echo "*** Building libwebp ***"
+cd $BUILD_DIR/libwebp*
+./configure --prefix=$TARGET_DIR --enable-shared --enable-mmx
+make -j $jval
+make install
+
+echo "*** Building wavpack ***"
+cd $BUILD_DIR/wavpack*
+./configure --prefix=$TARGET_DIR --enable-shared --enable-mmx
+make -j $jval
+make install
+
+echo "*** Building vo-amrwbenc ***"
+cd $BUILD_DIR/vo-amrwbenc*
+./configure --prefix=$TARGET_DIR --enable-shared
+make -j $jval
+make install
+
+echo "*** Building vo-aacenc ***"
+cd $BUILD_DIR/vo-aacenc*
+./configure --prefix=$TARGET_DIR --enable-shared
+make -j $jval
+make install
+
+echo "*** Building libva ***"
+cd $BUILD_DIR/libva*
+./configure --prefix=$TARGET_DIR --enable-shared --enable-drm=no --enable-glx=no --enable-egl=no --enable-wayland=no
+make -j $jval
+make install
+
+echo "*** Building twolame ***"
+cd $BUILD_DIR/twolame*
+./configure --prefix=$TARGET_DIR --enable-shared
+make -j $jval
+make install
+
+echo "*** Building libtasn1 ***"
+cd $BUILD_DIR/libtasn1*
+./configure --prefix=$TARGET_DIR --enable-shared
+make -j $jval
+make install
+
+echo "*** Building speex ***"
+cd $BUILD_DIR/speex*
+./configure --prefix=$TARGET_DIR --enable-shared
+make -j $jval
+make install
+
+echo "*** Building orc ***"
+cd $BUILD_DIR/orc*
+./configure --prefix=$TARGET_DIR --enable-shared
+make -j $jval
+make install
+
+echo "*** Building schroedinger ***"
+cd $BUILD_DIR/schroedinger*
+./configure --prefix=$TARGET_DIR --enable-shared
+make -j $jval
+make install
+
+echo "*** Building libpng ***"
+cd $BUILD_DIR/libpng*
+./configure --prefix=$TARGET_DIR --enable-shared
+make -j $jval
+make install
+
+echo "*** Building pcre ***"
+cd $BUILD_DIR/pcre*
+./configure --prefix=$TARGET_DIR --enable-shared
+make -j $jval
+make install
+
+echo "*** Building openjpeg ***"
+cd $BUILD_DIR/openjpeg*
+./bootstrap.sh
+./configure --prefix=$TARGET_DIR --enable-shared
+make -j $jval
+make install
+
+echo "*** Building freetype ***"
+cd $BUILD_DIR/freetype*
+./configure --prefix=$TARGET_DIR --enable-shared --with-harfbuzz=no
+make -j $jval
+make install
+
+echo "*** Building libgsm ***"
+cd $BUILD_DIR/libgsm*
+sed -i "s#INSTALL_ROOT =#INSTALL_ROOT  = $TARGET_DIR#g" $BUILD_DIR/libgsm*/Makefile
+sed -i 's#NeedFunctionPrototypes=1#NeedFunctionPrototypes=1 -fPIC#g' $BUILD_DIR/libgsm*/Makefile
+sed -i 's#(GSM_INSTALL_ROOT)/inc#(GSM_INSTALL_ROOT)/include#g' $BUILD_DIR/libgsm*/Makefile
+make -j $jval
+make -j lib/libgsm.so
+make install prefix=$TARGET_DIR
+cp lib/libgsm.so* $TARGET_DIR/lib/
+
+echo "*** Building xavs ***"
+cd $BUILD_DIR/
+svn checkout http://svn.code.sf.net/p/xavs/code/trunk xavs-code
+cd xavs-code
+./configure --prefix=$TARGET_DIR --enable-shared --disable-asm
+make -j $jval
+make install
+
+echo "*** Building vid.stab ***"
+cd $BUILD_DIR/vid.stab*
+cmake .
+make -j $jval
+make DESTDIR=$TARGET_DIR install
+
+echo "*** Building soxr ***"
+cd $BUILD_DIR/soxr*
+cmake -DWITH_OPENMP=off .
+make -j $jval
+make DESTDIR=$TARGET_DIR install
+
+echo "*** Building openssl ***"
+cd $BUILD_DIR/openssl*
+./config --prefix=$TARGET_DIR shared
+make
+make install
+
+echo "*** Building rtmpdump ***"
+cd $BUILD_DIR/rtmpdump*
+sed -i 's#LIB_OPENSSL=-lssl -lcrypto#LIB_OPENSSL=-lssl -lcrypto -ldl#g' $BUILD_DIR/rtmpdump*/Makefile
+make INC=-I$TARGET_DIR/include LDFLAGS=-L$TARGET_DIR/lib  -j $jval SYS=posix
+make install prefix=$TARGET_DIR
+
+echo "*** Building opencore-amr ***"
+cd $BUILD_DIR/opencore-amr*
+./configure --prefix=$TARGET_DIR --enable-shared
+make -j $jval
+make install
+
+echo "*** Building libmodplug ***"
+cd $BUILD_DIR/libmodplug*
+./configure --prefix=$TARGET_DIR --enable-shared
+make -j $jval
+make install
+
+echo "*** Building libilbc ***"
+cd $BUILD_DIR/libilbc*
+./configure --prefix=$TARGET_DIR --enable-shared
+make -j $jval
+make install
+
+echo "*** Building game-music-emu ***"
+cd $BUILD_DIR/game-music-emu*
+cmake .
+make -j $jval
+make DESTDIR=$TARGET_DIR install
+
+echo "*** Building xz ***"
+cd $BUILD_DIR/xz*
+./configure --prefix=$TARGET_DIR --enable-shared
+make -j $jval
+make install
+
+echo "*** Building libbluray ***"
+cd $BUILD_DIR/libbluray*
+./configure --prefix=$TARGET_DIR --enable-shared
+make -j $jval
+make install
+sed -i 's#Libs.private: -ldl -lxml2   -lfreetype#Libs.private: -ldl -lxml2   -lfreetype -llzma#g' $TARGET_DIR/lib/pkgconfig/libbluray.pc
+
+echo "*** Building fribidi ***"
+cd $BUILD_DIR/fribidi*
+./configure --prefix=$TARGET_DIR --enable-shared
+make -j $jval
+make install
+
+echo "*** Building libass ***"
+cd $BUILD_DIR/libass*
+./autogen.sh
+./configure --prefix=$TARGET_DIR --enable-shared --disable-harfbuzz --disable-enca
+make -j $jval
+make install
+
+echo "*** Building expat ***"
+cd $BUILD_DIR/expat*
+./configure --prefix=$TARGET_DIR --enable-shared
+make -j $jval
+make install
+
+echo "*** Building fontconfig ***"
+cd $BUILD_DIR/fontconfig*
+./configure --prefix=$TARGET_DIR --enable-shared
+make -j $jval
+make install
+
+echo "*** Building gmp ***"
+cd $BUILD_DIR/gmp*
+./configure --prefix=$TARGET_DIR --enable-shared
+make -j $jval
+make install
+
+echo "*** Building nettle ***"
+cd $BUILD_DIR/nettle*
+sed -i 's#testsuite##g' Makefile.in
+sed -i 's#examples##g' Makefile.in
+./configure --prefix=$TARGET_DIR --enable-shared --enable-mini-gmp
+make -j $jval
+make install
+
+echo "*** Building gnutls ***"
+cd $BUILD_DIR/gnutls*
+./configure --prefix=$TARGET_DIR --enable-shared --disable-doc --without-p11-kit --disable-libdane --disable-cxx
+make -j $jval
+make install
+
+echo "*** Building yasm ***"
+cd $BUILD_DIR/yasm*
+./configure --prefix=$TARGET_DIR
+make -j $jval
+make install
+
+echo "*** Building zlib ***"
+cd $BUILD_DIR/zlib*
+./configure --prefix=$TARGET_DIR --enable-shared
+make -j $jval
+make install
+
+echo "*** Building bzip2 ***"
+cd $BUILD_DIR/bzip2*
+make -f Makefile-libbz2_so
+make install PREFIX=$TARGET_DIR
+
+#echo "*** Building libpng ***"
+#cd $BUILD_DIR/libpng*
+#./configure --prefix=$TARGET_DIR --enable-static --disable-shared
+#make -j $jval
+#make install
+
+# Ogg before vorbis
+echo "*** Building libogg ***"
+cd $BUILD_DIR/libogg*
+./configure --prefix=$TARGET_DIR --enable-shared
+make -j $jval
+make install
+
+# Vorbis before theora
+echo "*** Building libvorbis ***"
+cd $BUILD_DIR/libvorbis*
+./configure --prefix=$TARGET_DIR --enable-shared
+make -j $jval
+make install
+
+echo "*** Building libtheora ***"
+cd $BUILD_DIR/libtheora*
+./configure --prefix=$TARGET_DIR --enable-shared
+make -j $jval
+make install
+
+echo "*** Building livpx ***"
+cd $BUILD_DIR/libvpx*
+./configure --prefix=$TARGET_DIR --enable-shared
+make -j $jval
+make install
+
+#echo "*** Building faac ***"
+#cd $BUILD_DIR/faac*
+#./configure --prefix=$TARGET_DIR --enable-static --disable-shared
+# FIXME: gcc incompatibility, does not work with log()
+
+#sed -i -e "s|^char \*strcasestr.*|//\0|" common/mp4v2/mpeg4ip.h
+#make -j $jval
+#make install
+
+echo "*** Building x264 ***"
+cd $BUILD_DIR/x264*
+./configure --prefix=$TARGET_DIR --enable-shared --disable-opencl
+make -j $jval
+make install
+
+echo "*** Building xvidcore ***"
+cd "$BUILD_DIR/xvidcore/build/generic"
+./configure --prefix=$TARGET_DIR --enable-shared
+make -j $jval
+make install
+#rm $TARGET_DIR/lib/libxvidcore.so.*
+
+echo "*** Building lame ***"
+cd $BUILD_DIR/lame*
+./configure --prefix=$TARGET_DIR --enable-shared
+make -j $jval
+make install
+
+echo "*** Building opus ***"
+cd $BUILD_DIR/opus*
+./configure --prefix=$TARGET_DIR --enable-shared
+make -j $jval
+make install
+
+rm -f $TARGET_DIR/lib/*.a
+rm -f $TARGET_DIR/usr/local/lib/*.a
+
+# FFMpeg
+echo "*** Building FFmpeg ***"
+cd $BUILD_DIR/ffmpeg*
+CFLAGS="-I$TARGET_DIR/include -I$TARGET_DIR/usr/local/include" LDFLAGS="-L$TARGET_DIR/lib -L$TARGET_DIR/usr/local/lib -lm" PKG_CONFIG_PATH=$TARGET_DIR/lib/pkgconfig:$TARGET_DIR/usr/local/lib/pkgconfig ./configure \
+       --prefix=${OUTPUT_DIR:-$TARGET_DIR} \
+       --extra-cflags="-I$TARGET_DIR/include -fexceptions -fnon-call-exceptions -fPIC" \
+       --extra-ldflags="-L$TARGET_DIR/lib -lm -llzma" \
+       --disable-doc \
+       --disable-ffplay \
+       --disable-ffserver \
+       --disable-stripping \
+       --enable-shared \
+       --enable-avisynth \
+       --enable-bzlib \
+       --enable-fontconfig \
+       --enable-frei0r \
+       --enable-gnutls \
+       --enable-gpl \
+       --enable-iconv \
+       --enable-libass \
+       --enable-libbluray \
+       --enable-libfreetype \
+       --enable-libgme \
+       --enable-libgsm \
+       --enable-libilbc \
+       --enable-libmodplug \
+       --enable-libmp3lame \
+       --enable-libopencore-amrnb \
+       --enable-libopencore-amrwb \
+       --enable-libopenjpeg \
+       --enable-libopus \
+       --enable-librtmp \
+       --enable-libschroedinger \
+       --enable-libsoxr \
+       --enable-libspeex \
+       --enable-libtheora \
+       --enable-libtwolame \
+       --enable-libvidstab \
+       --enable-libvo-aacenc \
+       --enable-libvo-amrwbenc \
+       --enable-libvorbis \
+       --enable-libvpx \
+       --enable-libwavpack \
+       --enable-libwebp \
+       --enable-libx264 \
+       --enable-libx265 \
+       --enable-libxavs \
+       --enable-libxvid \
+       --enable-pthreads \
+       --enable-version3 \
+       --enable-libv4l2 \
+       --enable-zlib
+make -j $jval && make install
diff --git a/dependencies64/ffmpeg/ffmpeg-build-linux/env.source b/dependencies64/ffmpeg/ffmpeg-build-linux/env.source
new file mode 100644 (file)
index 0000000..b08d880
--- /dev/null
@@ -0,0 +1,28 @@
+# Source this shell script to get the same environment as the build script
+
+if [ -z "$ENV_ROOT" ]; then
+  if [ -f "./env.source" ]; then
+    ENV_ROOT=`pwd`
+    export ENV_ROOT
+  fi
+fi
+
+if [ -z "$ENV_ROOT" ]; then
+  echo "Missing ENV_ROOT variable" >&2
+elif [ "${ENV_ROOT#/}" = "$ENV_ROOT" ]; then
+  echo "ENV_ROOT must be an absolute path" >&2
+else
+
+  BUILD_DIR="${BUILD_DIR:-$ENV_ROOT/build}"
+  TARGET_DIR="${TARGET_DIR:-$ENV_ROOT/target}"
+
+  export LDFLAGS="-L${TARGET_DIR}/lib"
+  # FIXME: detect OS somehow
+  export DYLD_LIBRARY_PATH="${TARGET_DIR}/lib"
+  export PKG_CONFIG_PATH="$TARGET_DIR/lib/pkgconfig:$TARGET_DIR/lib64/pkgconfig:$TARGET_DIR/usr/local/lib/pkgconfig"
+  #export CFLAGS="-I${TARGET_DIR}/include $LDFLAGS -static-libgcc -Wl,-Bstatic -lc"
+  export CFLAGS="-I${TARGET_DIR}/include $LDFLAGS"
+  export PATH="${TARGET_DIR}/bin:${PATH}"
+  # Force PATH cache clearing
+  hash -r
+fi
diff --git a/dependencies64/ffmpeg/ffmpeg-build-linux/fetchurl b/dependencies64/ffmpeg/ffmpeg-build-linux/fetchurl
new file mode 100755 (executable)
index 0000000..da6d8e3
--- /dev/null
@@ -0,0 +1,123 @@
+#!/bin/sh
+#
+# Small utility to fetch and unpack archives on the web (with cache)
+#
+# Depends on : curl, tar
+#
+
+set -e
+set +u
+
+# ENV vars, inherited from external
+CACHE=${CACHE:-1}
+UNPACK=${UNPACK:-1}
+VERBOSE=${VERBOSE:-0}
+
+EXTRACT_DIR=${EXTRACT_DIR:-`pwd`}
+if [ -n "$HOME" ]; then
+  CACHE_DIR=${CACHE_DIR:-$HOME/.cache/fetchurl}
+else
+  CACHE_DIR=${CACHE_DIR:-}
+fi
+TMP_DIR=${TMP_DIR:-/tmp}
+
+URL=$1
+
+set -u
+
+stderr () {
+  echo $@ 1>&2
+}
+
+sh () {
+  echo $ $@
+  if [ "$VERBOSE" -ne 0 ]; then
+    $@
+  else
+    $@ >/dev/null 2>&1
+  fi
+}
+
+expand_path() {
+       here=`pwd`
+       cd $1
+       echo `pwd -P`
+       cd "$here"
+}
+
+usage() {
+  echo "Usage: fetchurl url"
+  echo "CACHE=${CACHE}"
+  echo "UNPACK=${UNPACK}"
+  echo "VERBOSE=${VERBOSE}"
+
+  echo "EXTRACT_DIR=${EXTRACT_DIR}"
+  echo "CACHE_DIR=${CACHE_DIR}"
+  echo "TMP_DIR=${TMP_DIR}"
+
+  echo "URL=${URL}"
+  exit 1
+}
+
+if [ -z "$URL" ]; then
+  stderr "ERROR: missing url"
+  usage
+fi
+
+if [ -z "$CACHE_DIR" ] && [ "$CACHE" -ne 0 ]; then
+  stderr "ERROR: missing cache dir"
+  usage
+fi
+
+filename=`basename "$URL" | sed 's/\?.*//'`
+tmp_file="$TMP_DIR/$filename"
+cache_file="$CACHE_DIR/$filename"
+
+mkdir -p "$CACHE_DIR"
+
+# Fetch
+if [ "$CACHE" -eq 0 ] || [ ! -f "$cache_file" ]; then
+  rm -rf "$tmp_file"
+  sh curl -L -o "$tmp_file" "$URL"
+  sh mv "$tmp_file" "$cache_file"
+fi
+
+# TODO: checksums
+
+# Unpack
+if [ "$UNPACK" -ne 0 ]; then
+
+  if [ "$filename" != "${filename%.tar.gz}" ]; then
+    extname=.tar.gz
+  elif [ "$filename" != "${filename%.tgz}" ]; then
+    extname=.tgz
+  elif [ "$filename" != "${filename%.tar.bz2}" ]; then
+    extname=.tar.bz2
+  elif [ "$filename" != "${filename%.tar.xz}" ]; then
+    extname=.tar.xz
+  else
+    stderr extension of $filename is not supported
+    exit 1
+  fi
+
+  target_dir=`expand_path "$EXTRACT_DIR"`
+  mkdir -p "$target_dir"
+  sh cd "$target_dir"
+  
+  case "$extname" in
+    .tar.gz|.tgz)    
+      sh tar xzvf "$cache_file"
+    ;;
+    .tar.bz2)
+      sh tar xjvf "$cache_file"
+    ;;
+    .tar.xz)
+      sh tar xJvf "$cache_file"
+    ;;
+    *)
+      stderr BUG, this should not happen
+      exit 1
+    ;;
+  esac
+fi
+