Gentoo Archives: gentoo-commits

From: "Jörg Bornkessel" <hd_brummy@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: media-video/vdr/, media-video/vdr/files/
Date: Mon, 02 Mar 2020 20:05:50
Message-Id: 1583179515.1a77777812a5edfdb1f6a9676fc035fe91dc1032.hd_brummy@gentoo
1 commit: 1a77777812a5edfdb1f6a9676fc035fe91dc1032
2 Author: Joerg Bornkessel <hd_brummy <AT> gentoo <DOT> org>
3 AuthorDate: Mon Mar 2 20:05:15 2020 +0000
4 Commit: Jörg Bornkessel <hd_brummy <AT> gentoo <DOT> org>
5 CommitDate: Mon Mar 2 20:05:15 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1a777778
7
8 media-video/vdr: segfault in ttxtsub patch uses fixed
9
10 reported by several users
11 in IRC #gentoo-vdr
12 vdr-portal.de
13
14 Package-Manager: Portage-2.3.90, Repoman-2.3.20
15 Signed-off-by: Joerg Bornkessel <hd_brummy <AT> gentoo.org>
16
17 .../vdr/files/vdr-2.4.1_ttxtsubs_segfault.patch | 49 +++++
18 media-video/vdr/vdr-2.4.1-r2.ebuild | 198 +++++++++++++++++++++
19 2 files changed, 247 insertions(+)
20
21 diff --git a/media-video/vdr/files/vdr-2.4.1_ttxtsubs_segfault.patch b/media-video/vdr/files/vdr-2.4.1_ttxtsubs_segfault.patch
22 new file mode 100644
23 index 00000000000..deba0197961
24 --- /dev/null
25 +++ b/media-video/vdr/files/vdr-2.4.1_ttxtsubs_segfault.patch
26 @@ -0,0 +1,49 @@
27 +fixing segfault, reported on IRC #gentoo-vdr & vdr-portal.de
28 +https://www.vdr-portal.de/forum/index.php?thread/132017-videotextuntertitel-f%C3%BCr-vdr-2-4-0/&postID=1306478#post1306478
29 +
30 +Signed-Off-By: Joerg Bornkessel <hd_brummy@g.o> ( 2020 Mar 02 )
31 +diff -Naur vdr-2.4.1.orig/channels.c vdr-2.4.1/channels.c
32 +--- vdr-2.4.1.orig/channels.c 2020-03-02 19:52:51.052496538 +0100
33 ++++ vdr-2.4.1/channels.c 2020-03-02 19:54:05.096496538 +0100
34 +@@ -429,7 +429,7 @@
35 + return Modified;
36 + }
37 +
38 +-void cChannel::SetTeletextSubtitlePages(tTeletextSubtitlePage pages[], int numberOfPages)
39 ++bool cChannel::SetTeletextSubtitlePages(tTeletextSubtitlePage pages[], int numberOfPages)
40 + {
41 + int mod = CHANNELMOD_NONE;
42 + LOCK_CHANNELS_WRITE;
43 +@@ -447,7 +447,7 @@
44 + totalTtxtSubtitlePages++;
45 + }
46 + modification |= mod;
47 +- Channels->SetModified();
48 ++ return true;
49 + }
50 +
51 + void cChannel::SetSeen(void)
52 +diff -Naur vdr-2.4.1.orig/channels.h vdr-2.4.1/channels.h
53 +--- vdr-2.4.1.orig/channels.h 2020-03-02 19:52:51.052496538 +0100
54 ++++ vdr-2.4.1/channels.h 2020-03-02 19:54:31.745496538 +0100
55 +@@ -212,7 +212,7 @@
56 + bool SetName(const char *Name, const char *ShortName, const char *Provider);
57 + bool SetPortalName(const char *PortalName);
58 + bool SetPids(int Vpid, int Ppid, int Vtype, int *Apids, int *Atypes, char ALangs[][MAXLANGCODE2], int *Dpids, int *Dtypes, char DLangs[][MAXLANGCODE2], int *Spids, char SLangs[][MAXLANGCODE2], int Tpid);
59 +- void SetTeletextSubtitlePages(tTeletextSubtitlePage pages[], int numberOfPages);
60 ++ bool SetTeletextSubtitlePages(tTeletextSubtitlePage pages[], int numberOfPages);
61 + bool SetCaIds(const int *CaIds); // list must be zero-terminated
62 + bool SetCaDescriptors(int Level);
63 + bool SetLinkChannels(cLinkChannels *LinkChannels);
64 +diff -Naur vdr-2.4.1.orig/pat.c vdr-2.4.1/pat.c
65 +--- vdr-2.4.1.orig/pat.c 2020-03-02 19:52:51.053496538 +0100
66 ++++ vdr-2.4.1/pat.c 2020-03-02 19:55:40.819496538 +0100
67 +@@ -649,7 +649,7 @@
68 + if (manualPageNumber)
69 + TeletextSubtitlePages[NumTPages++] = tTeletextSubtitlePage(manualPageNumber);
70 + }
71 +- Channel->SetTeletextSubtitlePages(TeletextSubtitlePages, NumTPages);
72 ++ ChannelsModified |= Channel->SetTeletextSubtitlePages(TeletextSubtitlePages, NumTPages);
73 + ChannelsModified |= Channel->SetCaIds(CaDescriptors->CaIds());
74 + ChannelsModified |= Channel->SetSubtitlingDescriptors(SubtitlingTypes, CompositionPageIds, AncillaryPageIds);
75 + }
76
77 diff --git a/media-video/vdr/vdr-2.4.1-r2.ebuild b/media-video/vdr/vdr-2.4.1-r2.ebuild
78 new file mode 100644
79 index 00000000000..53df602b471
80 --- /dev/null
81 +++ b/media-video/vdr/vdr-2.4.1-r2.ebuild
82 @@ -0,0 +1,198 @@
83 +# Copyright 2020 Gentoo Authors
84 +# Distributed under the terms of the GNU General Public License v2
85 +
86 +EAPI=7
87 +
88 +inherit eutils flag-o-matic multilib toolchain-funcs
89 +
90 +DESCRIPTION="Video Disk Recorder - turns a pc into a powerful set top box for DVB"
91 +HOMEPAGE="http://www.tvdr.de/"
92 +SRC_URI="ftp://ftp.tvdr.de/vdr/${P}.tar.bz2
93 + mainmenuhooks? ( http://vdr.websitec.de/download/${PN}/${P}/${P}_mainmenuhook-1.0.1.patch.bz2 )
94 + menuorg? ( https://projects.vdr-developer.org/projects/plg-menuorg/repository/revisions/master/raw/vdr-patch/vdr-menuorg-2.3.x.diff )
95 + naludump? ( http://www.udo-richter.de/vdr/files/vdr-2.1.5-naludump-0.1.diff )
96 + pinplugin? ( http://vdr.websitec.de/download/${PN}/${P}/${P}_pinplugin.patch.bz2 )
97 + ttxtsubs? ( http://vdr.websitec.de/download/${PN}/${P}/${PN}-2.4.0-ttxtsubs.patch.bz2 )"
98 +
99 +LICENSE="GPL-2+"
100 +SLOT="0"
101 +KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~x86"
102 +IUSE="bidi debug demoplugins html keyboard mainmenuhooks menuorg naludump pinplugin systemd ttxtsubs verbose"
103 +
104 +COMMON_DEPEND="
105 + virtual/jpeg:*
106 + sys-libs/libcap
107 + >=media-libs/fontconfig-2.4.2
108 + >=media-libs/freetype-2"
109 +DEPEND="${COMMON_DEPEND}
110 + >=virtual/linuxtv-dvb-headers-5.3"
111 +RDEPEND="${COMMON_DEPEND}
112 + dev-lang/perl
113 + media-tv/gentoo-vdr-scripts
114 + media-fonts/corefonts
115 + bidi? ( dev-libs/fribidi )
116 + systemd? ( sys-apps/systemd )"
117 +BDEPEND="sys-devel/gettext"
118 +
119 +REQUIRED_USE="pinplugin? ( !mainmenuhooks )"
120 +
121 +CONF_DIR="/etc/vdr"
122 +CAP_FILE="${S}/capabilities.sh"
123 +CAPS="# Capabilities of the vdr-executable for use by startscript etc."
124 +
125 +pkg_setup() {
126 + use debug && append-flags -g
127 +
128 + PLUGIN_LIBDIR="/usr/$(get_libdir)/vdr/plugins"
129 +
130 + tc-export CC CXX AR
131 +}
132 +
133 +add_cap() {
134 + local arg
135 + for arg; do
136 + CAPS="${CAPS}\n${arg}=1"
137 + done
138 +}
139 +
140 +lang_po() {
141 + LING_PO=$( ls ${S}/po | sed -e "s:.po::g" | cut -d_ -f1 | tr \\\012 ' ' )
142 +}
143 +
144 +src_configure() {
145 + # support languages, written from right to left
146 + export "BIDI=$(usex bidi 1 0)"
147 + # systemd notification support
148 + export "SDNOTIFY=$(usex systemd 1 0)"
149 + # with/without keyboard
150 + export "USE_KBD=$(usex keyboard 1 0)"
151 + # detailed compile output for debug
152 + export "VERBOSE=$(usex verbose 1 0)"
153 +}
154 +
155 +src_prepare() {
156 + # apply maintenance-patches
157 + ebegin "Changing paths for gentoo"
158 +
159 + local DVBDIR=/usr/include
160 + local i
161 + for i in ${DVB_HEADER_PATH} /usr/include/v4l-dvb-hg /usr/include; do
162 + [[ -d ${i} ]] || continue
163 + if [[ -f ${i}/linux/dvb/dmx.h ]]; then
164 + einfo "Found DVB header files in ${i}"
165 + DVBDIR=${i}
166 + break
167 + fi
168 + done
169 +
170 + # checking for s2api headers
171 + local api_version
172 + api_version=$(awk -F' ' '/define DVB_API_VERSION / {print $3}' "${DVBDIR}"/linux/dvb/version.h)
173 + api_version=${api_version}*$(awk -F' ' '/define DVB_API_VERSION_MINOR / {print $3}' "${DVBDIR}"/linux/dvb/version.h)
174 +
175 + if [[ ${api_version:-0} -lt 5*3 ]]; then
176 + eerror "DVB header files do not contain s2api support or too old for ${P}"
177 + eerror "You cannot compile VDR against old dvb-header"
178 + die "DVB headers too old"
179 + fi
180 +
181 + cat > Make.config <<-EOT || die "cannot write to Make.config"
182 + #
183 + # Generated by ebuild ${PF}
184 + #
185 + PREFIX = /usr
186 + DVBDIR = ${DVBDIR}
187 + PLUGINLIBDIR = ${PLUGIN_LIBDIR}
188 + CONFDIR = ${CONF_DIR}
189 + ARGSDIR = \$(CONFDIR)/conf.d
190 + VIDEODIR = /var/vdr/video
191 + LOCDIR = \$(PREFIX)/share/locale
192 + INCDIR = \$(PREFIX)/include
193 +
194 + DEFINES += -DCONFDIR=\"\$(CONFDIR)\"
195 + INCLUDES += -I\$(DVBDIR)
196 +
197 + # >=vdr-1.7.36-r1; parameter only used for compiletime on vdr
198 + # PLUGINLIBDIR (plugin Makefile old) = LIBDIR (plugin Makefile new)
199 + LIBDIR = ${PLUGIN_LIBDIR}
200 + PCDIR = /usr/$(get_libdir)/pkgconfig
201 +
202 + EOT
203 + eend 0
204 +
205 + eapply "${FILESDIR}/${P}_gentoo.patch"
206 + eapply "${FILESDIR}/vdr-2.2.0-jpeg-9c.patch"
207 + use demoplugins || eapply "${FILESDIR}/vdr-2.4_remove_plugins.patch"
208 + eapply "${FILESDIR}/${P}_makefile-variables.patch"
209 + eapply "${FILESDIR}/${P}_glibc-2.31.patch"
210 +
211 + use naludump && eapply "${DISTDIR}/${PN}-2.1.5-naludump-0.1.diff"
212 +# # requested to upstream for new patch
213 +# use permashift && eapply "${DISTDIR}/vdr-2.3-patch-for-permashift.diff"
214 + use pinplugin && eapply "${WORKDIR}/${P}_pinplugin.patch"
215 + use ttxtsubs && eapply "${WORKDIR}/${PN}-2.4.0-ttxtsubs.patch"
216 + use ttxtsubs && eapply "${FILESDIR}/${P}_ttxtsubs_segfault.patch"
217 + use menuorg && eapply "${DISTDIR}/vdr-menuorg-2.3.x.diff"
218 + use mainmenuhooks && eapply "${WORKDIR}/${P}_mainmenuhook-1.0.1.patch"
219 +
220 + add_cap CAP_UTF8 \
221 + CAP_IRCTRL_RUNTIME_PARAM \
222 + CAP_VFAT_RUNTIME_PARAM \
223 + CAP_CHUID \
224 + CAP_SHUTDOWN_AUTO_RETRY
225 +
226 + echo -e ${CAPS} > "${CAP_FILE}" || die "cannot write to CAP_FILE"
227 +
228 + # LINGUAS support
229 + einfo "\n \t VDR supports the LINGUAS values"
230 +
231 + lang_po
232 +
233 + einfo "\t Please set one of this values in your sytem make.conf"
234 + einfo "\t LINGUAS=\"${LING_PO}\"\n"
235 +
236 + if [[ -z ${LINGUAS} ]]; then
237 + einfo "\n \t No values in LINGUAS="
238 + einfo "\t You will get only english text on OSD \n"
239 + fi
240 +
241 + strip-linguas ${LING_PO} en
242 +
243 + default
244 +}
245 +
246 +src_install() {
247 + # trick the makefile to not create a VIDEODIR by supplying it with an
248 + # existing directory
249 + emake VIDEODIR="/" DESTDIR="${ED}" install
250 +
251 + keepdir "${PLUGIN_LIBDIR}"
252 +
253 + # backup for plugins they don't be able to create this dir
254 + keepdir "${CONF_DIR}/plugins"
255 +
256 + if use html; then
257 + local HTML_DOCS=( *.html )
258 + fi
259 + local DOCS=( MANUAL INSTALL README* HISTORY CONTRIBUTORS UPDATE-2* )
260 + einstalldocs
261 +
262 + insinto /usr/share/vdr
263 + doins "${CAP_FILE}"
264 +
265 + fowners vdr:vdr "${CONF_DIR}" -R
266 +}
267 +
268 +pkg_postinst() {
269 + elog "Please read the /usr/share/doc/${PF}/UPDATE-2.4"
270 + elog "for major changes in this version\n"
271 +
272 + elog "It is a good idea to run vdrplugin-rebuild now.\n"
273 +
274 + elog "To get nice symbols in OSD we recommend to install"
275 + elog "\t1. emerge media-fonts/vdrsymbols-ttf"
276 + elog "\t2. select font VDRSymbolsSans in Setup\n"
277 +
278 + elog "To get an idea how to proceed now, have a look at our vdr-guide:"
279 + elog "\thttps://wiki.gentoo.org/wiki/VDR"
280 +}