[buildout]
extends =
  ../bzip2/buildout.cfg
  ../libpng/buildout.cfg
  ../patch/buildout.cfg
  ../ncurses/buildout.cfg
  ../pkgconfig/buildout.cfg
  ../zlib/buildout.cfg
  ../xorg/buildout.cfg

parts =
  ffmpeg

[ffmpeg]
<= ffmpeg-4.1

[libogg]
recipe = slapos.recipe.cmmi
url = http://downloads.xiph.org/releases/ogg/libogg-1.2.2.tar.gz
md5sum = 5a9fcabc9a1b7c6f1cd75ddc78f36c56
configure-options =
  --disable-static

[libvorbis]
recipe = slapos.recipe.cmmi
url = http://downloads.xiph.org/releases/vorbis/libvorbis-1.3.2.tar.bz2
md5sum = 798a4211221073c1409f26eac4567e8b
configure-options =
  --disable-static
pkg_config_depends = ${libogg:location}/lib/pkgconfig
environment =
  PATH=${pkgconfig:location}/bin:%(PATH)s
  PKG_CONFIG_PATH=${:pkg_config_depends}
  LDFLAGS=-Wl,-rpath=${libogg:location}/lib

[libtheora]
recipe = slapos.recipe.cmmi
url = http://downloads.xiph.org/releases/theora/libtheora-1.1.1.tar.bz2
md5sum = 292ab65cedd5021d6b7ddd117e07cd8e
patches =
  ${:_profile_base_location_}/libtheora-png_sizeof.patch#eaa1454081b50f05b59495a12f52b0d5

patch-options = -p1
configure-options =
  --disable-static
pkg_config_depends = ${libpng:location}/lib/pkgconfig:${libvorbis:location}/lib/pkgconfig:${libvorbis:pkg_config_depends}
environment =
  PATH=${patch:location}/bin:${pkgconfig:location}/bin:%(PATH)s
  PKG_CONFIG_PATH=${:pkg_config_depends}
  LDFLAGS=-Wl,-rpath=${libvorbis:location}/lib

[nasm]
recipe = slapos.recipe.cmmi
url = https://www.nasm.us/pub/nasm/releasebuilds/2.14.02/nasm-2.14.02.tar.bz2
md5sum = 3f489aa48ad2aa1f967dc5e293bbd06f

[yasm]
recipe = slapos.recipe.cmmi
shared = true
url = http://www.tortall.net/projects/yasm/releases/yasm-1.1.0.tar.gz

[libvpx]
recipe = slapos.recipe.cmmi
url = https://storage.googleapis.com/downloads.webmproject.org/releases/webm/libvpx-1.5.0.tar.bz2
md5sum = 49e59dd184caa255886683facea56fca
location = @@LOCATION@@
configure-options =
  --enable-shared
environment =
  PATH=${yasm:location}/bin:%(PATH)s
  LDFLAGS=-Wl,-rpath=${:location}/lib

[libx264]
recipe = slapos.recipe.cmmi
url = ftp://ftp.videolan.org/pub/videolan/x264/snapshots/x264-snapshot-20190214-2245.tar.bz2
md5sum = 37109ae11d37e4a8963954b53041d43a
configure-options =
  --enable-shared
  --enable-pic
environment =
  PATH=${yasm:location}/bin:${nasm:location}/bin:%(PATH)s

[lame]
recipe = slapos.recipe.cmmi
url = http://prdownloads.sourceforge.net/lame/lame-3.98.4.tar.gz
md5sum = 8e9866ad6b570c6c95c8cba48060473f
configure-options =
  --disable-static
  --disable-gtktest
environment =
  PKG_CONFIG=${pkgconfig:location}/bin/pkgconfig
  PKG_CONFIG_PATH=${ncurses:location}/lib/pkgconfig
  LDFLAGS=-Wl,-rpath=${ncurses:location}/lib

[opencore-amr]
recipe = slapos.recipe.cmmi
url = http://prdownloads.sourceforge.net/opencore-amr/opencore-amr/opencore-amr-0.1.2.tar.gz
md5sum = 8e8b8b253eb046340ff7b6bf7a6ccd3e
configure-options =
  --disable-static

[ffmpeg-4.1]
recipe = slapos.recipe.cmmi
url = https://ffmpeg.org/releases/ffmpeg-4.1.4.tar.bz2
md5sum = 611d171e4aee749b85e04d17e2aee71d
location = @@LOCATION@@
pkg_config_depends = ${libxcb:location}/lib/pkgconfig:${libxcb:pkg_config_depends}:${libtheora:location}/lib/pkgconfig:${libtheora:pkg_config_depends}:${libvpx:location}/lib/pkgconfig:${libx264:location}/lib/pkgconfig:${opencore-amr:location}/lib/pkgconfig:${zlib:location}/lib/pkgconfig
configure-options =
 --enable-gpl
 --enable-version3
 --enable-postproc
 --enable-bzlib
 --enable-libtheora
 --enable-libvorbis
 --enable-libvpx
 --enable-libx264
 --enable-libmp3lame
 --enable-libopencore-amrnb
 --enable-libopencore-amrwb
 --enable-shared
 --enable-zlib
 --enable-libxcb
 --enable-libxcb-shm
 --enable-libxcb-xfixes
 --enable-libxcb-shape
 --disable-static
environment =
  PKG_CONFIG_PATH=${:pkg_config_depends}
  CPPFLAGS=-I${bzip2:location}/include -I${libogg:location}/include -I${libtheora:location}/include -I${opencore-amr:location}/include -I${lame:location}/include
  LDFLAGS=-Wl,-rpath=${:location}/lib -L${bzip2:location}/lib -Wl,-rpath=${bzip2:location}/lib -Wl,-rpath=${libxcb:location}/lib -L${libogg:location}/lib -L${libvorbis:location}/lib -Wl,-rpath=${libvorbis:location}/lib -L${libtheora:location}/lib -Wl,-rpath=${libtheora:location}/lib -L${libvpx:location}/lib -Wl,-rpath=${libvpx:location}/lib -L${libx264:location}/lib -Wl,-rpath=${libx264:location}/lib -L${lame:location}/lib -Wl,-rpath=${lame:location}/lib -L${opencore-amr:location}/lib -Wl,-rpath=${opencore-amr:location}/lib -Wl,-rpath=${zlib:location}/lib
  PATH=${pkgconfig:location}/bin:${yasm:location}/bin:%(PATH)s
