Copy from Berkano Overlay
[otih-overlay.git] / media-libs / xine-lib / .svn / text-base / xine-lib-1.2.9999_p240.ebuild.svn-base
blobe3c65b0b6fab52a49ebacc73674e9423ea047816
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         dev-util/pkgconfig
80         sys-devel/libtool
81         nls? ( sys-devel/gettext )"
83 src_unpack() {
84         mercurial_src_unpack
85         unpack ${A}
87         cd "${S}" || die "cd failed"
89         if use vdpau; then
90                 epatch "${WORKDIR}"/${MY_P}.diff
91         fi
93         epatch "${FILESDIR}"/xine-lib-1.2-hg-compile-error.diff
95         use vdr && sed -i src/vdr/input_vdr.c -e '/define VDR_ABS_FIFO_DIR/s|".*"|"/var/vdr/xine"|'
97         ./autogen.sh noconfig || die "autogen failed"
100 src_compile() {
102         #prevent quicktime crashing
103         append-flags -frename-registers -ffunction-sections
105         # Specific workarounds for too-few-registers arch...
106         if [[ $(tc-arch) == "x86" ]]; then
107                 filter-flags -fforce-addr
108                 filter-flags -momit-leaf-frame-pointer # break on gcc 3.4/4.x
109                 filter-flags -fno-omit-frame-pointer #breaks per bug #149704
110                 is-flag -O? || append-flags -O2
111         fi
113         local myconf
115         # enable/disable appropiate optimizations on sparc
116         [[ "${PROFILE_ARCH}" == "sparc64" ]] && myconf="${myconf} --enable-vis"
117         [[ "${PROFILE_ARCH}" == "sparc" ]] && myconf="${myconf} --disable-vis"
119         # The default CFLAGS (-O) is the only thing working on hppa.
120         use hppa && unset CFLAGS
122         # Too many file names are the same (xine_decoder.c), change the builddir
123         # So that the relative path is used to identify them.
124         mkdir "${WORKDIR}/build"
126         elibtoolize
127         ECONF_SOURCE="${S}" econf \
128                 $(use_enable gnome gnomevfs) \
129                 $(use_enable nls) \
130                 $(use_enable ipv6) \
131                 $(use_enable samba) \
132                 $(use_enable altivec) \
133                 $(use_enable v4l) \
134                 $(use_enable mng) \
135                 $(use_with imagemagick) \
136                 $(use_enable gtk gdkpixbuf) \
137                 $(use_enable aac faad) \
138                 $(use_with flac libflac) \
139                 $(use_with vorbis) \
140                 $(use_with speex) \
141                 $(use_with theora) \
142                 $(use_with wavpack) \
143                 $(use_enable modplug) \
144                 $(use_enable a52 a52dec) --with-external-a52dec \
145                 $(use_enable mad) --with-external-libmad \
146                 $(use_enable dts) --with-external-libdts \
147                 $(use_enable musepack) --with-external-libmpcdec \
148                 $(use_with X x) \
149                 $(use_enable xinerama) \
150                 $(use_enable vidix) \
151                 $(use_enable dxr3) \
152                 $(use_enable directfb) \
153                 $(use_enable fbcon fb) \
154                 $(use_enable opengl) \
155                 $(use_enable aalib) \
156                 $(use_with libcaca caca) \
157                 $(use_with sdl) \
158                 $(use_enable xvmc) \
159                 $(use_with xcb) \
160                 $(use_enable oss) \
161                 $(use_with alsa) \
162                 $(use_with arts) \
163                 $(use_with esd esound) \
164                 $(use_with pulseaudio) \
165                 $(use_with jack) \
166                 $(use_enable vcd) --without-internal-vcdlibs \
167                 $(use_enable win32codecs w32dll) \
168                 $(use_enable real real-codecs) \
169                 $(use_enable mmap) \
170                 $(use_with truetype freetype) $(use_with truetype fontconfig) \
171                 $(use_enable vdr) \
172                 $(use_enable debug) \
173                 --enable-asf \
174                 --with-external-ffmpeg \
175                 --disable-optimizations \
176                 --disable-syncfb \
177                 ${myconf} \
178                 --with-xv-path=/usr/$(get_libdir) \
179                 --with-w32-path=/usr/$(ABI=x86 get_libdir)/win32 \
180                 --with-real-codecs-path=/usr/$(get_libdir)/codecs \
181                 --enable-fast-install \
182                 --disable-dependency-tracking || die "econf failed."
184         emake || die "emake failed."
187 src_install() {
188         emake -j1 DESTDIR="${D}" \
189                 docdir="/usr/share/doc/${PF}" htmldir="/usr/share/doc/${PF}/html" \
190                 install || die "emake install failed."