Use https by default
[gentoo.git] / media-plugins / gst-plugins-libav / gst-plugins-libav-1.2.4-r1.ebuild
1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 EAPI="5"
6 inherit eutils flag-o-matic multilib-minimal
7
8 MY_PN="gst-libav"
9 DESCRIPTION="FFmpeg based gstreamer plugin"
10 HOMEPAGE="http://gstreamer.freedesktop.org/modules/gst-libav.html"
11 SRC_URI="http://gstreamer.freedesktop.org/src/${MY_PN}/${MY_PN}-${PV}.tar.xz"
12
13 LICENSE="GPL-2"
14 SLOT="1.0"
15 KEYWORDS="~alpha amd64 ~arm hppa ~ia64 ~mips ppc ppc64 ~sparc x86 ~amd64-fbsd ~x86-fbsd"
16 IUSE="libav +orc"
17
18 RDEPEND="
19         >=media-libs/gstreamer-1.2.3:1.0[${MULTILIB_USEDEP}]
20         >=media-libs/gst-plugins-base-1.2.3:1.0[${MULTILIB_USEDEP}]
21         libav? (
22                 <media-video/libav-10:0=[${MULTILIB_USEDEP}]
23                 >=media-video/libav-9.12:0=[${MULTILIB_USEDEP}] )
24         !libav? ( >=media-video/ffmpeg-1.2.6-r1:0=[${MULTILIB_USEDEP}] )
25         orc? ( >=dev-lang/orc-0.4.17[${MULTILIB_USEDEP}] )
26 "
27 DEPEND="${RDEPEND}
28         >=dev-util/gtk-doc-am-1.12
29         >=virtual/pkgconfig-0-r1[${MULTILIB_USEDEP}]
30 "
31
32 S="${WORKDIR}/${MY_PN}-${PV}"
33
34 src_prepare() {
35         # compatibility with recent releases
36         # TODO: likely apply them with libav-10 when it's out but there will
37         # probably be an upstream gst-libav release compatible at that time.
38         if has_version '>=media-video/ffmpeg-2.0' ; then
39                 sed -i -e 's/ CODEC_ID/ AV_CODEC_ID/g' \
40                            -e 's/ CodecID/ AVCodecID/g' \
41                            ext/libav/*.{c,h} || die
42                 epatch "${FILESDIR}/${PN}-1.2.4-ffmpeg2.patch"
43                 epatch "${FILESDIR}/${PN}-1.2.4-fix-memory-leak.patch" #494282
44         fi
45 }
46
47 multilib_src_configure() {
48         GST_PLUGINS_BUILD=""
49         # always use system ffmpeg/libav if possible
50         ECONF_SOURCE=${S} \
51         econf \
52                 --disable-maintainer-mode \
53                 --with-package-name="Gentoo GStreamer ebuild" \
54                 --with-package-origin="https://www.gentoo.org" \
55                 --disable-fatal-warnings \
56                 --with-system-libav \
57                 $(use_enable orc)
58 }
59
60 multilib_src_compile() {
61         # Don't build with -Werror
62         emake ERROR_CFLAGS=
63 }
64
65 multilib_src_install_all() {
66         einstalldocs
67         prune_libtool_files --modules
68 }
69
70 pkg_postinst() {
71         if ! use libav; then
72                 elog "Please note that upstream uses media-video/libav"
73                 elog "rather than media-video/ffmpeg. If you encounter any"
74                 elog "issues try to move from ffmpeg to libav."
75         fi
76 }