summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2021-11-02 22:44:39 +0000
committerSam James <sam@gentoo.org>2021-11-02 22:45:19 +0000
commite4b531064e3ccf757e231d2073cbe4a6f15292ef (patch)
treeccaf4f68810138e902d5159b6aef624876b33d33 /app-text/calibre
parentapp-text/calibre: drop unused eclasses (diff)
downloadgentoo-e4b531064e3ccf757e231d2073cbe4a6f15292ef.tar.gz
gentoo-e4b531064e3ccf757e231d2073cbe4a6f15292ef.tar.bz2
gentoo-e4b531064e3ccf757e231d2073cbe4a6f15292ef.zip
app-text/calibre: tidy up ebuild further
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'app-text/calibre')
-rw-r--r--app-text/calibre/calibre-5.31.1.ebuild40
-rw-r--r--app-text/calibre/files/calibre-5.31.0-qt-image-test.patch11
2 files changed, 36 insertions, 15 deletions
diff --git a/app-text/calibre/calibre-5.31.1.ebuild b/app-text/calibre/calibre-5.31.1.ebuild
index 2a71b9801756..283305d4191a 100644
--- a/app-text/calibre/calibre-5.31.1.ebuild
+++ b/app-text/calibre/calibre-5.31.1.ebuild
@@ -115,13 +115,23 @@ BDEPEND="$(python_gen_cond_dep '
virtual/pkgconfig"
PATCHES=(
- # no_updates: do not annoy user with "new version is availible all the time
+ # Don't prompt the user for updates - they've installed via
+ # an ebuild.
"${FILESDIR}/${PN}-2.9.0-no_updates_dialog.patch"
# Skip calling a binary (JxrDecApp) from libjxr which is used for tests
# We don't (yet?) package libjxr and it seems to be dead upstream
# (last commit in 2017)
"${FILESDIR}/${PN}-5.31.0-jxr-test.patch"
+
+ # TODO:
+ # test_qt tries to load a bunch of images using Qt and it currently fails
+ # due to some presumably missing dependencies. This is important and
+ # we need to look into it, but at time of writing, none of the tests
+ # are even bring run, so I'd like to return to this later.
+ # We don't want to skip test_qt entirely, so just skip this particular
+ # assert for now.
+ "${FILESDIR}/${PN}-5.31.0-qt-image-test.patch"
)
pkg_pretend() {
@@ -135,6 +145,18 @@ pkg_pretend() {
src_prepare() {
default
+ # Warning:
+ #
+ # While it might be rather tempting to add yet another sed here,
+ # please don't. There have been several bugs in Gentoo's packaging
+ # of calibre from seds-which-become-stale. Please consider
+ # creating a patch instead, but in any case, run the test suite
+ # and ensure it passes.
+ #
+ # If in doubt about a problem, checking Fedora or Arch Linux's packaging
+ # is recommended, as Arch Linux's PKGBUILD is maintained by a Calibre
+ # contributor. Or just ask them.
+
# Fix outdated version constant.
#sed -e "s#\\(^numeric_version =\\).*#\\1 (${PV//./, })#" \
# -i src/calibre/constants.py || \
@@ -163,17 +185,6 @@ src_prepare() {
'-i', os.path.join(os.path.basename(src_dir), 'Makefile')])" \
-e "s|open(self.j(bdir, '.qmake.conf'), 'wb').close()|open(self.j(bdir, '.qmake.conf'), 'wb').write(b'QMAKE_LFLAGS += ${LDFLAGS}')|" \
-i setup/build.py || die "sed failed to patch build.py"
-
- # TODO:
- # test_qt tries to load a bunch of images using Qt and it currently fails
- # due to some presumably missing dependencies. This is important and
- # we need to look into it, but at time of writing, none of the tests
- # are even bring run, so I'd like to return to this later.
- # We don't want to skip test_qt entirely, so just skip this particular
- # assert for now.
- sed -i -e \
- "/Qt doesn't seem to be able to load some of its image plugins. Available plugins:/d" \
- src/calibre/test_build.py || die
}
src_compile() {
@@ -189,9 +200,8 @@ src_test() {
# - test_chardet (unpackaged Python dependency: cchardet)
# - test_unrar (unpackaged Python dependency: unrardll)
#
- # Note that we currently have a hack for test_qt in src_prepare!
- # CALIBRE_DEVELOP_FROM="${S}/src"
- # PYTHONPATH=${S}/calibre/utils:${S}/src/calibre:${S}/src${PYTHONPATH:+:}${PYTHONPATH} \
+ # Note that we currently have a hack to skip one part of test_qt!
+ # See PATCHES for more.
CALIBRE_PY3_PORT=1 ${PYTHON} setup.py test \
--exclude-test-name 7z \
--exclude-test-name test_chardet \
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
new file mode 100644
index 000000000000..5c38e2d6a528
--- /dev/null
+++ b/app-text/calibre/files/calibre-5.31.0-qt-image-test.patch
@@ -0,0 +1,11 @@
+
+--- a/src/calibre/test_build.py
++++ b/src/calibre/test_build.py
+@@ -306,7 +306,6 @@ class BuildTest(unittest.TestCase):
+ # then it is a distro problem.
+ fmts = set(map(lambda x: x.data().decode('utf-8'), QImageReader.supportedImageFormats())) # no2to3
+ testf = {'jpg', 'png', 'svg', 'ico', 'gif', 'webp'}
+- self.assertEqual(testf.intersection(fmts), testf, "Qt doesn't seem to be able to load some of its image plugins. Available plugins: %s" % fmts)
+ data = P('images/blank.png', allow_user_override=False, data=True)
+ img = image_from_data(data)
+ image_from_data(P('catalog/mastheadImage.gif', allow_user_override=False, data=True))