Gentoo Archives: gentoo-commits

From: Matt Turner <mattst88@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: media-video/vdr/
Date: Tue, 03 Mar 2020 21:16:54
Message-Id: 1583270200.0fc9761f2802864a309dc1832980866fed91b6c3.mattst88@gentoo
1 commit: 0fc9761f2802864a309dc1832980866fed91b6c3
2 Author: Matt Turner <mattst88 <AT> gentoo <DOT> org>
3 AuthorDate: Tue Mar 3 21:15:59 2020 +0000
4 Commit: Matt Turner <mattst88 <AT> gentoo <DOT> org>
5 CommitDate: Tue Mar 3 21:16:40 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0fc9761f
7
8 Revert "media-video/vdr: old buggy version removed"
9
10 This reverts commit 254ca62f09e08d60eac5cc4b91994fbc947efe92.
11
12 This is the only stable version of media-video/vdr.
13
14 Signed-off-by: Matt Turner <mattst88 <AT> gentoo.org>
15
16 media-video/vdr/vdr-2.2.0-r5.ebuild | 301 ++++++++++++++++++++++++++++++++++++
17 1 file changed, 301 insertions(+)
18
19 diff --git a/media-video/vdr/vdr-2.2.0-r5.ebuild b/media-video/vdr/vdr-2.2.0-r5.ebuild
20 new file mode 100644
21 index 00000000000..472f17daa0a
22 --- /dev/null
23 +++ b/media-video/vdr/vdr-2.2.0-r5.ebuild
24 @@ -0,0 +1,301 @@
25 +# Copyright 2020 Gentoo Authors
26 +# Distributed under the terms of the GNU General Public License v2
27 +
28 +EAPI=7
29 +
30 +inherit eutils flag-o-matic toolchain-funcs
31 +
32 +# Switches supported by extensions-patch
33 +EXT_PATCH_FLAGS="alternatechannel graphtft naludump permashift pinplugin
34 + mainmenuhooks menuorg menuselection resumereset ttxtsubs"
35 +
36 +# names of the use-flags
37 +EXT_PATCH_FLAGS_RENAMED=""
38 +
39 +# names ext-patch uses internally, here only used for maintainer checks
40 +EXT_PATCH_FLAGS_RENAMED_EXT_NAME="bidi no_kbd sdnotify"
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 + mirror://gentoo/${EXT_P}.patch.bz2"
52 +
53 +LICENSE="GPL-2+"
54 +SLOT="0"
55 +KEYWORDS="amd64 ~arm ~arm64 ~ppc x86"
56 +IUSE="bidi debug keyboard html systemd vanilla ${EXT_PATCH_FLAGS} ${EXT_PATCH_FLAGS_RENAMED}"
57 +
58 +COMMON_DEPEND="
59 + virtual/jpeg:*
60 + sys-libs/libcap
61 + >=media-libs/fontconfig-2.4.2
62 + >=media-libs/freetype-2"
63 +DEPEND="${COMMON_DEPEND}
64 + >=virtual/linuxtv-dvb-headers-5.3"
65 +RDEPEND="${COMMON_DEPEND}
66 + dev-lang/perl
67 + >=media-tv/gentoo-vdr-scripts-2.7
68 + media-fonts/corefonts
69 + bidi? ( dev-libs/fribidi )
70 + systemd? ( sys-apps/systemd )"
71 +BDEPEND="sys-devel/gettext"
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 + use debug && append-flags -g
79 +
80 + PLUGIN_LIBDIR="/usr/$(get_libdir)/vdr/plugins"
81 +
82 + tc-export CC CXX AR
83 +}
84 +
85 +add_cap() {
86 + local arg
87 + for arg; do
88 + CAPS="${CAPS}\n${arg}=1"
89 + done
90 +}
91 +
92 +enable_patch() {
93 + local arg ARG_UPPER
94 + for arg; do
95 + ARG_UPPER=$(echo $arg | tr '[:lower:]' '[:upper:]')
96 + echo "${ARG_UPPER} = 1" >> Make.config || die "cannot write to Make.config"
97 +
98 + # codesnippet to bring the extpng defines into the vdr.pc CXXFLAGS CFLAGS
99 + echo "-DUSE_${ARG_UPPER}" >> "${T}"/defines.tmp || die "cannot write to defines.tmp"
100 + cat "${T}"/defines.tmp | tr \\\012 ' ' > "${T}"/defines.IUSE || die "cannot write to defines.tmp"
101 + export DEFINES_IUSE=$( cat ${T}/defines.IUSE )
102 + done
103 +}
104 +
105 +extensions_add_make_conf()
106 +{
107 + # copy all ifdef for extensions-patch to Make.config
108 + sed -e '1,/need to touch the following:/d' \
109 + -e '/need to touch the following/,/^$/d' \
110 + Make.config.template >> Make.config || die "cannot write to Make.config"
111 +}
112 +
113 +extensions_all_defines() {
114 + # extract all possible settings for extensions-patch
115 + sed -e '/^#\?[A-Z].*= 1/!d' -e 's/^#\?//' -e 's/ .*//' \
116 + Make.config.template \
117 + | sort \
118 + | tr '[:upper:]' '[:lower:]' || die "error in function extensions_all_defines"
119 +}
120 +
121 +lang_po() {
122 + LING_PO=$( ls ${S}/po | sed -e "s:.po::g" | cut -d_ -f1 | tr \\\012 ' ' )
123 +}
124 +
125 +src_configure() {
126 + # support languages, written from right to left
127 + export "BIDI=$(usex bidi 1 0)"
128 + # systemd notification support
129 + export "SDNOTIFY=$(usex systemd 1 0)"
130 + # with/without keyboard
131 + export "USE_KBD=$(usex keyboard 1 0)"
132 +}
133 +
134 +src_prepare() {
135 + # apply maintenance-patches
136 + ebegin "Changing paths for gentoo"
137 +
138 + local DVBDIR="/usr/include"
139 + local i
140 + for i in ${DVB_HEADER_PATH} /usr/include/v4l-dvb-hg /usr/include; do
141 + [[ -d ${i} ]] || continue
142 + if [[ -f ${i}/linux/dvb/dmx.h ]]; then
143 + einfo "Found DVB header files in ${i}"
144 + DVBDIR="${i}"
145 + break
146 + fi
147 + done
148 +
149 + # checking for s2api headers
150 + local api_version
151 + api_version=$(awk -F' ' '/define DVB_API_VERSION / {print $3}' "${DVBDIR}"/linux/dvb/version.h)
152 + api_version=${api_version}*$(awk -F' ' '/define DVB_API_VERSION_MINOR / {print $3}' "${DVBDIR}"/linux/dvb/version.h)
153 +
154 + if [[ ${api_version:-0} -lt 5*3 ]]; then
155 + eerror "DVB header files do not contain s2api support or too old for ${P}"
156 + eerror "You cannot compile VDR against old dvb-header"
157 + die "DVB headers too old"
158 + fi
159 +
160 + cat > Make.config <<-EOT || die "cannot write to Make.config"
161 + #
162 + # Generated by ebuild ${PF}
163 + #
164 + PREFIX = /usr
165 + DVBDIR = ${DVBDIR}
166 + PLUGINLIBDIR = ${PLUGIN_LIBDIR}
167 + CONFDIR = ${CONF_DIR}
168 + VIDEODIR = /var/vdr/video
169 + LOCDIR = \$(PREFIX)/share/locale
170 + INCDIR = \$(PREFIX)/include
171 +
172 + DEFINES += -DCONFDIR=\"\$(CONFDIR)\"
173 + INCLUDES += -I\$(DVBDIR)
174 +
175 + # >=vdr-1.7.36-r1; parameter only used for compiletime on vdr
176 + # PLUGINLIBDIR (plugin Makefile old) = LIBDIR (plugin Makefile new)
177 + LIBDIR = ${PLUGIN_LIBDIR}
178 + PCDIR = /usr/$(get_libdir)/pkgconfig
179 +
180 + EOT
181 + eend 0
182 +
183 + # wrt bug 586070
184 + if has_version ">=sys-apps/systemd-230"; then
185 + sed -e "s:libsystemd-daemon:libsystemd:g" -i Makefile || die "sed libsystemd failed"
186 + fi
187 +
188 + if ! use vanilla; then
189 +
190 + # Now apply extensions patch
191 + eapply "${WORKDIR}/${EXT_P}.patch"
192 + sed -e 's/PERMASHIFT_V1/PERMASHIFT/g' -i "${S}"/*.[ch] "${S}"/Make.config* || die "sed failed"
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 || die "cannot write to new.IUSE"
206 + echo $EXT_PATCH_FLAGS $EXT_PATCH_FLAGS_RENAMED_EXT_NAME \
207 + $IGNORE_PATCHES | \
208 + tr ' ' '\n' |sort > "${T}"/old.IUSE || die "cannot write to old.IUSE"
209 + local DIFFS=$(diff -u "${T}"/old.IUSE "${T}"/new.IUSE|grep '^[+-][^+-]')
210 + if [[ -z ${DIFFS} ]]; then
211 + einfo "EXT_PATCH_FLAGS are 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 || die "sed fails on Makefile"
234 +
235 + ebegin "Make depend"
236 + emake .dependencies >/dev/null
237 + eend $? "make depend failed"
238 +
239 + eapply "${FILESDIR}/${P}_gcc7extpng.patch"
240 + fi
241 +
242 + eapply "${FILESDIR}/${P}_gentoo.patch"
243 + eapply "${FILESDIR}/${P}_unsignedtosigned.patch"
244 + eapply "${FILESDIR}/${P}_glibc-2.24.patch"
245 + eapply "${FILESDIR}/${P}-jpeg-9c.patch"
246 +
247 + # fix some makefile issues
248 + sed -e "s:ifndef NO_KBD:ifeq (\$(USE_KBD),1):" \
249 + -e "s:ifdef BIDI:ifeq (\$(BIDI),1):" \
250 + -e "s:ifdef SDNOTIFY:ifeq (\$(SDNOTIFY),1):" \
251 + -i "${S}"/Makefile || die "sed fails on Makefile"
252 +
253 + eapply_user
254 +
255 + add_cap CAP_UTF8
256 +
257 + add_cap CAP_IRCTRL_RUNTIME_PARAM \
258 + CAP_VFAT_RUNTIME_PARAM \
259 + CAP_CHUID \
260 + CAP_SHUTDOWN_AUTO_RETRY
261 +
262 + echo -e ${CAPS} > "${CAP_FILE}"
263 +
264 + # LINGUAS support
265 + einfo "\n \t VDR supports the LINGUAS values"
266 +
267 + lang_po
268 +
269 + einfo "\t Please set one of this values in your sytem make.conf"
270 + einfo "\t LINGUAS=\"${LING_PO}\"\n"
271 +
272 + if [[ -z ${LINGUAS} ]]; then
273 + einfo "\n \t No values in LINGUAS="
274 + einfo "\t You will get only english text on OSD \n"
275 + fi
276 +
277 + strip-linguas ${LING_PO} en
278 +}
279 +
280 +src_install() {
281 + # trick makefile not to create a videodir by supplying it with an existing
282 + # directory
283 + emake install \
284 + VIDEODIR="/" \
285 + DESTDIR="${ED}" install
286 +
287 + keepdir "${PLUGIN_LIBDIR}"
288 +
289 + # backup for plugins they don't be able to create this dir
290 + keepdir "${CONF_DIR}"/plugins
291 +
292 + if use html; then
293 + local HTML_DOCS=( *.html )
294 + fi
295 +
296 + local DOCS=( MANUAL INSTALL README* HISTORY CONTRIBUTORS )
297 +
298 + einstalldocs
299 +
300 + insinto /usr/share/vdr
301 + doins "${CAP_FILE}"
302 +
303 + if use alternatechannel; then
304 + insinto /etc/vdr
305 + doins "${FILESDIR}"/channel_alternative.conf
306 + fi
307 +
308 + chown -R vdr:vdr "${ED}/${CONF_DIR}" || die "chown failed"
309 +}
310 +
311 +pkg_postinst() {
312 +
313 + elog "\n\t---- 15 YEARS ANNIVERSARY EDITON ----\n"
314 + elog "\tA lot of thanks to Klaus Schmidinger"
315 + elog "\tfor this nice piece of Software...\n"
316 +
317 + elog "It is a good idea to run vdrplugin-rebuild now."
318 +
319 + elog "To get nice symbols in OSD we recommend to install"
320 + elog "\t1. emerge media-fonts/vdrsymbols-ttf"
321 + elog "\t2. select font VDRSymbolsSans in Setup"
322 + elog ""
323 + elog "To get an idea how to proceed now, have a look at our vdr-guide:"
324 + elog "\thttps://wiki.gentoo.org/wiki/VDR"
325 +}