Copy from Berkano Overlay
[otih-overlay.git] / media-libs / xine-lib / .svn / text-base / xine-lib-1.2.9999_p247.ebuild.svn-base
blobbfc5752f48824dd88e77cd2495b03fc6fb5c2d44
1 # Copyright 1999-2009 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: $
5 EAPI=1
6 inherit eutils flag-o-matic toolchain-funcs libtool mercurial
8 MY_PV=${PV/.9999_p/-vdpau-r}
9 MY_P=${PN}-${MY_PV}
10 S="${WORKDIR}/xine-lib-1.2"
12 : ${EHG_REPO_URI:=http://hg.debian.org/hg/xine-lib/xine-lib-1.2}
14 DESCRIPTION="Core libraries for Xine movie player - 1.2 development branch"
15 HOMEPAGE="http://hg.debian.org/hg/xine-lib/xine-lib-1.2/"
16 SRC_URI="http://www.jusst.de/vdpau/files/xine-lib-1.2/${MY_P}.diff.bz2"
18 LICENSE="GPL-2"
19 SLOT="1"
20 KEYWORDS=""
22 IUSE="aalib libcaca -arts esd win32codecs nls +dvd +X directfb +vorbis +alsa
23 gnome sdl speex +theora ipv6 altivec opengl +aac fbcon +xv xvmc
24 samba dxr3 vidix mng +flac oss v4l xinerama vcd +a52 +mad imagemagick +dts
25 debug modplug -gtk pulseaudio -mmap truetype vdpau wavpack +musepack +xcb jack
26 real vdr"
28 RDEPEND="X? ( x11-libs/libXext
29                 x11-libs/libX11 )
30         xv? ( x11-libs/libXv )
31         xvmc? ( x11-libs/libXvMC )
32         xinerama? ( x11-libs/libXinerama )
33         win32codecs? ( >=media-libs/win32codecs-0.50 )
34         esd? ( media-sound/esound )
35         dvd? ( >=media-libs/libdvdcss-1.2.7 )
36         arts? ( kde-base/arts )
37         alsa? ( media-libs/alsa-lib )
38         aalib? ( media-libs/aalib )
39         directfb? ( >=dev-libs/DirectFB-0.9.9 )
40         gnome? ( >=gnome-base/gnome-vfs-2.0 )
41         flac? ( >=media-libs/flac-1.1.2 )
42         sdl? ( >=media-libs/libsdl-1.1.5 )
43         dxr3? ( >=media-libs/libfame-0.9.0 )
44         vorbis? ( media-libs/libogg media-libs/libvorbis )
45         theora? ( media-libs/libogg media-libs/libvorbis >=media-libs/libtheora-1.0_alpha6 )
46         speex? ( media-libs/libogg media-libs/libvorbis media-libs/speex )
47         libcaca? ( >=media-libs/libcaca-0.99_beta1 )
48         samba? ( net-fs/samba )
49         mng? ( media-libs/libmng )
50         vcd? ( media-video/vcdimager )
51         a52? ( >=media-libs/a52dec-0.7.4-r5 )
52         mad? ( media-libs/libmad )
53         imagemagick? ( media-gfx/imagemagick )
54         dts? ( || ( media-libs/libdca media-libs/libdts ) )
55         >=media-video/ffmpeg-0.4.9_p20070129
56         modplug? ( media-libs/libmodplug )
57         nls? ( virtual/libintl )
58         gtk? ( x11-libs/gtk+:2 )
59         pulseaudio? ( media-sound/pulseaudio )
60         truetype? ( media-libs/freetype:2 media-libs/fontconfig )
61         vdpau? ( >=x11-drivers/nvidia-drivers-180.22 )
62         virtual/libiconv
63         wavpack? ( >=media-sound/wavpack-4.31 )
64         musepack? ( media-libs/libmpcdec )
65         xcb? ( >=x11-libs/libxcb-1.0 )
66         jack? ( >=media-sound/jack-audio-connection-kit-0.100 )
67         real? (
68                 x86? ( media-libs/win32codecs )
69                 x86-fbsd? ( media-libs/win32codecs )
70                 amd64? ( media-libs/amd64codecs ) )"
72 DEPEND="${RDEPEND}
73         X? ( x11-libs/libXt
74                  x11-proto/xproto
75                  x11-proto/videoproto
76                  x11-proto/xf86vidmodeproto
77                  xinerama? ( x11-proto/xineramaproto ) )
78         v4l? ( virtual/os-headers )
79         app-text/docbook-xml-dtd:4.4
80         dev-util/pkgconfig
81         sys-devel/libtool
82         nls? ( sys-devel/gettext )
83         || ( www-client/lynx www-client/w3m )" # needed for xmlto
85 src_unpack() {
86         mercurial_src_unpack
87         cd "${WORKDIR}" || die "cd to workdir failed"
88         unpack ${A}
89         cd "${S}" || die "cd failed"
91         if use vdpau; then
92                 epatch "${WORKDIR}"/${MY_P}.diff
93         fi
95         epatch "${FILESDIR}"/xine-lib-1.2-hg-compile-error.diff
97         use vdr && sed -i src/vdr/input_vdr.c -e '/define VDR_ABS_FIFO_DIR/s|".*"|"/var/vdr/xine"|'
99         ./autogen.sh noconfig || die "autogen failed"
102 src_compile() {
104         #prevent quicktime crashing
105         append-flags -frename-registers -ffunction-sections
107         # Specific workarounds for too-few-registers arch...
108         if [[ $(tc-arch) == "x86" ]]; then
109                 filter-flags -fforce-addr
110                 filter-flags -momit-leaf-frame-pointer # break on gcc 3.4/4.x
111                 filter-flags -fno-omit-frame-pointer #breaks per bug #149704
112                 is-flag -O? || append-flags -O2
113         fi
115         local myconf
117         # enable/disable appropiate optimizations on sparc
118         [[ "${PROFILE_ARCH}" == "sparc64" ]] && myconf="${myconf} --enable-vis"
119         [[ "${PROFILE_ARCH}" == "sparc" ]] && myconf="${myconf} --disable-vis"
121         # The default CFLAGS (-O) is the only thing working on hppa.
122         use hppa && unset CFLAGS
124         # Too many file names are the same (xine_decoder.c), change the builddir
125         # So that the relative path is used to identify them.
126         mkdir "${WORKDIR}/build"
128         elibtoolize
129         ECONF_SOURCE="${S}" econf \
130                 $(use_enable gnome gnomevfs) \
131                 $(use_enable nls) \
132                 $(use_enable ipv6) \
133                 $(use_enable samba) \
134                 $(use_enable altivec) \
135                 $(use_enable v4l) \
136                 $(use_enable mng) \
137                 $(use_with imagemagick) \
138                 $(use_enable gtk gdkpixbuf) \
139                 $(use_enable aac faad) \
140                 $(use_with flac libflac) \
141                 $(use_with vorbis) \
142                 $(use_with speex) \
143                 $(use_with theora) \
144                 $(use_with wavpack) \
145                 $(use_enable modplug) \
146                 $(use_enable a52 a52dec) --with-external-a52dec \
147                 $(use_enable mad) --with-external-libmad \
148                 $(use_enable dts) --with-external-libdts \
149                 $(use_enable musepack) --with-external-libmpcdec \
150                 $(use_with X x) \
151                 $(use_enable xinerama) \
152                 $(use_enable vidix) \
153                 $(use_enable dxr3) \
154                 $(use_enable directfb) \
155                 $(use_enable fbcon fb) \
156                 $(use_enable opengl) \
157                 $(use_enable aalib) \
158                 $(use_with libcaca caca) \
159                 $(use_with sdl) \
160                 $(use_enable xvmc) \
161                 $(use_with xcb) \
162                 $(use_enable oss) \
163                 $(use_with alsa) \
164                 $(use_with arts) \
165                 $(use_with esd esound) \
166                 $(use_with pulseaudio) \
167                 $(use_with jack) \
168                 $(use_enable vcd) --without-internal-vcdlibs \
169                 $(use_enable win32codecs w32dll) \
170                 $(use_enable real real-codecs) \
171                 $(use_enable mmap) \
172                 $(use_with truetype freetype) $(use_with truetype fontconfig) \
173                 $(use_enable vdr) \
174                 $(use_enable debug) \
175                 --enable-asf \
176                 --with-external-ffmpeg \
177                 --disable-optimizations \
178                 --disable-syncfb \
179                 ${myconf} \
180                 --with-xv-path=/usr/$(get_libdir) \
181                 --with-w32-path=/usr/$(ABI=x86 get_libdir)/win32 \
182                 --with-real-codecs-path=/usr/$(get_libdir)/codecs \
183                 --enable-fast-install \
184                 --disable-dependency-tracking || die "econf failed."
186         emake || die "emake failed."
189 src_install() {
190         emake -j1 DESTDIR="${D}" \
191                 docdir="/usr/share/doc/${PF}" htmldir="/usr/share/doc/${PF}/html" \
192                 install || die "emake install failed."