Gentoo Archives: gentoo-commits

From: James Le Cuirot <chewi@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: media-tv/tvheadend/, media-tv/tvheadend/files/
Date: Sat, 02 Nov 2019 12:04:43
Message-Id: 1572696258.1d77ca72c6de413343b61c2a4658b20f2fda8fc4.chewi@gentoo
1 commit: 1d77ca72c6de413343b61c2a4658b20f2fda8fc4
2 Author: James Le Cuirot <chewi <AT> gentoo <DOT> org>
3 AuthorDate: Sat Nov 2 11:52:01 2019 +0000
4 Commit: James Le Cuirot <chewi <AT> gentoo <DOT> org>
5 CommitDate: Sat Nov 2 12:04:18 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1d77ca72
7
8 media-tv/tvheadend: Add Python 3 and GCC 9 patches from RPM Fusion
9
10 Package-Manager: Portage-2.3.78, Repoman-2.3.17
11 Signed-off-by: James Le Cuirot <chewi <AT> gentoo.org>
12
13 .../tvheadend/files/tvheadend-4.2.7-python3.patch | 91 ++++++++++++++++++++++
14 .../tvheadend/files/tvheadend-4.2.8-gcc9.patch | 36 +++++++++
15 media-tv/tvheadend/tvheadend-4.2.8.ebuild | 2 +
16 media-tv/tvheadend/tvheadend-9999.ebuild | 1 +
17 4 files changed, 130 insertions(+)
18
19 diff --git a/media-tv/tvheadend/files/tvheadend-4.2.7-python3.patch b/media-tv/tvheadend/files/tvheadend-4.2.7-python3.patch
20 new file mode 100644
21 index 00000000000..752b17ba08f
22 --- /dev/null
23 +++ b/media-tv/tvheadend/files/tvheadend-4.2.7-python3.patch
24 @@ -0,0 +1,91 @@
25 +diff -up ./lib/py/tvh/tsreader.py.orig ./lib/py/tvh/tsreader.py
26 +--- ./lib/py/tvh/tsreader.py.orig 2018-10-08 14:37:05.000000000 +0200
27 ++++ ./lib/py/tvh/tsreader.py 2018-10-15 11:53:53.766850060 +0200
28 +@@ -31,7 +31,7 @@ def encode_utf8(c):
29 +
30 + def conv_8859(tnum, data):
31 + r = u''
32 +- print 'TBL %d' % tnum
33 ++ print('TBL %d' % tnum)
34 + tbl = conv_8859_table[tnum]
35 + for c in data:
36 + if ord(c) <= 0x7f:
37 +@@ -46,8 +46,8 @@ def conv_8859(tnum, data):
38 +
39 +
40 + def dvb_convert_string(data, conv):
41 +- print 'convert(%d)' % conv
42 +- print repr(data)
43 ++ print('convert(%d)' % conv)
44 ++ print(repr(data))
45 + if not conv:
46 + return data
47 + return conv_8859(conv, data)
48 +@@ -83,8 +83,8 @@ class TsSection(object):
49 + # print self.tid, self.len, len(data)
50 +
51 + def process(self):
52 +- print 'TS Section:'
53 +- print self.tid, self.len, len(self.data)
54 ++ print('TS Section:')
55 ++ print(self.tid, self.len, len(self.data))
56 + # print str2hex(self.data, 16)
57 + # print self.data
58 +
59 +@@ -112,7 +112,7 @@ class TsSection(object):
60 + if l + 1 > dlen:
61 + return (None, -1)
62 + c = ord(data[1])
63 +- print c
64 ++ print(c)
65 + conv = None
66 + if c == 0:
67 + return (None, -1)
68 +@@ -162,14 +162,14 @@ class TsSection(object):
69 + eid = (hdr[0] << 8) + hdr[1]
70 + start = dvb_convert_date(hdr[2:])
71 +
72 +- print 'process event (%d):' % dllen
73 +- print ' EID : %d' % eid
74 +- print ' START : %d' % start
75 ++ print('process event (%d):' % dllen)
76 ++ print(' EID : %d' % eid)
77 ++ print(' START : %d' % start)
78 +
79 + while dllen > 2:
80 + dtag = ord(data[0])
81 + dlen = ord(data[1])
82 +- print 'dtag = 0x%02x, dlen = %d' % (dtag, dlen)
83 ++ print('dtag = 0x%02x, dlen = %d' % (dtag, dlen))
84 +
85 + dllen = dllen - 2
86 + data = data[2:]
87 +@@ -178,8 +178,8 @@ class TsSection(object):
88 +
89 + if dtag == 0x4d:
90 + (title, summary) = self.short_event(data, dlen)
91 +- print ' TITLE : %s' % title
92 +- print ' SUMMARY : %s' % summary
93 ++ print(' TITLE : %s' % title)
94 ++ print(' SUMMARY : %s' % summary)
95 +
96 + dllen = dllen - dlen
97 + data = data[dlen:]
98 +@@ -216,7 +216,7 @@ if __name__ == '__main__':
99 + # Complete?
100 + if cur:
101 + if len(cur.data) >= cur.len:
102 +- print 'Process Section:'
103 ++ print('Process Section:')
104 + # try:
105 + cur.process()
106 + # except: pass
107 +@@ -224,7 +224,7 @@ if __name__ == '__main__':
108 + print
109 + sys.exit(0)
110 + else:
111 +- print 'waiting for %d bytes' % (cur.len - len(cur.data))
112 ++ print('waiting for %d bytes' % (cur.len - len(cur.data)))
113 +
114 + # Next
115 + if nxt:
116
117 diff --git a/media-tv/tvheadend/files/tvheadend-4.2.8-gcc9.patch b/media-tv/tvheadend/files/tvheadend-4.2.8-gcc9.patch
118 new file mode 100644
119 index 00000000000..9ccadb44c42
120 --- /dev/null
121 +++ b/media-tv/tvheadend/files/tvheadend-4.2.8-gcc9.patch
122 @@ -0,0 +1,36 @@
123 +diff -up ./src/plumbing/transcoding.c.orig ./src/plumbing/transcoding.c
124 +--- ./src/plumbing/transcoding.c.orig 2019-01-12 09:58:47.000000000 +0100
125 ++++ ./src/plumbing/transcoding.c 2019-03-12 15:49:24.922314869 +0100
126 +@@ -1804,7 +1804,7 @@ transcoder_init_video(transcoder_t *t, s
127 + char *str, *token, *saveptr, codec_list[sizeof(tp->tp_src_vcodec)];
128 + int codec_match=0;
129 +
130 +- strncpy(codec_list, tp->tp_src_vcodec, sizeof(tp->tp_src_vcodec)-1);
131 ++ memcpy(codec_list, tp->tp_src_vcodec, sizeof(tp->tp_src_vcodec)-1);
132 +
133 + tvhtrace(LS_TRANSCODE, "src_vcodec=\"%s\" ssc_type=%d (%s)\n",
134 + tp->tp_src_vcodec,
135 +@@ -2130,10 +2130,10 @@ transcoder_set_properties(streaming_targ
136 + transcoder_t *t = (transcoder_t *)st;
137 + transcoder_props_t *tp = &t->t_props;
138 +
139 +- strncpy(tp->tp_vcodec, props->tp_vcodec, sizeof(tp->tp_vcodec)-1);
140 +- strncpy(tp->tp_vcodec_preset, props->tp_vcodec_preset, sizeof(tp->tp_vcodec_preset)-1);
141 +- strncpy(tp->tp_acodec, props->tp_acodec, sizeof(tp->tp_acodec)-1);
142 +- strncpy(tp->tp_scodec, props->tp_scodec, sizeof(tp->tp_scodec)-1);
143 ++ memcpy(tp->tp_vcodec, props->tp_vcodec, sizeof(tp->tp_vcodec)-1);
144 ++ memcpy(tp->tp_vcodec_preset, props->tp_vcodec_preset, sizeof(tp->tp_vcodec_preset)-1);
145 ++ memcpy(tp->tp_acodec, props->tp_acodec, sizeof(tp->tp_acodec)-1);
146 ++ memcpy(tp->tp_scodec, props->tp_scodec, sizeof(tp->tp_scodec)-1);
147 + tp->tp_channels = props->tp_channels;
148 + tp->tp_vbitrate = props->tp_vbitrate;
149 + tp->tp_abitrate = props->tp_abitrate;
150 +@@ -2141,7 +2141,7 @@ transcoder_set_properties(streaming_targ
151 +
152 + memcpy(tp->tp_language, props->tp_language, 4);
153 +
154 +- strncpy(tp->tp_src_vcodec, props->tp_src_vcodec, sizeof(tp->tp_src_vcodec)-1);
155 ++ memcpy(tp->tp_src_vcodec, props->tp_src_vcodec, sizeof(tp->tp_src_vcodec)-1);
156 + }
157 +
158 +
159
160 diff --git a/media-tv/tvheadend/tvheadend-4.2.8.ebuild b/media-tv/tvheadend/tvheadend-4.2.8.ebuild
161 index 0673c7bc7a3..4a49b1460b5 100644
162 --- a/media-tv/tvheadend/tvheadend-4.2.8.ebuild
163 +++ b/media-tv/tvheadend/tvheadend-4.2.8.ebuild
164 @@ -49,6 +49,8 @@ PATCHES=(
165 "${FILESDIR}"/${PN}-4.0.9-use_system_queue.patch
166 "${FILESDIR}"/${PN}-4.2.1-hdhomerun.patch
167 "${FILESDIR}"/${PN}-4.2.2-dtv_scan_tables.patch
168 + "${FILESDIR}"/${PN}-4.2.7-python3.patch
169 + "${FILESDIR}"/${PN}-4.2.8-gcc9.patch
170 )
171
172 DOCS=( README.md )
173
174 diff --git a/media-tv/tvheadend/tvheadend-9999.ebuild b/media-tv/tvheadend/tvheadend-9999.ebuild
175 index 7fa2c9c7f25..692d4ec897c 100644
176 --- a/media-tv/tvheadend/tvheadend-9999.ebuild
177 +++ b/media-tv/tvheadend/tvheadend-9999.ebuild
178 @@ -59,6 +59,7 @@ PATCHES=(
179 "${FILESDIR}"/${PN}-4.0.9-use_system_queue.patch
180 "${FILESDIR}"/${PN}-4.3-hdhomerun.patch
181 "${FILESDIR}"/${PN}-4.2.2-dtv_scan_tables.patch
182 + "${FILESDIR}"/${PN}-4.2.7-python3.patch
183 )
184
185 DOCS=( README.md )