summaryrefslogtreecommitdiff
blob: 25b4e2680d2a9b449ceae5489f2535af46e86fe4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/media-plugins/vdr-xineliboutput/vdr-xineliboutput-9999.ebuild,v 1.1 2009/12/02 21:29:03 hd_brummy Exp $

GENTOO_VDR_CONDITIONAL=yes

EAPI="2"

inherit vdr-plugin eutils multilib versionator cvs

MY_PV=${PV#*_p}
MY_P=${PN}

DESCRIPTION="Video Disk Recorder Xinelib PlugIn"
HOMEPAGE="http://sourceforge.net/projects/xineliboutput/"

ECVS_SERVER="xineliboutput.cvs.sourceforge.net:/cvsroot/xineliboutput"
ECVS_MODULE="vdr-xineliboutput"

SLOT="0"
LICENSE="GPL-2"
KEYWORDS="~amd64 ~x86"
IUSE="+vdr +xine fbcon X libextractor xinerama"

# both vdr plugin or vdr-sxfe can use X11
# still depends need some cleanup
COMMON_DEPEND="
	vdr? ( >=media-video/vdr-1.4.0 )

	xine? ( >=media-libs/xine-lib-1.1.1 )

	media-libs/jpeg
	libextractor? ( >=media-libs/libextractor-0.5.20 )

	X? (
		x11-libs/libX11
		x11-libs/libXv
		x11-libs/libXext
		x11-libs/libXrender
		xinerama? ( x11-libs/libXinerama )
	)"

DEPEND="${COMMON_DEPEND}
	sys-kernel/linux-headers
	X? (
		x11-proto/xextproto
		x11-proto/xf86vidmodeproto
		x11-proto/xproto
		x11-proto/renderproto
		xinerama? ( x11-proto/xineramaproto )
	)"

RDEPEND="${COMMON_DEPEND}"

S=${WORKDIR}/${MY_P}

pkg_setup() {
	vdr-plugin_pkg_setup

	if ! use vdr && ! use xine; then
		eerror "Compiling ${PN} with USE='-vdr -xine' is not possible."
		eerror "You either need at least one of these flags."
		#die "${PN} cannot be used with vdr support and xine support disabled!"
	fi
}

use_onoff() {
	if use "$1"; then
		echo 1
	else
		echo 0
	fi
}

use_onoff_xine() {
	if use xine && use "$1"; then
		echo 1
	else
		echo 0
	fi
}

src_prepare() {
	cvs_src_unpack
	vdr-plugin_src_prepare

	if use xine; then
		XINE_PLUGIN_DIR=$(xine-config --plugindir)
		if [[ ${XINE_PLUGIN_DIR} = "" ]]; then
			eerror "Could not find xine plugin dir"
			die "Could not find xine plugin dir"
		fi
	fi

	# stop some automagic overwriting of the stuff we set
	sed -e '/XINELIBOUTPUT_VDRPLUGIN = 1/s/^/#/' \
		-e '/HAVE_EXTRACTOR_H = 1/s/^/#/' \
		-i Makefile

	cat >>Make.config <<-EOF
		XINELIBOUTPUT_XINEPLUGIN = $(use_onoff xine)
		XINELIBOUTPUT_VDRPLUGIN = $(use_onoff vdr)

		XINELIBOUTPUT_FB = $(use_onoff_xine fbcon)
		XINELIBOUTPUT_X11 = $(use_onoff_xine X)

		HAVE_XRENDER = 1
		HAVE_XDPMS = 1
		HAVE_EXTRACTOR_H = $(use_onoff libextractor)
		HAVE_XINERAMA = $(use_onoff xinerama)
	EOF

	# patching makefile to work with this
	# $ rm ${outdir}/file; cp file ${outdir}/file
	# work in the sandbox
	sed -i Makefile \
		-e 's:XINEPLUGINDIR.*=.*:XINEPLUGINDIR = '"${WORKDIR}/lib:" \
		-e 's:VDRINCDIR.*=.*:VDRINCDIR ?= /usr/include:'
	mkdir -p "${WORKDIR}/lib"
}

src_configure() { :; }

src_install() {
	if use vdr; then
		# install vdr plugin
		vdr-plugin_src_install

		# version number that the sources contain
		local SO_VERSION="$(grep 'static const char \*VERSION *=' xineliboutput.c |\
						cut	-d'"' -f2)"
	echo SO_VERSION=$SO_VERSION
		insinto ${VDR_PLUGIN_DIR}
		if use fbcon; then
			doins libxineliboutput-fbfe.so.${SO_VERSION} || die "doins failed"
		fi
		if use X; then
			doins libxineliboutput-sxfe.so.${SO_VERSION} || die "doins failed"
		fi
	fi

	if use xine; then
		# install xine-plugins
		insinto "${XINE_PLUGIN_DIR}"
		doins xineplug_inp_*.so

		insinto "${XINE_PLUGIN_DIR}"/post
		doins xineplug_post_*.so

		# install xine-based frontends
		use fbcon && dobin vdr-fbfe
		use X && dobin vdr-sxfe

	fi
}

pkg_config() {
	einfo "emerge --config is not supported"
}
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/media-plugins/vdr-xineliboutput/vdr-xineliboutput-9999.ebuild,v 1.1 2009/12/02 21:29:03 hd_brummy Exp $

GENTOO_VDR_CONDITIONAL=yes

EAPI="2"

inherit vdr-plugin eutils multilib versionator cvs

MY_PV=${PV#*_p}
MY_P=${PN}

DESCRIPTION="Video Disk Recorder Xinelib PlugIn"
HOMEPAGE="http://sourceforge.net/projects/xineliboutput/"

ECVS_SERVER="xineliboutput.cvs.sourceforge.net:/cvsroot/xineliboutput"
ECVS_MODULE="vdr-xineliboutput"

SLOT="0"
LICENSE="GPL-2"
KEYWORDS="~amd64 ~x86"
IUSE="+vdr +xine fbcon X libextractor xinerama"

# both vdr plugin or vdr-sxfe can use X11
# still depends need some cleanup
COMMON_DEPEND="
	vdr? ( >=media-video/vdr-1.4.0 )

	xine? ( >=media-libs/xine-lib-1.1.1 )

	media-libs/jpeg
	libextractor? ( >=media-libs/libextractor-0.5.20 )

	X? (
		x11-libs/libX11
		x11-libs/libXv
		x11-libs/libXext
		x11-libs/libXrender
		xinerama? ( x11-libs/libXinerama )
	)"

DEPEND="${COMMON_DEPEND}
	sys-kernel/linux-headers
	X? (
		x11-proto/xextproto
		x11-proto/xf86vidmodeproto
		x11-proto/xproto
		x11-proto/renderproto
		xinerama? ( x11-proto/xineramaproto )
	)"

RDEPEND="${COMMON_DEPEND}"

S=${WORKDIR}/${MY_P}

pkg_setup() {
	vdr-plugin_pkg_setup

	if ! use vdr && ! use xine; then
		eerror "Compiling ${PN} with USE='-vdr -xine' is not possible."
		eerror "You either need at least one of these flags."
		#die "${PN} cannot be used with vdr support and xine support disabled!"
	fi
}

use_onoff() {
	if use "$1"; then
		echo 1
	else
		echo 0
	fi
}

use_onoff_xine() {
	if use xine && use "$1"; then
		echo 1
	else
		echo 0
	fi
}

src_prepare() {
	cvs_src_unpack
	vdr-plugin_src_prepare

	if use xine; then
		XINE_PLUGIN_DIR=$(xine-config --plugindir)
		if [[ ${XINE_PLUGIN_DIR} = "" ]]; then
			eerror "Could not find xine plugin dir"
			die "Could not find xine plugin dir"
		fi
	fi

	# stop some automagic overwriting of the stuff we set
	sed -e '/XINELIBOUTPUT_VDRPLUGIN = 1/s/^/#/' \
		-e '/HAVE_EXTRACTOR_H = 1/s/^/#/' \
		-i Makefile

	cat >>Make.config <<-EOF
		XINELIBOUTPUT_XINEPLUGIN = $(use_onoff xine)
		XINELIBOUTPUT_VDRPLUGIN = $(use_onoff vdr)

		XINELIBOUTPUT_FB = $(use_onoff_xine fbcon)
		XINELIBOUTPUT_X11 = $(use_onoff_xine X)

		HAVE_XRENDER = 1
		HAVE_XDPMS = 1
		HAVE_EXTRACTOR_H = $(use_onoff libextractor)
		HAVE_XINERAMA = $(use_onoff xinerama)
	EOF

	# patching makefile to work with this
	# $ rm ${outdir}/file; cp file ${outdir}/file
	# work in the sandbox
	sed -i Makefile \
		-e 's:XINEPLUGINDIR.*=.*:XINEPLUGINDIR = '"${WORKDIR}/lib:" \
		-e 's:VDRINCDIR.*=.*:VDRINCDIR ?= /usr/include:'
	mkdir -p "${WORKDIR}/lib"
}

src_configure() { :; }

src_install() {
	if use vdr; then
		# install vdr plugin
		vdr-plugin_src_install

		# version number that the sources contain
		local SO_VERSION="$(grep 'static const char \*VERSION *=' xineliboutput.c |\
						cut	-d'"' -f2)"
	echo SO_VERSION=$SO_VERSION
		insinto ${VDR_PLUGIN_DIR}
		if use fbcon; then
			doins libxineliboutput-fbfe.so.${SO_VERSION} || die "doins failed"
		fi
		if use X; then
			doins libxineliboutput-sxfe.so.${SO_VERSION} || die "doins failed"
		fi
	fi

	if use xine; then
		# install xine-plugins
		insinto "${XINE_PLUGIN_DIR}"
		doins xineplug_inp_*.so

		insinto "${XINE_PLUGIN_DIR}"/post
		doins xineplug_post_*.so

		# install xine-based frontends
		use fbcon && dobin vdr-fbfe
		use X && dobin vdr-sxfe

	fi
}

pkg_config() {
	einfo "emerge --config is not supported"
}