Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | SUMMARY = "Open source audio and video processing tools and librairies" |
| 2 | DESCRIPTION = "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." |
| 7 | HOMEPAGE = "http://libav.org/" |
| 8 | SECTION = "libs" |
| 9 | |
| 10 | LICENSE = "GPLv2+" |
| 11 | LICENSE_FLAGS = "commercial" |
| 12 | |
| 13 | LIC_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 | |
| 18 | SRC_URI = "http://libav.org/releases/${BP}.tar.xz" |
| 19 | |
| 20 | # Provides ffmpeg compat, see http://libav.org/about.html |
| 21 | PROVIDES = "ffmpeg" |
| 22 | |
| 23 | ARM_INSTRUCTION_SET = "arm" |
| 24 | |
| 25 | DEPENDS = "alsa-lib zlib libogg yasm-native" |
| 26 | |
| 27 | inherit autotools pkgconfig |
| 28 | |
| 29 | B = "${S}/build.${HOST_SYS}.${TARGET_SYS}" |
| 30 | |
| 31 | FULL_OPTIMIZATION_armv7a = "-fexpensive-optimizations -fomit-frame-pointer -O4 -ffast-math" |
| 32 | BUILD_OPTIMIZATION = "${FULL_OPTIMIZATION}" |
| 33 | |
| 34 | EXTRA_FFCONF_armv7a = "--cpu=cortex-a8" |
| 35 | EXTRA_FFCONF ?= "" |
| 36 | |
| 37 | PACKAGECONFIG ??= "bzip2 x264 theora ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)}" |
| 38 | PACKAGECONFIG[bzip2] = "--enable-bzlib,--disable-bzlib,bzip2" |
| 39 | PACKAGECONFIG[faac] = "--enable-libfaac,--disable-libfaac,faac" |
| 40 | PACKAGECONFIG[gsm] = "--enable-libgsm,--disable-libgsm,libgsm" |
| 41 | PACKAGECONFIG[jack] = "--enable-indev=jack,--disable-indev=jack,jack" |
| 42 | PACKAGECONFIG[libvorbis] = "--enable-libvorbis,--disable-libvorbis,libvorbis" |
| 43 | PACKAGECONFIG[mp3lame] = "--enable-libmp3lame,--disable-libmp3lame,lame" |
| 44 | PACKAGECONFIG[openssl] = "--enable-openssl,--disable-openssl,openssl" |
| 45 | PACKAGECONFIG[schroedinger] = "--enable-libschroedinger,--disable-libschroedinger,schroedinger" |
| 46 | PACKAGECONFIG[speex] = "--enable-libspeex,--disable-libspeex,speex" |
| 47 | PACKAGECONFIG[theora] = "--enable-libtheora,--disable-libtheora,libtheora" |
| 48 | PACKAGECONFIG[vaapi] = "--enable-vaapi,--disable-vaapi,libva" |
| 49 | PACKAGECONFIG[vpx] = "--enable-libvpx,--disable-libvpx,libvpx" |
| 50 | PACKAGECONFIG[x11] = "--enable-x11grab,--disable-x11grab,virtual/libx11 libxfixes libxext xproto virtual/libsdl" |
| 51 | PACKAGECONFIG[x264] = "--enable-libx264,--disable-libx264,x264" |
| 52 | |
| 53 | # Check codecs that require --enable-nonfree |
| 54 | USE_NONFREE = "${@bb.utils.contains_any('PACKAGECONFIG', [ 'faac', 'openssl' ], 'yes', '', d)}" |
| 55 | |
| 56 | EXTRA_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 | |
| 81 | do_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 | |
| 90 | do_install_append() { |
| 91 | install -m 0644 ${S}/libavfilter/*.h ${D}${includedir}/libavfilter/ |
| 92 | } |
| 93 | |
| 94 | PACKAGES += "${PN}-vhook-dbg ${PN}-vhook ffmpeg-x264-presets" |
| 95 | PACKAGES_DYNAMIC += "^lib(av(codec|device|filter|format|util)|swscale).*" |
| 96 | |
| 97 | RSUGGESTS_${PN} = "mplayer" |
| 98 | FILES_${PN} = "${bindir}" |
| 99 | FILES_${PN}-dev = "${includedir}/${PN}" |
| 100 | |
| 101 | FILES_${PN}-vhook = "${libdir}/vhook" |
| 102 | FILES_${PN}-vhook-dbg += "${libdir}/vhook/.debug" |
| 103 | |
| 104 | FILES_ffmpeg-x264-presets = "${datadir}/*.avpreset" |
| 105 | |
| 106 | LEAD_SONAME = "libavcodec.so" |
| 107 | |
| 108 | FILES_${PN}-dev = "${includedir}" |
| 109 | |
| 110 | python 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 | } |