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