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