sci-mathematics/rstudio: Thanks to tomboy-64 for fixing bug Bug 534152 - sci-mathemat...
[gentoo.git] / media-plugins / vdr-xineliboutput / vdr-xineliboutput-2.0.0_p20130821.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
7 inherit vdr-plugin-2
8
9 GENTOO_VDR_CONDITIONAL=yes
10
11 DESCRIPTION="VDR Plugin: Xinelib PlugIn"
12 HOMEPAGE="http://sourceforge.net/projects/xineliboutput/"
13 SRC_URI="http://vdr.websitec.de/download/${PN}/xineliboutput-2.0.0_p20130821.tar.bz2"
14
15 SLOT="0"
16 LICENSE="GPL-2"
17 KEYWORDS="~amd64 ~x86"
18 IUSE="bluray caps dbus fbcon jpeg libextractor nls opengl +vdr vdpau +X +xine xinerama"
19
20 COMMON_DEPEND="
21         vdr? (
22                 >=media-video/vdr-1.6.0
23                 libextractor? ( >=media-libs/libextractor-0.5.20 )
24                 caps? ( sys-libs/libcap )
25         )
26
27         xine? (
28                 ( >=media-libs/xine-lib-1.2
29                         virtual/ffmpeg )
30                 fbcon? ( jpeg? ( virtual/jpeg:* ) )
31                 X? (
32                         x11-libs/libX11
33                         x11-libs/libXext
34                         x11-libs/libXrender
35                         xinerama? ( x11-libs/libXinerama )
36                         dbus? ( dev-libs/dbus-glib dev-libs/glib:2 )
37                         vdpau? ( x11-libs/libvdpau >=media-libs/xine-lib-1.2 )
38                         jpeg? ( virtual/jpeg:* )
39                         bluray? ( media-libs/libbluray )
40                         opengl? ( virtual/opengl )
41                 )
42         )"
43
44 DEPEND="${COMMON_DEPEND}
45         virtual/pkgconfig
46         sys-kernel/linux-headers
47         nls? ( sys-devel/gettext )
48         xine? (
49                 X? (
50                         x11-proto/xproto
51                         x11-libs/libXxf86vm
52                 )
53         )"
54 RDEPEND="${COMMON_DEPEND}"
55
56 REQUIRED_USE=" || ( vdr xine )"
57
58 VDR_CONFD_FILE="${FILESDIR}/confd-2.0.0"
59
60 pkg_setup() {
61         vdr-plugin-2_pkg_setup
62
63         if use xine; then
64                 XINE_PLUGIN_DIR=$(pkg-config --variable=plugindir libxine)
65                 [ -z "${XINE_PLUGIN_DIR}" ] && die "Could not find xine plugin dir"
66         fi
67 }
68
69 src_prepare() {
70         vdr-plugin-2_src_prepare
71
72         if has_version ">=media-video/vdr-2.1.10"; then
73                 sed -e "s:pm = RenderPixmaps():pm = dynamic_cast<cPixmapMemory *>(RenderPixmaps()):"\
74                         -e "s:delete pm;:DestroyPixmap(pm);:"\
75                         -i osd.c
76         fi
77 }
78
79 src_configure() {
80         local myconf
81
82         if has_version ">=media-libs/xine-lib-1.2"; then
83                 myconf="${myconf} --enable-libavutil"
84         else
85                 myconf="${myconf} --disable-libavutil"
86         fi
87
88         # No autotools based configure script
89         ./configure \
90                 --cc=$(tc-getCC) \
91                 --cxx=$(tc-getCXX) \
92                 $(use_enable X x11) \
93                 $(use_enable X xshm) \
94                 $(use_enable X xdpms) \
95                 $(use_enable X xshape) \
96                 $(use_enable X xrender) \
97                 $(use_enable fbcon fb) \
98                 $(use_enable vdr) \
99                 $(use_enable xine libxine) \
100                 $(use_enable libextractor) \
101                 $(use_enable caps libcap) \
102                 $(use_enable jpeg libjpeg) \
103                 $(use_enable xinerama) \
104                 $(use_enable vdpau) \
105                 $(use_enable dbus dbus-glib-1) \
106                 $(use_enable nls i18n) \
107                 $(use_enable bluray libbluray) \
108                 $(use_enable opengl) \
109                 ${myconf} \
110                 || die
111
112         # UINT64_C is needed by ffmpeg headers
113         append-cxxflags -D__STDC_CONSTANT_MACROS
114 }
115
116 src_install() {
117         if use vdr; then
118                 vdr-plugin-2_src_install
119
120                 # bug 346989
121                 insinto /etc/vdr/plugins/xineliboutput/
122                 doins examples/allowed_hosts.conf
123                 fowners -R vdr:vdr /etc/vdr/
124
125                 if use nls; then
126                         emake DESTDIR="${D}" i18n
127                 fi
128
129                 if use xine; then
130                         doinitd "${FILESDIR}"/vdr-frontend
131
132                         insinto $XINE_PLUGIN_DIR
133                         doins xineplug_inp_xvdr.so
134
135                         insinto $XINE_PLUGIN_DIR/post
136                         doins xineplug_post_*.so
137
138                         if use fbcon; then
139                                 dobin vdr-fbfe
140
141                                 insinto $VDR_PLUGIN_DIR
142                                 doins libxineliboutput-fbfe.so.*
143                         fi
144
145                         if use X; then
146                                 dobin vdr-sxfe
147
148                                 insinto $VDR_PLUGIN_DIR
149                                 doins libxineliboutput-sxfe.so.*
150                         fi
151                 fi
152         else
153                 emake DESTDIR="${D}" install
154
155                 dodoc HISTORY README
156         fi
157 }