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: Tue, 02 Nov 2021 22:45:30
Message-Id: 1635893119.e4b531064e3ccf757e231d2073cbe4a6f15292ef.sam@gentoo
1 commit: e4b531064e3ccf757e231d2073cbe4a6f15292ef
2 Author: Sam James <sam <AT> gentoo <DOT> org>
3 AuthorDate: Tue Nov 2 22:44:39 2021 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Tue Nov 2 22:45:19 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e4b53106
7
8 app-text/calibre: tidy up ebuild further
9
10 Signed-off-by: Sam James <sam <AT> gentoo.org>
11
12 app-text/calibre/calibre-5.31.1.ebuild | 40 ++++++++++++++--------
13 .../files/calibre-5.31.0-qt-image-test.patch | 11 ++++++
14 2 files changed, 36 insertions(+), 15 deletions(-)
15
16 diff --git a/app-text/calibre/calibre-5.31.1.ebuild b/app-text/calibre/calibre-5.31.1.ebuild
17 index 2a71b980175..283305d4191 100644
18 --- a/app-text/calibre/calibre-5.31.1.ebuild
19 +++ b/app-text/calibre/calibre-5.31.1.ebuild
20 @@ -115,13 +115,23 @@ BDEPEND="$(python_gen_cond_dep '
21 virtual/pkgconfig"
22
23 PATCHES=(
24 - # no_updates: do not annoy user with "new version is availible all the time
25 + # Don't prompt the user for updates - they've installed via
26 + # an ebuild.
27 "${FILESDIR}/${PN}-2.9.0-no_updates_dialog.patch"
28
29 # Skip calling a binary (JxrDecApp) from libjxr which is used for tests
30 # We don't (yet?) package libjxr and it seems to be dead upstream
31 # (last commit in 2017)
32 "${FILESDIR}/${PN}-5.31.0-jxr-test.patch"
33 +
34 + # TODO:
35 + # test_qt tries to load a bunch of images using Qt and it currently fails
36 + # due to some presumably missing dependencies. This is important and
37 + # we need to look into it, but at time of writing, none of the tests
38 + # are even bring run, so I'd like to return to this later.
39 + # We don't want to skip test_qt entirely, so just skip this particular
40 + # assert for now.
41 + "${FILESDIR}/${PN}-5.31.0-qt-image-test.patch"
42 )
43
44 pkg_pretend() {
45 @@ -135,6 +145,18 @@ pkg_pretend() {
46 src_prepare() {
47 default
48
49 + # Warning:
50 + #
51 + # While it might be rather tempting to add yet another sed here,
52 + # please don't. There have been several bugs in Gentoo's packaging
53 + # of calibre from seds-which-become-stale. Please consider
54 + # creating a patch instead, but in any case, run the test suite
55 + # and ensure it passes.
56 + #
57 + # If in doubt about a problem, checking Fedora or Arch Linux's packaging
58 + # is recommended, as Arch Linux's PKGBUILD is maintained by a Calibre
59 + # contributor. Or just ask them.
60 +
61 # Fix outdated version constant.
62 #sed -e "s#\\(^numeric_version =\\).*#\\1 (${PV//./, })#" \
63 # -i src/calibre/constants.py || \
64 @@ -163,17 +185,6 @@ src_prepare() {
65 '-i', os.path.join(os.path.basename(src_dir), 'Makefile')])" \
66 -e "s|open(self.j(bdir, '.qmake.conf'), 'wb').close()|open(self.j(bdir, '.qmake.conf'), 'wb').write(b'QMAKE_LFLAGS += ${LDFLAGS}')|" \
67 -i setup/build.py || die "sed failed to patch build.py"
68 -
69 - # TODO:
70 - # test_qt tries to load a bunch of images using Qt and it currently fails
71 - # due to some presumably missing dependencies. This is important and
72 - # we need to look into it, but at time of writing, none of the tests
73 - # are even bring run, so I'd like to return to this later.
74 - # We don't want to skip test_qt entirely, so just skip this particular
75 - # assert for now.
76 - sed -i -e \
77 - "/Qt doesn't seem to be able to load some of its image plugins. Available plugins:/d" \
78 - src/calibre/test_build.py || die
79 }
80
81 src_compile() {
82 @@ -189,9 +200,8 @@ src_test() {
83 # - test_chardet (unpackaged Python dependency: cchardet)
84 # - test_unrar (unpackaged Python dependency: unrardll)
85 #
86 - # Note that we currently have a hack for test_qt in src_prepare!
87 - # CALIBRE_DEVELOP_FROM="${S}/src"
88 - # PYTHONPATH=${S}/calibre/utils:${S}/src/calibre:${S}/src${PYTHONPATH:+:}${PYTHONPATH} \
89 + # Note that we currently have a hack to skip one part of test_qt!
90 + # See PATCHES for more.
91 CALIBRE_PY3_PORT=1 ${PYTHON} setup.py test \
92 --exclude-test-name 7z \
93 --exclude-test-name test_chardet \
94
95 diff --git a/app-text/calibre/files/calibre-5.31.0-qt-image-test.patch b/app-text/calibre/files/calibre-5.31.0-qt-image-test.patch
96 new file mode 100644
97 index 00000000000..5c38e2d6a52
98 --- /dev/null
99 +++ b/app-text/calibre/files/calibre-5.31.0-qt-image-test.patch
100 @@ -0,0 +1,11 @@
101 +
102 +--- a/src/calibre/test_build.py
103 ++++ b/src/calibre/test_build.py
104 +@@ -306,7 +306,6 @@ class BuildTest(unittest.TestCase):
105 + # then it is a distro problem.
106 + fmts = set(map(lambda x: x.data().decode('utf-8'), QImageReader.supportedImageFormats())) # no2to3
107 + testf = {'jpg', 'png', 'svg', 'ico', 'gif', 'webp'}
108 +- self.assertEqual(testf.intersection(fmts), testf, "Qt doesn't seem to be able to load some of its image plugins. Available plugins: %s" % fmts)
109 + data = P('images/blank.png', allow_user_override=False, data=True)
110 + img = image_from_data(data)
111 + image_from_data(P('catalog/mastheadImage.gif', allow_user_override=False, data=True))