# This file is part of MXE.
# See index.html for further information.
PKG := ffmpeg
$(PKG)_IGNORE :=
$(PKG)_VERSION := 2.8.2
$(PKG)_CHECKSUM := 830ec647f7ad774fc0caf17ba47774bf5dee7a89cbd65894f364a87ba3ad21b2
$(PKG)_SUBDIR := $(PKG)-$($(PKG)_VERSION)
$(PKG)_FILE := $(PKG)-$($(PKG)_VERSION).tar.bz2
$(PKG)_URL := http://www.ffmpeg.org/releases/$($(PKG)_FILE)
$(PKG)_URL_2 := http://launchpad.net/ffmpeg/$(call SHORT_PKG_VERSION,$(PKG))/$($(PKG)_VERSION)/+download/$($(PKG)_FILE)
$(PKG)_DEPS := gcc bzip2 gnutls lame libass libbluray libbs2b libcaca \
libvpx opencore-amr opus sdl speex theora vidstab \
vo-aacenc vo-amrwbenc vorbis x264 xvidcore yasm zlib
# DO NOT ADD fdk-aac OR openssl SUPPORT.
# Although they are free softwares, their licenses are not compatible with
# the GPL, and we'd like to enable GPL in our default ffmpeg build.
# See index.html#potential-legal-issues
define $(PKG)_UPDATE
$(WGET) -q -O- 'http://ffmpeg.org/releases/' | \
$(SED) -n 's,.*ffmpeg-\([0-9][^>]*\)\.tar.*,\1,p' | \
grep -v 'alpha\|beta\|rc\|git' | \
$(SORT) -Vr | \
head -1
endef
define $(PKG)_BUILD
cd '$(1)' && ./configure \
--cross-prefix='$(TARGET)'- \
--enable-cross-compile \
--arch=$(firstword $(subst -, ,$(TARGET))) \
--target-os=mingw32 \
--prefix='$(PREFIX)/$(TARGET)' \
$(if $(BUILD_STATIC), \
--enable-static --disable-shared , \
--disable-static --enable-shared ) \
--yasmexe='$(TARGET)-yasm' \
--disable-debug \
--enable-memalign-hack \
--disable-pthreads \
--enable-w32threads \
--disable-doc \
--enable-avresample \
--enable-gpl \
--enable-version3 \
--extra-libs='-mconsole' \
--enable-avisynth \
--enable-gnutls \
--enable-libass \
--enable-libbluray \
--enable-libbs2b \
--enable-libcaca \
--enable-libmp3lame \
--enable-libopencore-amrnb \
--enable-libopencore-amrwb \
--enable-libopus \
--enable-libspeex \
--enable-libtheora \
--enable-libvidstab \
--enable-libvo-aacenc \
--enable-libvo-amrwbenc \
--enable-libvorbis \
--enable-libvpx \
--enable-libx264 \
--enable-libxvid
$(MAKE) -C '$(1)' -j '$(JOBS)'
$(MAKE) -C '$(1)' -j 1 install
endef