Copy from Berkano Overlay
[otih-overlay.git] / media-libs / x264 / .svn / text-base / x264-0.0.20080819-r99.ebuild.svn-base
blobc6e2b0a2fdee645411ff8d80622409c70e9cec89
1 # Copyright 1999-2008 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: $
5 EAPI="1"
6 inherit eutils multilib toolchain-funcs versionator
8 MY_P="x264-snapshot-$(get_version_component_range 3)-2245"
10 DESCRIPTION="A free library for encoding H264/AVC video streams"
11 HOMEPAGE="http://www.videolan.org/developers/x264.html"
12 SRC_URI="ftp://ftp.videolan.org/pub/videolan/x264/snapshots/${MY_P}.tar.bz2"
13 LICENSE="GPL-2"
14 SLOT="0"
15 KEYWORDS="~alpha ~amd64 ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd"
16 IUSE="debug gtk +mp4 +psyrdo psytrellis +threads X"
18 RDEPEND="gtk? ( >=x11-libs/gtk+-2.6.10
19                 >=dev-libs/glib-2.10.3 )
20         mp4? ( media-video/gpac )
21         X? ( x11-libs/libX11 )"
22 DEPEND="${RDEPEND}
23         amd64? ( >=dev-lang/yasm-0.6.2 )
24         x86? ( >=dev-lang/yasm-0.7.0 )
25         x86-fbsd? ( >=dev-lang/yasm-0.6.2 )
26         dev-util/pkgconfig
27         !media-video/x264-encoder"
29 S="${WORKDIR}/${MY_P}"
31 src_unpack() {
32         unpack ${A}
33         cd "${S}"
34         epatch "${FILESDIR}/${PN}-nostrip.patch"
35         # Psy-RDO see http://forum.doom9.org/showthread.php?t=138293
36         if ( use psyrdo && use !psytrellis ); then
37                 epatch "${FILESDIR}/x264-psyrdo-0.6.diff"
38         fi
39         use psytrellis && epatch "${FILESDIR}/x264-psyrd-0.6-psytrellis-0.1.diff"
42 src_compile() {
43         local myconf=""
44         use debug && myconf="${myconf} --enable-debug"
45         ./configure --prefix=/usr \
46                 --libdir=/usr/$(get_libdir) \
47                 --enable-pic --enable-shared \
48                 "--extra-cflags=${CFLAGS}" \
49                 "--extra-ldflags=${LDFLAGS}" \
50                 "--extra-asflags=${ASFLAGS}" \
51                 $(use_enable X visualize) \
52                 $(use_enable threads pthread) \
53                 $(use_enable debug) \
54                 $(use_enable mp4 mp4-output) \
55                 $(use_enable gtk) \
56                 ${myconf} \
57                 || die "configure failed"
58         emake CC="$(tc-getCC)" || die "make failed"
61 src_install() {
62         make DESTDIR="${D}" install || die
63         dodoc AUTHORS doc/*txt