blob: d3f4b1b55d1ce8b355159bc04b584c28b46bf016 [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001SUMMARY = "Open source audio and video processing tools and librairies"
2DESCRIPTION = "Libav is a friendly and community-driven effort to provide its users \
3 with a set of portable, functional and high-performance libraries for \
4 dealing with multimedia formats of all sorts. It originates from the \
5 FFmpeg codebase, but goes its own way these days, providing its users \
6 with reliable releases and a clear vision how to go forward."
7HOMEPAGE = "http://libav.org/"
8SECTION = "libs"
9
10LICENSE = "GPLv2+"
11LICENSE_FLAGS = "commercial"
12
13LIC_FILES_CHKSUM = "file://COPYING.GPLv2;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
14 file://COPYING.GPLv3;md5=d32239bcb673463ab874e80d47fae504 \
15 file://COPYING.LGPLv2.1;md5=bd7a443320af8c812e4c18d1b79df004 \
16 file://COPYING.LGPLv3;md5=e6a600fd5e1d9cbde2d983680233ad02"
17
18SRC_URI = "http://libav.org/releases/${BP}.tar.xz"
19
20# Provides ffmpeg compat, see http://libav.org/about.html
21PROVIDES = "ffmpeg"
22
23ARM_INSTRUCTION_SET = "arm"
24
25DEPENDS = "alsa-lib zlib libogg yasm-native"
26
27inherit autotools pkgconfig
28
29B = "${S}/build.${HOST_SYS}.${TARGET_SYS}"
30
31FULL_OPTIMIZATION_armv7a = "-fexpensive-optimizations -fomit-frame-pointer -O4 -ffast-math"
32BUILD_OPTIMIZATION = "${FULL_OPTIMIZATION}"
33
34EXTRA_FFCONF_armv7a = "--cpu=cortex-a8"
35EXTRA_FFCONF ?= ""
36
37PACKAGECONFIG ??= "bzip2 x264 theora ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)}"
38PACKAGECONFIG[bzip2] = "--enable-bzlib,--disable-bzlib,bzip2"
39PACKAGECONFIG[faac] = "--enable-libfaac,--disable-libfaac,faac"
40PACKAGECONFIG[gsm] = "--enable-libgsm,--disable-libgsm,libgsm"
41PACKAGECONFIG[jack] = "--enable-indev=jack,--disable-indev=jack,jack"
42PACKAGECONFIG[libvorbis] = "--enable-libvorbis,--disable-libvorbis,libvorbis"
43PACKAGECONFIG[mp3lame] = "--enable-libmp3lame,--disable-libmp3lame,lame"
44PACKAGECONFIG[openssl] = "--enable-openssl,--disable-openssl,openssl"
45PACKAGECONFIG[schroedinger] = "--enable-libschroedinger,--disable-libschroedinger,schroedinger"
46PACKAGECONFIG[speex] = "--enable-libspeex,--disable-libspeex,speex"
47PACKAGECONFIG[theora] = "--enable-libtheora,--disable-libtheora,libtheora"
48PACKAGECONFIG[vaapi] = "--enable-vaapi,--disable-vaapi,libva"
49PACKAGECONFIG[vpx] = "--enable-libvpx,--disable-libvpx,libvpx"
50PACKAGECONFIG[x11] = "--enable-x11grab,--disable-x11grab,virtual/libx11 libxfixes libxext xproto virtual/libsdl"
51PACKAGECONFIG[x264] = "--enable-libx264,--disable-libx264,x264"
52
53# Check codecs that require --enable-nonfree
54USE_NONFREE = "${@bb.utils.contains_any('PACKAGECONFIG', [ 'faac', 'openssl' ], 'yes', '', d)}"
55
56EXTRA_OECONF = " \
57 --enable-shared \
58 --enable-pthreads \
59 --enable-gpl \
60 ${@bb.utils.contains('USE_NONFREE', 'yes', '--enable-nonfree', '', d)} \
61 --enable-avfilter \
62 \
63 --cross-prefix=${TARGET_PREFIX} \
64 --prefix=${prefix} \
65 \
66 --enable-avserver \
67 --enable-avplay \
68 --ld="${CCLD}" \
69 --arch=${TARGET_ARCH} \
70 --target-os="linux" \
71 --enable-cross-compile \
72 --extra-cflags="${TARGET_CFLAGS} ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}" \
73 --extra-ldflags="${TARGET_LDFLAGS}" \
74 --sysroot="${STAGING_DIR_TARGET}" \
75 --enable-hardcoded-tables \
76 ${EXTRA_FFCONF} \
77 --libdir=${libdir} \
78 --shlibdir=${libdir} \
79"
80
81do_configure() {
82 # We don't have TARGET_PREFIX-pkgconfig
83 sed -i '/pkg_config_default="${cross_prefix}${pkg_config_default}"/d' ${S}/configure
84 mkdir -p ${B}
85 cd ${B}
86 ${S}/configure ${EXTRA_OECONF}
87 sed -i -e s:Os:O4:g ${B}/config.h
88}
89
90do_install_append() {
91 install -m 0644 ${S}/libavfilter/*.h ${D}${includedir}/libavfilter/
92}
93
94PACKAGES += "${PN}-vhook-dbg ${PN}-vhook ffmpeg-x264-presets"
95PACKAGES_DYNAMIC += "^lib(av(codec|device|filter|format|util)|swscale).*"
96
97RSUGGESTS_${PN} = "mplayer"
98FILES_${PN} = "${bindir}"
99FILES_${PN}-dev = "${includedir}/${PN}"
100
101FILES_${PN}-vhook = "${libdir}/vhook"
102FILES_${PN}-vhook-dbg += "${libdir}/vhook/.debug"
103
104FILES_ffmpeg-x264-presets = "${datadir}/*.avpreset"
105
106LEAD_SONAME = "libavcodec.so"
107
108FILES_${PN}-dev = "${includedir}"
109
110python populate_packages_prepend() {
111 av_libdir = d.expand('${libdir}')
112 av_pkgconfig = d.expand('${libdir}/pkgconfig')
113
114 # Runtime package
115 do_split_packages(d, av_libdir, '^lib(.*)\.so\..*',
116 output_pattern='lib%s',
117 description='libav %s library',
118 extra_depends='',
119 prepend=True,
120 allow_links=True)
121
122 # Development packages (-dev, -staticdev)
123 do_split_packages(d, av_libdir, '^lib(.*)\.so$',
124 output_pattern='lib%s-dev',
125 description='libav %s development package',
126 extra_depends='${PN}-dev',
127 prepend=True,
128 allow_links=True)
129 do_split_packages(d, av_pkgconfig, '^lib(.*)\.pc$',
130 output_pattern='lib%s-dev',
131 description='libav %s development package',
132 extra_depends='${PN}-dev',
133 prepend=True)
134 do_split_packages(d, av_libdir, '^lib(.*)\.a$',
135 output_pattern='lib%s-staticdev',
136 description='libav %s development package - static library',
137 extra_depends='${PN}-dev',
138 prepend=True,
139 allow_links=True)
140
141 if d.getVar('TARGET_ARCH', True) in [ 'i586', 'i686' ]:
142 # libav can't be build with -fPIC for 32-bit x86
143 pkgs = d.getVar('PACKAGES', True).split()
144 for pkg in pkgs:
145 d.appendVar('INSANE_SKIP_%s' % pkg, ' textrel')
146}