package/ffmpeg: remove trailing whitespaces from the Makefile
[packages.git] / multimedia / ffmpeg / Makefile
index 13e6566..0808f52 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2006-2011 OpenWrt.org
+# Copyright (C) 2006-2013 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -8,12 +8,15 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=ffmpeg
-PKG_VERSION:=0.8.2
-PKG_RELEASE:=3
+PKG_VERSION:=0.11.2
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=http://ffmpeg.org/releases/
-PKG_MD5SUM:=967d481c98161582d149aced6e3b2f31
+PKG_MD5SUM:=93c1908022567b321df74db7214da6ac
+
+PKG_LICENSE:=LGPLv2.1+ GPLv2+ LGPLv3
+PKG_LICENSE_FILES:=COPYING.GPLv2 COPYING.GPLv3 COPYING.LGPLv2.1 COPYING.LGPLv3
 
 FFMPEG_CUSTOM_ENCODERS:= \
        ac3 \
@@ -157,7 +160,7 @@ define Package/ffmpeg/Default
 endef
 
 define Package/ffmpeg/Default/description
- FFmpeg is a a software package that can record, convert and stream digital 
+ FFmpeg is a a software package that can record, convert and stream digital
  audio and video in numerous formats.
 endef
 
@@ -167,7 +170,7 @@ $(call Package/ffmpeg/Default)
  SECTION:=multimedia
  CATEGORY:=Multimedia
  TITLE+= program
- DEPENDS+= +libpthread +libffmpeg
+ DEPENDS+= +libpthread +libffmpeg-full
  VARIANT:=full
 endef
 
@@ -183,7 +186,7 @@ $(call Package/ffmpeg/Default)
  SECTION:=multimedia
  CATEGORY:=Multimedia
  TITLE+= CLI media identifier
- DEPENDS+= +libffmpeg
+ DEPENDS+= +libffmpeg-full
  VARIANT:=full
 endef
 
@@ -199,7 +202,7 @@ $(call Package/ffserver/Default)
  SECTION:=multimedia
  CATEGORY:=Multimedia
  TITLE+= streaming server
- DEPENDS+= +libpthread +libffmpeg
+ DEPENDS+= +libpthread +libffmpeg-full
  VARIANT:=full
 endef
 
@@ -215,7 +218,7 @@ $(call Package/ffmpeg/Default)
  SECTION:=libs
  CATEGORY:=Libraries
  TITLE+= libraries
- DEPENDS+= +libpthread +zlib
+ DEPENDS+= +libpthread +zlib +libbz2
  PROVIDES:= libffmpeg
 endef
 
@@ -267,15 +270,9 @@ $(call Package/ffmpeg/Default/description)
 endef
 
 
-# XXX: add --disable-mmx & --disable-mmx2 to fix build failure on x86
-# libpostproc/postprocess_template.c:2195: error: can't find a register in class 'GENERAL_REGS' while reloading 'asm'
-# libpostproc/postprocess_template.c:3124: error: can't find a register in class 'GENERAL_REGS' while reloading 'asm'
-# libpostproc/postprocess_template.c:3207: error: can't find a register in class 'GENERAL_REGS' while reloading 'asm'
-
 FFMPEG_CONFIGURE:= \
        CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS) $(FPIC)" \
        LDFLAGS="$(TARGET_LDFLAGS)" \
-       PKG_CONFIG="pkg-config" \
        ./configure \
        --enable-cross-compile \
        --cross-prefix="$(TARGET_CROSS)" \
@@ -285,19 +282,20 @@ FFMPEG_CONFIGURE:= \
        --enable-shared \
        --enable-static \
        --disable-debug \
+       --pkg-config="pkg-config" \
        \
        --enable-gpl \
        --enable-version3 \
        \
+       --disable-asm \
        --disable-doc \
        --disable-dxva2 \
-       --disable-mmx \
-       --disable-mmx2 \
        --enable-pthreads \
        --disable-optimizations \
        --enable-small \
        --disable-stripping \
        --enable-zlib \
+       --disable-outdevs
 
 ifeq ($(BUILD_VARIANT),custom)
 
@@ -313,14 +311,15 @@ ifeq ($(BUILD_VARIANT),custom)
        --disable-ffserver \
        --disable-avfilter \
        --disable-postproc \
+       --disable-swresample \
        --disable-swscale \
        --disable-everything \
