Gentoo Archives: gentoo-commits

From: Joerg Bornkessel <hd_brummy@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: media-video/vdr/
Date: Fri, 24 Jun 2016 10:42:28
Message-Id: 1466764912.f4358780337bd4cc569edaa3875a3f05b7c8de56.hd_brummy@gentoo
1 commit: f4358780337bd4cc569edaa3875a3f05b7c8de56
2 Author: Joerg Bornkessel <hd_brummy <AT> gentoo <DOT> org>
3 AuthorDate: Fri Jun 24 10:41:52 2016 +0000
4 Commit: Joerg Bornkessel <hd_brummy <AT> gentoo <DOT> org>
5 CommitDate: Fri Jun 24 10:41:52 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f4358780
7
8 media-video/vdr: fixed systemd compile, wrt bug 586070
9
10 Package-Manager: portage-2.3.0_rc1
11
12 media-video/vdr/vdr-2.2.0-r1.ebuild | 300 ++++++++++++++++++++++++++++++++++++
13 1 file changed, 300 insertions(+)
14
15 diff --git a/media-video/vdr/vdr-2.2.0-r1.ebuild b/media-video/vdr/vdr-2.2.0-r1.ebuild
16 new file mode 100644
17 index 0000000..988fd29
18 --- /dev/null
19 +++ b/media-video/vdr/vdr-2.2.0-r1.ebuild
20 @@ -0,0 +1,300 @@
21 +# Copyright 1999-2016 Gentoo Foundation
22 +# Distributed under the terms of the GNU General Public License v2
23 +# $Id$
24 +
25 +EAPI=6
26 +
27 +#inherit eutils flag-o-matic multilib toolchain-funcs
28 +inherit flag-o-matic toolchain-funcs
29 +
30 +# Switches supported by extensions-patch
31 +EXT_PATCH_FLAGS="alternatechannel graphtft naludump permashift_v1 pinplugin
32 + mainmenuhooks menuorg menuselection resumereset ttxtsubs"
33 +
34 +# names of the use-flags
35 +EXT_PATCH_FLAGS_RENAMED=""
36 +
37 +# names ext-patch uses internally, here only used for maintainer checks
38 +EXT_PATCH_FLAGS_RENAMED_EXT_NAME="bidi no_kbd sdnotify"
39 +
40 +IUSE="bidi debug +kbd html systemd vanilla ${EXT_PATCH_FLAGS} ${EXT_PATCH_FLAGS_RENAMED}"
41 +
42 +MY_PV="${PV%_p*}"
43 +MY_P="${PN}-${MY_PV}"
44 +S="${WORKDIR}/${MY_P}"
45 +
46 +EXT_P="extpng-${P}-gentoo-edition-v1"
47 +
48 +DESCRIPTION="Video Disk Recorder - turns a pc into a powerful set top box for DVB"
49 +HOMEPAGE="http://www.tvdr.de/"
50 +SRC_URI="ftp://ftp.tvdr.de/vdr/${MY_P}.tar.bz2
51 + https://dev.gentoo.org/~hd_brummy/distfiles/${EXT_P}.patch.bz2"
52 +
53 +KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~x86"
54 +SLOT="0"
55 +LICENSE="GPL-2"
56 +
57 +COMMON_DEPEND="virtual/jpeg:*
58 + sys-libs/libcap
59 + >=media-libs/fontconfig-2.4.2
60 + >=media-libs/freetype-2"
61 +
62 +DEPEND="${COMMON_DEPEND}
63 + >=virtual/linuxtv-dvb-headers-5.3
64 + sys-devel/gettext"
65 +
66 +RDEPEND="${COMMON_DEPEND}
67 + dev-lang/perl
68 + >=media-tv/gentoo-vdr-scripts-2.7
69 + media-fonts/corefonts
70 + bidi? ( dev-libs/fribidi )
71 + systemd? ( sys-apps/systemd )"
72 +
73 +CONF_DIR=/etc/vdr
74 +CAP_FILE=${S}/capabilities.sh
75 +CAPS="# Capabilities of the vdr-executable for use by startscript etc."
76 +
77 +pkg_setup() {
78 +
79 + use debug && append-flags -g
80 +
81 + PLUGIN_LIBDIR="/usr/$(get_libdir)/vdr/plugins"
82 +
83 + tc-export CC CXX AR
84 +}
85 +
86 +add_cap() {
87 + local arg
88 + for arg; do
89 + CAPS="${CAPS}\n${arg}=1"
90 + done
91 +}
92 +
93 +enable_patch() {
94 + local arg ARG_UPPER
95 + for arg; do
96 + ARG_UPPER=$(echo $arg|tr '[:lower:]' '[:upper:]')
97 + echo "${ARG_UPPER} = 1" >> Make.config
98 +
99 + # codesnippet to bring the extpng defines into the vdr.pc CXXFLAGS CFLAGS
100 + echo "-DUSE_${ARG_UPPER}" >> "${T}"/defines.tmp
101 + cat "${T}"/defines.tmp | tr \\\012 ' ' > "${T}"/defines.IUSE
102 + export DEFINES_IUSE=$( cat ${T}/defines.IUSE )
103 + done
104 +}
105 +
106 +extensions_add_make_conf()
107 +{
108 + # copy all ifdef for extensions-patch to Make.config
109 + sed -e '1,/need to touch the following:/d' \
110 + -e '/need to touch the following/,/^$/d' \
111 + Make.config.template >> Make.config
112 +}
113 +
114 +extensions_all_defines() {
115 + # extract all possible settings for extensions-patch
116 + sed -e '/^#\?[A-Z].*= 1/!d' -e 's/^#\?//' -e 's/ .*//' \
117 + Make.config.template \
118 + | sort \
119 + | tr '[:upper:]' '[:lower:]'
120 +}
121 +
122 +lang_po() {
123 + LING_PO=$( ls ${S}/po | sed -e "s:.po::g" | cut -d_ -f1 | tr \\\012 ' ' )
124 +}
125 +
126 +src_configure() {
127 + # support languages, written from right to left
128 + export "BIDI=$(usex bidi 1 0)"
129 + # systemd notification support
130 + export "SDNOTIFY=$(usex systemd 1 0)"
131 + # with/without keyboard
132 + export "USE_KBD=$(usex kbd 1 0)"
133 +}
134 +
135 +src_prepare() {
136 + # apply maintainace-patches
137 + ebegin "Changing paths for gentoo"
138 +
139 + local DVBDIR=/usr/include
140 + local i
141 + for i in ${DVB_HEADER_PATH} /usr/include/v4l-dvb-hg /usr/include; do
142 + [[ -d ${i} ]] || continue
143 + if [[ -f ${i}/linux/dvb/dmx.h ]]; then
144 + einfo "Found DVB header files in ${i}"
145 + DVBDIR=${i}
146 + break
147 + fi
148 + done
149 +
150 + # checking for s2api headers
151 + local api_version
152 + api_version=$(awk -F' ' '/define DVB_API_VERSION / {print $3}' "${DVBDIR}"/linux/dvb/version.h)
153 + api_version=${api_version}*$(awk -F' ' '/define DVB_API_VERSION_MINOR / {print $3}' "${DVBDIR}"/linux/dvb/version.h)
154 +
155 + if [[ ${api_version:-0} -lt 5*3 ]]; then
156 + eerror "DVB header files do not contain s2api support or too old for ${P}"
157 + eerror "You cannot compile VDR against old dvb-header"
158 + die "DVB headers too old"
159 + fi
160 +
161 + cat > Make.config <<-EOT
162 + #
163 + # Generated by ebuild ${PF}
164 + #
165 + PREFIX = /usr
166 + DVBDIR = ${DVBDIR}
167 + PLUGINLIBDIR = ${PLUGIN_LIBDIR}
168 + CONFDIR = ${CONF_DIR}
169 + VIDEODIR = /var/vdr/video
170 + LOCDIR = \$(PREFIX)/share/locale
171 + INCDIR = \$(PREFIX)/include
172 +
173 + DEFINES += -DCONFDIR=\"\$(CONFDIR)\"
174 + INCLUDES += -I\$(DVBDIR)
175 +
176 + # >=vdr-1.7.36-r1; parameter only used for compiletime on vdr
177 + # PLUGINLIBDIR (plugin Makefile old) = LIBDIR (plugin Makefile new)
178 + LIBDIR = ${PLUGIN_LIBDIR}
179 + PCDIR = /usr/$(get_libdir)/pkgconfig
180 +
181 + EOT
182 + eend 0
183 +
184 + # wrt bug 586070
185 + if has_version ">=sys-apps/systemd-230"; then
186 + sed -e "s:libsystemd-daemon:libsystemd:g" -i Makefile || die "sed libsystemd failed"
187 + fi
188 +
189 + if ! use vanilla; then
190 +
191 + # Now apply extensions patch
192 + eapply "${WORKDIR}/${EXT_P}.patch"
193 +
194 + # This allows us to start even if some plugin does not exist
195 + # or is not loadable.
196 + enable_patch PLUGINMISSING
197 +
198 + if [[ -n ${VDR_MAINTAINER_MODE} ]]; then
199 + einfo "Doing maintainer checks:"
200 +
201 + # we do not support these patches
202 + # (or have them already hard enabled)
203 + local IGNORE_PATCHES="pluginmissing"
204 +
205 + extensions_all_defines > "${T}"/new.IUSE
206 + echo $EXT_PATCH_FLAGS $EXT_PATCH_FLAGS_RENAMED_EXT_NAME \
207 + $IGNORE_PATCHES | \
208 + tr ' ' '\n' |sort > "${T}"/old.IUSE
209 + local DIFFS=$(diff -u "${T}"/old.IUSE "${T}"/new.IUSE|grep '^[+-][^+-]')
210 + if [[ -z ${DIFFS} ]]; then
211 + einfo "EXT_PATCH_FLAGS is up to date."
212 + else
213 + ewarn "IUSE differences!"
214 + local diff
215 + for diff in $DIFFS; do
216 + ewarn "$diff"
217 + done
218 + fi
219 + fi
220 +
221 + ebegin "Enabling selected patches"
222 + local flag
223 + for flag in $EXT_PATCH_FLAGS; do
224 + use $flag && enable_patch ${flag}
225 + done
226 +
227 + eend 0
228 +
229 + extensions_add_make_conf
230 +
231 + # add defined use-flags compile options to vdr.pc
232 + sed -e "s:\$(CDEFINES) \$(CINCLUDES) \$(HDRDIR):\$(CDEFINES) \$(CINCLUDES) \$(HDRDIR) \$(DEFINES_IUSE):" \
233 + -i Makefile
234 +
235 + ebegin "Make depend"
236 + emake .dependencies >/dev/null
237 + eend $? "make depend failed"
238 + fi
239 +
240 + eapply "${FILESDIR}/${P}_gentoo.patch"
241 +
242 + # fix some makefile issues
243 + sed -e "s:ifndef NO_KBD:ifeq (\$(USE_KBD),1):" \
244 + -e "s:ifdef BIDI:ifeq (\$(BIDI),1):" \
245 + -e "s:ifdef SDNOTIFY:ifeq (\$(SDNOTIFY),1):" \
246 + -i "${S}"/Makefile
247 +
248 + eapply_user
249 +
250 + add_cap CAP_UTF8
251 +
252 + add_cap CAP_IRCTRL_RUNTIME_PARAM \
253 + CAP_VFAT_RUNTIME_PARAM \
254 + CAP_CHUID \
255 + CAP_SHUTDOWN_AUTO_RETRY
256 +
257 + echo -e ${CAPS} > "${CAP_FILE}"
258 +
259 + # LINGUAS support
260 + einfo "\n \t VDR supports the LINGUAS values"
261 +
262 + lang_po
263 +
264 + einfo "\t Please set one of this values in your sytem make.conf"
265 + einfo "\t LINGUAS=\"${LING_PO}\"\n"
266 +
267 + if [[ -z ${LINGUAS} ]]; then
268 + einfo "\n \t No values in LINGUAS="
269 + einfo "\t You will get only english text on OSD \n"
270 + fi
271 +
272 + strip-linguas ${LING_PO} en
273 +}
274 +
275 +src_install() {
276 + # trick makefile not to create a videodir by supplying it with an existing
277 + # directory
278 + emake install \
279 + VIDEODIR="/" \
280 + DESTDIR="${D}" install || die "emake install failed"
281 +
282 + keepdir "${PLUGIN_LIBDIR}"
283 +
284 + # backup for plugins they don't be able to create this dir
285 + keepdir "${CONF_DIR}"/plugins
286 +
287 + if use html; then
288 + local HTML_DOCS=( *.html )
289 + fi
290 +
291 + local DOCS=( MANUAL INSTALL README* HISTORY CONTRIBUTORS )
292 +
293 + einstalldocs
294 +
295 + insinto /usr/share/vdr
296 + doins "${CAP_FILE}"
297 +
298 + if use alternatechannel; then
299 + insinto /etc/vdr
300 + doins "${FILESDIR}"/channel_alternative.conf
301 + fi
302 +
303 + chown -R vdr:vdr "${D}/${CONF_DIR}"
304 +}
305 +
306 +pkg_postinst() {
307 +
308 + elog "\n\t---- 15 YEARS ANNIVERSARY EDITON ----\n"
309 + elog "\tA lot of thanks to Klaus Schmidinger"
310 + elog "\tfor this nice piece of Software...\n"
311 +
312 + elog "It is a good idea to run vdrplugin-rebuild now."
313 +
314 + elog "To get nice symbols in OSD we recommend to install"
315 + elog "\t1. emerge media-fonts/vdrsymbols-ttf"
316 + elog "\t2. select font VDRSymbolsSans in Setup"
317 + elog ""
318 + elog "To get an idea how to proceed now, have a look at our vdr-guide:"
319 + elog "\thttps://wiki.gentoo.org/wiki/VDR"
320 +}