Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-text/calibre/files/, app-text/calibre/
Date: Thu, 26 Aug 2021 23:58:35
Message-Id: 1630022178.09167c5f5f54eb30f27dcb3d580a8b3a0ab530a0.sam@gentoo
1 commit: 09167c5f5f54eb30f27dcb3d580a8b3a0ab530a0
2 Author: Marco Genasci <fedeliallalinea <AT> gmail <DOT> com>
3 AuthorDate: Mon Aug 9 16:18:32 2021 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Thu Aug 26 23:56:18 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=09167c5f
7
8 app-text/calibre: fix compilation with >=zeroconf-0.32
9
10 Backported upstream patch 4f9e83
11
12 Closes: https://bugs.gentoo.org/800233
13 Package-Manager: Portage-3.0.20, Repoman-3.0.2
14 Signed-off-by: Marco Genasci <fedeliallalinea <AT> gmail.com>
15 Closes: https://github.com/gentoo/gentoo/pull/21928
16 Signed-off-by: Sam James <sam <AT> gentoo.org>
17
18 app-text/calibre/calibre-5.16.1.ebuild | 3 ++-
19 .../calibre/files/calibre-5.16.1-zeroconf.patch | 30 ++++++++++++++++++++++
20 2 files changed, 32 insertions(+), 1 deletion(-)
21
22 diff --git a/app-text/calibre/calibre-5.16.1.ebuild b/app-text/calibre/calibre-5.16.1.ebuild
23 index 497d1187304..546774b0f93 100644
24 --- a/app-text/calibre/calibre-5.16.1.ebuild
25 +++ b/app-text/calibre/calibre-5.16.1.ebuild
26 @@ -123,7 +123,8 @@ src_prepare() {
27 # disable_plugins: walking sec-hole, wait for upstream to use GHNS interface
28 eapply \
29 "${FILESDIR}/${PN}-2.9.0-no_updates_dialog.patch" \
30 - "${FILESDIR}/${PN}-disable_plugins.patch"
31 + "${FILESDIR}/${PN}-disable_plugins.patch" \
32 + "${FILESDIR}/${P}-zeroconf.patch"
33
34 if ! has_version ">=dev-python/sip-5"; then
35 einfo "Applying SIP v4 patch because SIP v5 was not detected"
36
37 diff --git a/app-text/calibre/files/calibre-5.16.1-zeroconf.patch b/app-text/calibre/files/calibre-5.16.1-zeroconf.patch
38 new file mode 100644
39 index 00000000000..68c09d219c6
40 --- /dev/null
41 +++ b/app-text/calibre/files/calibre-5.16.1-zeroconf.patch
42 @@ -0,0 +1,30 @@
43 +diff --color -Naru a/src/calibre/devices/smart_device_app/driver.py b/src/calibre/devices/smart_device_app/driver.py
44 +--- a/src/calibre/devices/smart_device_app/driver.py 2021-08-08 08:32:03.104016444 +0200
45 ++++ b/src/calibre/devices/smart_device_app/driver.py 2021-08-08 08:33:30.699018403 +0200
46 +@@ -2040,13 +2040,6 @@
47 + # Function to monkeypatch zeroconf to remove the 15 character name length restriction.
48 + # Copied from https://github.com/jstasiak/python-zeroconf version 0.28.1
49 +
50 +-
51 +-from zeroconf import (BadTypeInNameException, _HAS_A_TO_Z,
52 +- _HAS_ONLY_A_TO_Z_NUM_HYPHEN_UNDERSCORE,
53 +- _HAS_ASCII_CONTROL_CHARS,
54 +- _HAS_ONLY_A_TO_Z_NUM_HYPHEN)
55 +-
56 +-
57 + def service_type_name(type_: str, *, allow_underscores: bool = False) -> str:
58 + """
59 + Validate a fully qualified service name, instance or subtype. [rfc6763]
60 +@@ -2087,6 +2080,12 @@
61 + :param type_: Type, SubType or service name to validate
62 + :return: fully qualified service name (eg: _http._tcp.local.)
63 + """
64 ++
65 ++ from zeroconf import (BadTypeInNameException, _HAS_A_TO_Z,
66 ++ _HAS_ONLY_A_TO_Z_NUM_HYPHEN_UNDERSCORE,
67 ++ _HAS_ASCII_CONTROL_CHARS,
68 ++ _HAS_ONLY_A_TO_Z_NUM_HYPHEN)
69 ++
70 + if not (type_.endswith('._tcp.local.') or type_.endswith('._udp.local.')):
71 + raise BadTypeInNameException("Type '%s' must end with '._tcp.local.' or '._udp.local.'" % type_)
72 +