-       $(call FFMPEG_ENABLE,encoder,$(FFMPEG_CUSTOM_ENCODERS),CONFIG_FFMPEG_ENCODER) \
-       $(call FFMPEG_ENABLE,decoder,$(FFMPEG_CUSTOM_DECODERS),CONFIG_FFMPEG_DECODER) \
-       $(call FFMPEG_ENABLE,muxer,$(FFMPEG_CUSTOM_MUXERS),CONFIG_FFMPEG_MUXER) \
-       $(call FFMPEG_ENABLE,demuxer,$(FFMPEG_CUSTOM_DEMUXERS),CONFIG_FFMPEG_DEMUXER) \
-       $(call FFMPEG_ENABLE,parser,$(FFMPEG_CUSTOM_PARSERS),CONFIG_FFMPEG_PARSER) \
-       $(call FFMPEG_ENABLE,protocol,$(FFMPEG_CUSTOM_PROTOCOLS),CONFIG_FFMPEG_PROTOCOL) \
+       $(call FFMPEG_ENABLE,encoder,$(FFMPEG_CUSTOM_ENCODERS),CONFIG_FFMPEG_CUSTOM_ENCODER) \
+       $(call FFMPEG_ENABLE,decoder,$(FFMPEG_CUSTOM_DECODERS),CONFIG_FFMPEG_CUSTOM_DECODER) \
+       $(call FFMPEG_ENABLE,muxer,$(FFMPEG_CUSTOM_MUXERS),CONFIG_FFMPEG_CUSTOM_MUXER) \
+       $(call FFMPEG_ENABLE,demuxer,$(FFMPEG_CUSTOM_DEMUXERS),CONFIG_FFMPEG_CUSTOM_DEMUXER) \
+       $(call FFMPEG_ENABLE,parser,$(FFMPEG_CUSTOM_PARSERS),CONFIG_FFMPEG_CUSTOM_PARSER) \
+       $(call FFMPEG_ENABLE,protocol,$(FFMPEG_CUSTOM_PROTOCOLS),CONFIG_FFMPEG_CUSTOM_PROTOCOL) \
 
 endif
 
@@ -338,6 +337,7 @@ ifeq ($(BUILD_VARIANT),mini)
        --disable-ffserver \
        --disable-avfilter \
        --disable-postproc \
+       --disable-swresample \
        --disable-swscale \
        --disable-everything \
        $(call FFMPEG_ENABLE,encoder,$(FFMPEG_MINI_ENCODERS)) \
@@ -363,15 +363,42 @@ define Build/Compile
                all install
 endef
 
-ifeq ($(BUILD_VARIANT),full)
-  define Build/InstallDev
+define Build/InstallDev/custom
+       $(INSTALL_DIR) $(1)/usr/include
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/lib{avcodec,avdevice,avformat,avutil} $(1)/usr/include/
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{avcodec,avdevice,avformat,avutil}.{a,so*} $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/lib{avcodec,avdevice,avformat,avutil}.pc $(1)/usr/lib/pkgconfig/
+endef
+
+define Build/InstallDev/full
        $(INSTALL_DIR) $(1)/usr/include
-       $(CP) $(PKG_INSTALL_DIR)/usr/include/lib{avcodec,avdevice,avfilter,avformat,avutil,postproc,swscale} $(1)/usr/include/
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/lib{avcodec,avdevice,avfilter,avformat,avutil,postproc,swresample,swscale} $(1)/usr/include/
        $(INSTALL_DIR) $(1)/usr/lib
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{avcodec,avdevice,avfilter,avformat,avutil,postproc,swscale}.{a,so*} $(1)/usr/lib/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{avcodec,avdevice,avfilter,avformat,avutil,postproc,swresample,swscale}.{a,so*} $(1)/usr/lib/
        $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/lib{avcodec,avdevice,avfilter,avformat,avutil,postproc,swscale}.pc $(1)/usr/lib/pkgconfig/
-  endef
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/lib{avcodec,avdevice,avfilter,avformat,avutil,postproc,swresample,swscale}.pc $(1)/usr/lib/pkgconfig/
+endef
+
+Build/InstallDev/mini = $(Build/InstallDev/custom)
+
+# XXX: attempt at installing "best" dev files available
+ifeq ($(BUILD_VARIANT),custom)
+  # XXX: only install "custom" dev files if -full & -mini are not selected
+  ifeq ($(CONFIG_PACKAGE_libffmpeg-full)$(CONFIG_PACKAGE_libffmpeg-mini),)
+    Build/InstallDev = $(Build/InstallDev/custom)
+  endif
+endif
+ifeq ($(BUILD_VARIANT),full)
+  # XXX: always install "full" dev files if -full is selected
+  Build/InstallDev = $(Build/InstallDev/full)
+endif
+ifeq ($(BUILD_VARIANT),mini)
+  # XXX: only install "mini" dev files if -full is not selected
+  ifeq ($(CONFIG_PACKAGE_libffmpeg-full),)
+    Build/InstallDev = $(Build/InstallDev/mini)
+  endif
 endif
 
 define Package/ffmpeg/install
@@ -396,13 +423,10 @@ endef
 
 define Package/libffmpeg-full/install
        $(INSTALL_DIR) $(1)/usr/lib
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{avcodec,avdevice,avfilter,avformat,avutil,postproc,swscale}.so.* $(1)/usr/lib/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{avcodec,avdevice,avfilter,avformat,avutil,postproc,swresample,swscale}.so.* $(1)/usr/lib/
 endef
 
-define Package/libffmpeg-mini/install
-       $(INSTALL_DIR) $(1)/usr/lib
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{avcodec,avdevice,avformat,avutil}.so.* $(1)/usr/lib/
-endef
+Package/libffmpeg-mini/install = $(Package/libffmpeg-custom/install)
 
 $(eval $(call BuildPackage,ffmpeg))
 $(eval $(call BuildPackage,ffprobe))