public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: app-text/calibre/files/, app-text/calibre/
@ 2017-04-24  0:05 Zac Medico
  0 siblings, 0 replies; 13+ messages in thread
From: Zac Medico @ 2017-04-24  0:05 UTC (permalink / raw
  To: gentoo-commits

commit:     ad7760cb092e53a642eae2952ad277b01ddaab66
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Apr 23 23:58:11 2017 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Apr 24 00:05:13 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ad7760cb

app-text/calibre: version bump to 2.83.0

Package-Manager: Portage-2.3.5, Repoman-2.3.2

 app-text/calibre/Manifest                          |   1 +
 app-text/calibre/calibre-2.83.0.ebuild             | 251 +++++++++++++++++++++
 ...libre-2.83.0-lzxd-bounds-error-bug-540596.patch |  37 +++
 3 files changed, 289 insertions(+)

diff --git a/app-text/calibre/Manifest b/app-text/calibre/Manifest
index cc4db3db000..9d0294abe41 100644
--- a/app-text/calibre/Manifest
+++ b/app-text/calibre/Manifest
@@ -1,2 +1,3 @@
 DIST calibre-2.78.0.tar.xz 38739404 SHA256 d2b0b0c5451d3ac05ce9de0b801ddf8de7664fee45f273d7ee8445a1ec2f898b SHA512 0779ac385dde45ac4baee7cecb0916e245f3e1cf20662bad9d9a4278265390b1aa89c2b478601b57113e7de08a69343288488ee299e8b43332f0129e650aa0ca WHIRLPOOL 325fc344445078ef0df0a29b4cd8e32445a881ede89e3db87606166ff0c8b7db10b7cc34432e63c2bb49382537a5107686339b987f1be807d59a1786ddfd4a75
 DIST calibre-2.80.0.tar.xz 38781996 SHA256 33a6dbc578c7a2f3d1c97253769506a1afc10f688c062f027d64d7081618f2b1 SHA512 9dc874cd7bfcc883514e354a494a83c63d19b88980df8f28fc03b57d3ebaafb45dad36f0d61e8ef08d363ed18a7bd953e8d624c69f0c3d7f7d66308fceac8982 WHIRLPOOL b40701e810d9a9fab333f420bb1f14a89ac55dd7397407d4f31837efc97d323f74b94181436b8038004e404aff6e9c5696deee89daf1cd949e5659dbe43207c4
+DIST calibre-2.83.0.tar.xz 38875672 SHA256 96166e8c74047cfbae9289c38ab5e2f661168048e568cd187f908242d98426ab SHA512 a28aa52379bc317e648087b28859a8e2c50dd4e2ccb3352e135f896ad95ab9c85c1fba162fe3acd5056be80e7c4e9481ea1396cb638661cfdb27795051124821 WHIRLPOOL bcce15cbfdcf78a56a24f931ae4eed688c7409af0455e9f1ca7aaf00751fa0b4a55e570501bc1b10d02a8e8397df979a18a999b4ddbbb645a7a376cded76cbec

diff --git a/app-text/calibre/calibre-2.83.0.ebuild b/app-text/calibre/calibre-2.83.0.ebuild
new file mode 100644
index 00000000000..edd2bf35f9d
--- /dev/null
+++ b/app-text/calibre/calibre-2.83.0.ebuild
@@ -0,0 +1,251 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+PYTHON_COMPAT=( python2_7 )
+PYTHON_REQ_USE="sqlite,ssl"
+
+inherit eutils fdo-mime bash-completion-r1 multilib toolchain-funcs python-single-r1
+
+DESCRIPTION="Ebook management application"
+HOMEPAGE="http://calibre-ebook.com/"
+SRC_URI="http://download.calibre-ebook.com/${PV}/${P}.tar.xz"
+
+LICENSE="
+	GPL-3+
+	GPL-3
+	GPL-2+
+	GPL-2
+	GPL-1+
+	LGPL-3+
+	LGPL-2.1+
+	LGPL-2.1
+	BSD
+	MIT
+	Old-MIT
+	Apache-2.0
+	public-domain
+	|| ( Artistic GPL-1+ )
+	CC-BY-3.0
+	OFL-1.1
+	PSF-2
+	unRAR
+"
+KEYWORDS="~amd64 ~arm ~x86"
+SLOT="0"
+IUSE="+udisks"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+COMMON_DEPEND="${PYTHON_DEPS}
+	>=app-text/podofo-0.8.2:=
+	>=app-text/poppler-0.26.5[qt5]
+	>=dev-libs/chmlib-0.40:=
+	dev-libs/glib:2
+	>=dev-libs/icu-4.4:=
+	>=dev-python/apsw-3.7.17[${PYTHON_USEDEP}]
+	>=dev-python/beautifulsoup-3.0.5:python-2[${PYTHON_USEDEP}]
+	>=dev-python/cssselect-0.7.1[${PYTHON_USEDEP}]
+	>=dev-python/cssutils-0.9.9[${PYTHON_USEDEP}]
+	>=dev-python/dbus-python-1.2.0[${PYTHON_USEDEP}]
+	>=dev-python/lxml-3.2.1[${PYTHON_USEDEP}]
+	>=dev-python/mechanize-0.1.11[${PYTHON_USEDEP}]
+	dev-python/netifaces[${PYTHON_USEDEP}]
+	dev-python/pillow[${PYTHON_USEDEP}]
+	dev-python/psutil[${PYTHON_USEDEP}]
+	>=dev-python/pygments-2.0.1[${PYTHON_USEDEP}]
+	>=dev-python/python-dateutil-1.4.1[${PYTHON_USEDEP}]
+	>=dev-python/PyQt5-5.3.1[gui,svg,webkit,widgets,network,printsupport,${PYTHON_USEDEP}]
+	dev-qt/qtcore:5
+	dev-qt/qtgui:5
+	dev-qt/qtwidgets:5
+	media-fonts/liberation-fonts
+	>=media-gfx/imagemagick-6.5.9[jpeg,png]
+	media-libs/fontconfig
+	>=media-libs/freetype-2:=
+	>=media-libs/libmtp-1.1.5:=
+	>=media-libs/libwmf-0.2.8
+	sys-libs/zlib
+	virtual/libusb:1=
+	virtual/python-dnspython[${PYTHON_USEDEP}]
+	x11-libs/libX11
+	x11-libs/libXext
+	x11-libs/libXrender
+	>=x11-misc/xdg-utils-1.0.2-r2
+	udisks? ( virtual/libudev )"
+RDEPEND="${COMMON_DEPEND}
+	udisks? ( || ( sys-fs/udisks:2 sys-fs/udisks:0 ) )"
+DEPEND="${COMMON_DEPEND}
+	>=dev-python/setuptools-0.6_rc5[${PYTHON_USEDEP}]
+	>=virtual/podofo-build-0.8.2
+	virtual/pkgconfig"
+
+src_prepare() {
+	# no_updates: do not annoy user with "new version is availible all the time
+	# disable_plugins: walking sec-hole, wait for upstream to use GHNS interface
+	eapply \
+		"${FILESDIR}/${PN}-2.9.0-no_updates_dialog.patch" \
+		"${FILESDIR}/${PN}-disable_plugins.patch" \
+		"${FILESDIR}/${PN}-2.83.0-lzxd-bounds-error-bug-540596.patch"
+
+	eapply_user
+
+	# Fix outdated version constant.
+	#sed -e "s#\\(^numeric_version =\\).*#\\1 (${PV//./, })#" \
+	#	-i src/calibre/constants.py || \
+	#	die "sed failed to patch constants.py"
+
+	# Avoid sandbox violation in /usr/share/gnome/apps when linux.py
+	# calls xdg-* (bug #258938).
+	sed -e "s|'xdg-desktop-menu', 'install'|\\0, '--mode', 'user'|" \
+		-e "s|check_call(\\['xdg-desktop-menu', 'forceupdate'\\])|#\\0|" \
+		-e "s|\\(CurrentDir(tdir)\\), \\\\\$|\\1:|" \
+		-e "s|, PreserveMIMEDefaults():|:|" \
+		-e "s|'xdg-icon-resource', 'install'|\\0, '--mode', 'user'|" \
+		-e "s|cmd\[2\]|cmd[4]|" \
+		-e "s|cc(\\['xdg-desktop-menu', 'forceupdate'\\])|#\\0|" \
+		-e "s|'xdg-mime', 'install'|\\0, '--mode', 'user'|" \
+		-i src/calibre/linux.py || die "sed failed to patch linux.py"
+
+	# Disable unnecessary privilege dropping for bug #287067.
+	sed -e "s:if os.geteuid() == 0:if False and os.geteuid() == 0:" \
+		-i setup/install.py || die "sed failed to patch install.py"
+
+	sed -e "/^            self\\.check_call(qmc + \\[.*\\.pro'\\])$/a\
+\\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ self.check_call(['sed', \
+'-e', 's|^CFLAGS .*|\\\\\\\\0 ${CFLAGS}|', \
+'-e', 's|^CXXFLAGS .*|\\\\\\\\0 ${CXXFLAGS}|', \
+'-e', 's|^LFLAGS .*|\\\\\\\\0 ${LDFLAGS}|', \
+'-i', 'Makefile'])" \
+		-i setup/build.py || die "sed failed to patch build.py"
+
+	# use system beautifulsoup, instead of bundled
+	rm -f "${S}"/src/calibre/ebooks/BeautifulSoup.py \
+		|| die "could not remove bundled beautifulsoup"
+	find "${S}" -type f -name \*.py -exec \
+		sed -e 's/calibre.ebooks.BeautifulSoup/BeautifulSoup/' -i {} + \
+		|| die "could not sed bundled beautifulsoup out of the source tree"
+
+	# avoid failure of xdg tools to recognize vendor prefix
+	sed -e "s|xdg-icon-resource install|xdg-icon-resource install --novendor|" \
+		-e "s|'xdg-mime', 'install'|'xdg-mime', 'install', '--novendor'|" \
+		-e "s|'xdg-desktop-menu', 'install'|'xdg-desktop-menu', 'install', '--novendor'|" \
+		-i "${S}"/src/calibre/linux.py || die 'sed failed'
+
+	# don't create/install uninstaller
+	sed '/self\.create_uninstaller()/d' -i src/calibre/linux.py || die
+}
+
+src_install() {
+	# Bypass kbuildsycoca and update-mime-database in order to
+	# avoid sandbox violations if xdg-mime tries to call them.
+	cat - > "${T}/kbuildsycoca" <<-EOF
+	#!${BASH}
+	echo $0 : $@
+	exit 0
+	EOF
+
+	cp "${T}"/{kbuildsycoca,update-mime-database} || die
+	chmod +x "${T}"/{kbuildsycoca,update-mime-database} || die
+
+	export QMAKE="${EPREFIX}/usr/$(get_libdir)/qt5/bin/qmake"
+
+	# Unset DISPLAY in order to prevent xdg-mime from triggering a sandbox
+	# violation with kbuildsycoca as in bug #287067, comment #13.
+	export -n DISPLAY
+
+	# Bug #352625 - Some LANGUAGE values can trigger the following ValueError:
+	#   File "/usr/lib/python2.6/locale.py", line 486, in getdefaultlocale
+	#    return _parse_localename(localename)
+	#  File "/usr/lib/python2.6/locale.py", line 418, in _parse_localename
+	#    raise ValueError, 'unknown locale: %s' % localename
+	#ValueError: unknown locale: 46
+	export -n LANGUAGE
+
+	# Bug #295672 - Avoid sandbox violation in ~/.config by forcing
+	# variables to point to our fake temporary $HOME.
+	export HOME="${T}/fake_homedir"
+	export XDG_CONFIG_HOME="${HOME}/.config"
+	export XDG_DATA_HOME="${HOME}/.local/share"
+	export CALIBRE_CONFIG_DIRECTORY="${XDG_CONFIG_HOME}/calibre"
+	mkdir -p "${XDG_DATA_HOME}" "${CALIBRE_CONFIG_DIRECTORY}" || die
+
+	tc-export CC CXX
+	# Bug #334243 - respect LDFLAGS when building extensions
+	export OVERRIDE_CFLAGS="$CFLAGS" OVERRIDE_LDFLAGS="$LDFLAGS"
+	local libdir=$(get_libdir)
+	[[ -n $libdir ]] || die "get_libdir returned an empty string"
+
+	# Bug #472690 - Avoid sandbox violation for /dev/dri/card0.
+	local x
+	for x in /dev/dri/card[0-9] ; do
+		[[ -e ${x} ]] && addpredict ${x}
+	done
+
+	#dodir "/usr/$(get_libdir)/python2.7/site-packages" # for init_calibre.py
+	#dodir $(python_get_sitedir)
+	PATH=${T}:${PATH} PYTHONPATH=${S}/src${PYTHONPATH:+:}${PYTHONPATH} \
+	"${PYTHON}" setup.py install \
+		--root="${D}" \
+		--prefix="${EPREFIX}/usr" \
+		--libdir="${EPREFIX}/usr/${libdir}" \
+		--staging-root="${ED}usr" \
+		--staging-libdir="${ED}usr/${libdir}" || die
+
+	# The menu entries end up here due to '--mode user' being added to
+	# xdg-* options in src_prepare.
+	dodir /usr/share/mime/packages
+	chmod -fR a+rX,u+w,g-w,o-w "${HOME}"/.local
+	mv "${HOME}"/.local/share/mime/packages/* "${ED}"usr/share/mime/packages/ ||
+		die "failed to register mime types"
+	dodir /usr/share/icons
+	mv "${HOME}"/.local/share/icons/* "${ED}"usr/share/icons/ ||
+		die "failed to install icon files"
+
+	domenu "${HOME}"/.local/share/applications/*.desktop ||
+		die "failed to install .desktop menu files"
+
+	find "${ED}"usr/share -type d -empty -delete
+
+	cd "${ED}"/usr/share/calibre/fonts/liberation || die
+	local x
+	for x in * ; do
+		[[ -f ${EPREFIX}usr/share/fonts/liberation-fonts/${x} ]] || continue
+		ln -sf "../../../fonts/liberation-fonts/${x}" "${x}" || die
+	done
+
+	einfo "Converting python shebangs"
+	python_fix_shebang "${ED}"
+
+	einfo "Compiling python modules"
+	python_optimize "${ED}"usr/lib/calibre
+
+	newinitd "${FILESDIR}"/calibre-server.init calibre-server
+	newconfd "${FILESDIR}"/calibre-server.conf calibre-server
+
+	bashcomp_alias calibre \
+		lrfviewer \
+		calibre-debug \
+		ebook-meta \
+		calibre-server \
+		ebook-viewer \
+		ebook-polish \
+		fetch-ebook-metadata \
+		lrf2lrs \
+		ebook-convert \
+		ebook-edit \
+		calibre-smtp \
+		ebook-device
+
+}
+
+pkg_postinst() {
+	fdo-mime_desktop_database_update
+	fdo-mime_mime_database_update
+}
+
+pkg_postrm() {
+	fdo-mime_desktop_database_update
+	fdo-mime_mime_database_update
+}

diff --git a/app-text/calibre/files/calibre-2.83.0-lzxd-bounds-error-bug-540596.patch b/app-text/calibre/files/calibre-2.83.0-lzxd-bounds-error-bug-540596.patch
new file mode 100644
index 00000000000..5f7d5a4682f
--- /dev/null
+++ b/app-text/calibre/files/calibre-2.83.0-lzxd-bounds-error-bug-540596.patch
@@ -0,0 +1,37 @@
+From f335c8719b224d3ca7a967b6e91cebd5b26684fe Mon Sep 17 00:00:00 2001
+From: Zac Medico <zmedico@gentoo.org>
+Date: Sun, 23 Apr 2017 16:13:00 -0700
+Subject: [PATCH] Fix bounds error in lzxd_static_init
+
+https://bugs.gentoo.org/show_bug.cgi?id=540596
+https://github.com/kovidgoyal/calibre/pull/650
+
+This includes the changes from the following upstream commits:
+
+https://github.com/kyz/libmspack/commit/6a42ddd1d472afeaf0f7da91e16b60ab2063fb92
+https://github.com/kyz/libmspack/commit/ce3cc03aa500dd9c0b6b820f9519f6b6b9dede05
+---
+ src/calibre/utils/lzx/lzxd.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/src/calibre/utils/lzx/lzxd.c b/src/calibre/utils/lzx/lzxd.c
+index e683a9e..c531aaa 100644
+--- a/src/calibre/utils/lzx/lzxd.c
++++ b/src/calibre/utils/lzx/lzxd.c
+@@ -357,11 +357,12 @@ static unsigned char extra_bits[51];
+ static void lzxd_static_init(void) {
+   int i, j;
+ 
+-  for (i = 0, j = 0; i < 51; i += 2) {
++  for (i = 0, j = 0; i < 50; i += 2) {
+     extra_bits[i]   = j; /* 0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7... */
+     extra_bits[i+1] = j;
+     if ((i != 0) && (j < 17)) j++; /* 0,0,1,2,3,4...15,16,17,17,17,17... */
+   }
++  extra_bits[50] = 17;
+ 
+   for (i = 0, j = 0; i < 51; i++) {
+     position_base[i] = j; /* 0,1,2,3,4,6,8,12,16,24,32,... */
+-- 
+2.10.2
+


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: app-text/calibre/files/, app-text/calibre/
@ 2017-06-26  8:05 Zac Medico
  0 siblings, 0 replies; 13+ messages in thread
From: Zac Medico @ 2017-06-26  8:05 UTC (permalink / raw
  To: gentoo-commits

commit:     1df43410e16d5f3b6b808b3981fa062a87160da1
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Jun 25 20:37:16 2017 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Jun 26 08:05:44 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1df43410

app-text/calibre: version bump to 3.1.1

Package-Manager: Portage-2.3.6, Repoman-2.3.2

 app-text/calibre/Manifest                    |   1 +
 app-text/calibre/calibre-3.1.1.ebuild        | 257 +++++++++++++++++++++++++++
 app-text/calibre/files/calibre-server-3.conf |  13 ++
 app-text/calibre/files/calibre-server-3.init |  58 ++++++
 4 files changed, 329 insertions(+)

diff --git a/app-text/calibre/Manifest b/app-text/calibre/Manifest
index 46f5448ba59..92d34dd0afd 100644
--- a/app-text/calibre/Manifest
+++ b/app-text/calibre/Manifest
@@ -1,2 +1,3 @@
 DIST calibre-2.78.0.tar.xz 38739404 SHA256 d2b0b0c5451d3ac05ce9de0b801ddf8de7664fee45f273d7ee8445a1ec2f898b SHA512 0779ac385dde45ac4baee7cecb0916e245f3e1cf20662bad9d9a4278265390b1aa89c2b478601b57113e7de08a69343288488ee299e8b43332f0129e650aa0ca WHIRLPOOL 325fc344445078ef0df0a29b4cd8e32445a881ede89e3db87606166ff0c8b7db10b7cc34432e63c2bb49382537a5107686339b987f1be807d59a1786ddfd4a75
 DIST calibre-2.85.1.tar.xz 37783284 SHA256 8c8db280c51b26284bff1c066fb503ecef9e1f15f7e2e7b4f705c817ee041abd SHA512 ce29924213fa7461bbf2fc62f26bd53e4eafdf3b0dd58e241071592be4ee038cdb3ac6ac2982229dd0e52595a93aca7d921640ea55796950d1f3ac3c2742af4f WHIRLPOOL 1432f71c19c8ff41dede3370287813281557f3659c862e7a9fe76d548bf393d8dd889aa4dc92d514244b2d35ce25b962c2942ef3dec2bf1ebaa81b1ea6bd0c94
+DIST calibre-3.1.1.tar.xz 35841216 SHA256 cfa00b953cf68f0760a4588c8adad066749cce673178e85e4c249790c07f01d2 SHA512 1da11ede70d93fa608873726fdcd9b39f261c045ea874521b45211df951bdb15e62958f50628eb6cfcfef2ff14b89da74b0f89481f3671480dbc9589b096d695 WHIRLPOOL fa85b83fc2502cdbdb12259a0d56cff9867606088f62b6a147ee4fa0f99174d5e74a396239b07441124da839aa1000d8ba146b588290b30a70a1caa1166003c0

diff --git a/app-text/calibre/calibre-3.1.1.ebuild b/app-text/calibre/calibre-3.1.1.ebuild
new file mode 100644
index 00000000000..0c7cccd2b24
--- /dev/null
+++ b/app-text/calibre/calibre-3.1.1.ebuild
@@ -0,0 +1,257 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+PYTHON_COMPAT=( python2_7 )
+PYTHON_REQ_USE="sqlite,ssl"
+
+inherit eutils fdo-mime bash-completion-r1 multilib toolchain-funcs python-single-r1
+
+DESCRIPTION="Ebook management application"
+HOMEPAGE="http://calibre-ebook.com/"
+SRC_URI="http://download.calibre-ebook.com/${PV}/${P}.tar.xz"
+
+LICENSE="
+	GPL-3+
+	GPL-3
+	GPL-2+
+	GPL-2
+	GPL-1+
+	LGPL-3+
+	LGPL-2.1+
+	LGPL-2.1
+	BSD
+	MIT
+	Old-MIT
+	Apache-2.0
+	public-domain
+	|| ( Artistic GPL-1+ )
+	CC-BY-3.0
+	OFL-1.1
+	PSF-2
+	unRAR
+"
+KEYWORDS="~amd64 ~arm ~x86"
+SLOT="0"
+IUSE="ios +udisks"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+COMMON_DEPEND="${PYTHON_DEPS}
+	>=app-text/podofo-0.8.2:=
+	>=app-text/poppler-0.26.5[qt5]
+	>=dev-libs/chmlib-0.40:=
+	dev-libs/glib:2
+	>=dev-libs/icu-57.1:=
+	>=dev-python/apsw-3.13.0[${PYTHON_USEDEP}]
+	>=dev-python/beautifulsoup-3.0.5:python-2[${PYTHON_USEDEP}]
+	>=dev-python/cssselect-0.7.1[${PYTHON_USEDEP}]
+	>=dev-python/cssutils-1.0.1[${PYTHON_USEDEP}]
+	>=dev-python/dbus-python-1.2.4[${PYTHON_USEDEP}]
+	>=dev-libs/dbus-glib-0.106
+	>=sys-apps/dbus-1.10.8
+	>=dev-python/lxml-3.2.1[${PYTHON_USEDEP}]
+	>=dev-python/mechanize-0.2.5[${PYTHON_USEDEP}]
+	dev-python/netifaces[${PYTHON_USEDEP}]
+	dev-python/pillow[${PYTHON_USEDEP}]
+	dev-python/psutil[${PYTHON_USEDEP}]
+	>=dev-python/pygments-2.1.3[${PYTHON_USEDEP}]
+	>=dev-python/python-dateutil-2.5.3[${PYTHON_USEDEP}]
+	>=dev-python/PyQt5-5.8[gui,svg,webkit,widgets,network,printsupport,${PYTHON_USEDEP}]
+	dev-qt/qtcore:5
+	dev-qt/qtgui:5
+	dev-qt/qtwidgets:5
+	media-fonts/liberation-fonts
+	>=media-gfx/imagemagick-6.5.9[jpeg,png]
+	media-libs/fontconfig
+	>=media-libs/freetype-2:=
+	>=media-libs/libmtp-1.1.11:=
+	>=media-libs/libwmf-0.2.8
+	>=media-gfx/optipng-0.7.6
+	sys-libs/zlib
+	virtual/libusb:1=
+	virtual/python-dnspython[${PYTHON_USEDEP}]
+	x11-libs/libX11
+	x11-libs/libXext
+	x11-libs/libXrender
+	>=x11-misc/xdg-utils-1.0.2-r2
+	ios? (
+		>=app-pda/usbmuxd-1.0.8
+		>=app-pda/libimobiledevice-1.2.0
+	)
+	udisks? ( virtual/libudev )"
+RDEPEND="${COMMON_DEPEND}
+	udisks? ( || ( sys-fs/udisks:2 sys-fs/udisks:0 ) )"
+DEPEND="${COMMON_DEPEND}
+	>=dev-python/setuptools-23.1.0[${PYTHON_USEDEP}]
+	>=virtual/podofo-build-0.9.4
+	virtual/pkgconfig"
+
+src_prepare() {
+	# no_updates: do not annoy user with "new version is availible all the time
+	# disable_plugins: walking sec-hole, wait for upstream to use GHNS interface
+	eapply \
+		"${FILESDIR}/${PN}-2.9.0-no_updates_dialog.patch" \
+		"${FILESDIR}/${PN}-disable_plugins.patch"
+
+	eapply_user
+
+	# Fix outdated version constant.
+	#sed -e "s#\\(^numeric_version =\\).*#\\1 (${PV//./, })#" \
+	#	-i src/calibre/constants.py || \
+	#	die "sed failed to patch constants.py"
+
+	# Avoid sandbox violation in /usr/share/gnome/apps when linux.py
+	# calls xdg-* (bug #258938).
+	sed -e "s|'xdg-desktop-menu', 'install'|\\0, '--mode', 'user'|" \
+		-e "s|check_call(\\['xdg-desktop-menu', 'forceupdate'\\])|#\\0|" \
+		-e "s|\\(CurrentDir(tdir)\\), \\\\\$|\\1:|" \
+		-e "s|, PreserveMIMEDefaults():|:|" \
+		-e "s|'xdg-icon-resource', 'install'|\\0, '--mode', 'user'|" \
+		-e "s|cmd\[2\]|cmd[4]|" \
+		-e "s|cc(\\['xdg-desktop-menu', 'forceupdate'\\])|#\\0|" \
+		-e "s|'xdg-mime', 'install'|\\0, '--mode', 'user'|" \
+		-i src/calibre/linux.py || die "sed failed to patch linux.py"
+
+	# Disable unnecessary privilege dropping for bug #287067.
+	sed -e "s:if os.geteuid() == 0:if False and os.geteuid() == 0:" \
+		-i setup/install.py || die "sed failed to patch install.py"
+
+	sed -e "/^                self.check_call(\\[QMAKE\\] + qmc + \\[proname\\])$/a\
+\\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ self.check_call(['sed', \
+'-e', 's|^CFLAGS .*|\\\\\\\\0 ${CFLAGS}|', \
+'-e', 's|^CXXFLAGS .*|\\\\\\\\0 ${CXXFLAGS}|', \
+'-e', 's|^LFLAGS .*|\\\\\\\\0 ${LDFLAGS}|', \
+'-i', 'Makefile'])" \
+		-i setup/build.py || die "sed failed to patch build.py"
+
+	# use system beautifulsoup, instead of bundled
+	rm -f "${S}"/src/calibre/ebooks/BeautifulSoup.py \
+		|| die "could not remove bundled beautifulsoup"
+	find "${S}" -type f -name \*.py -exec \
+		sed -e 's/calibre.ebooks.BeautifulSoup/BeautifulSoup/' -i {} + \
+		|| die "could not sed bundled beautifulsoup out of the source tree"
+
+	# avoid failure of xdg tools to recognize vendor prefix
+	sed -e "s|xdg-icon-resource install|xdg-icon-resource install --novendor|" \
+		-e "s|'xdg-mime', 'install'|'xdg-mime', 'install', '--novendor'|" \
+		-e "s|'xdg-desktop-menu', 'install'|'xdg-desktop-menu', 'install', '--novendor'|" \
+		-i "${S}"/src/calibre/linux.py || die 'sed failed'
+
+	# don't create/install uninstaller
+	sed '/self\.create_uninstaller()/d' -i src/calibre/linux.py || die
+}
+
+src_install() {
+	# Bypass kbuildsycoca and update-mime-database in order to
+	# avoid sandbox violations if xdg-mime tries to call them.
+	cat - > "${T}/kbuildsycoca" <<-EOF
+	#!${BASH}
+	echo $0 : $@
+	exit 0
+	EOF
+
+	cp "${T}"/{kbuildsycoca,update-mime-database} || die
+	chmod +x "${T}"/{kbuildsycoca,update-mime-database} || die
+
+	export QMAKE="${EPREFIX}/usr/$(get_libdir)/qt5/bin/qmake"
+
+	# Unset DISPLAY in order to prevent xdg-mime from triggering a sandbox
+	# violation with kbuildsycoca as in bug #287067, comment #13.
+	export -n DISPLAY
+
+	# Bug #352625 - Some LANGUAGE values can trigger the following ValueError:
+	#   File "/usr/lib/python2.6/locale.py", line 486, in getdefaultlocale
+	#    return _parse_localename(localename)
+	#  File "/usr/lib/python2.6/locale.py", line 418, in _parse_localename
+	#    raise ValueError, 'unknown locale: %s' % localename
+	#ValueError: unknown locale: 46
+	export -n LANGUAGE
+
+	# Bug #295672 - Avoid sandbox violation in ~/.config by forcing
+	# variables to point to our fake temporary $HOME.
+	export HOME="${T}/fake_homedir"
+	export XDG_CONFIG_HOME="${HOME}/.config"
+	export XDG_DATA_HOME="${HOME}/.local/share"
+	export CALIBRE_CONFIG_DIRECTORY="${XDG_CONFIG_HOME}/calibre"
+	mkdir -p "${XDG_DATA_HOME}" "${CALIBRE_CONFIG_DIRECTORY}" || die
+
+	tc-export CC CXX
+	# Bug #334243 - respect LDFLAGS when building extensions
+	export OVERRIDE_CFLAGS="$CFLAGS" OVERRIDE_LDFLAGS="$LDFLAGS"
+	local libdir=$(get_libdir)
+	[[ -n $libdir ]] || die "get_libdir returned an empty string"
+
+	# Bug #472690 - Avoid sandbox violation for /dev/dri/card0.
+	local x
+	for x in /dev/dri/card[0-9] ; do
+		[[ -e ${x} ]] && addpredict ${x}
+	done
+
+	#dodir "/usr/$(get_libdir)/python2.7/site-packages" # for init_calibre.py
+	#dodir $(python_get_sitedir)
+	PATH=${T}:${PATH} PYTHONPATH=${S}/src${PYTHONPATH:+:}${PYTHONPATH} \
+	"${PYTHON}" setup.py install \
+		--root="${D}" \
+		--prefix="${EPREFIX}/usr" \
+		--libdir="${EPREFIX}/usr/${libdir}" \
+		--staging-root="${ED}usr" \
+		--staging-libdir="${ED}usr/${libdir}" || die
+
+	# The menu entries end up here due to '--mode user' being added to
+	# xdg-* options in src_prepare.
+	dodir /usr/share/mime/packages
+	chmod -fR a+rX,u+w,g-w,o-w "${HOME}"/.local
+	mv "${HOME}"/.local/share/mime/packages/* "${ED}"usr/share/mime/packages/ ||
+		die "failed to register mime types"
+	dodir /usr/share/icons
+	mv "${HOME}"/.local/share/icons/* "${ED}"usr/share/icons/ ||
+		die "failed to install icon files"
+
+	domenu "${HOME}"/.local/share/applications/*.desktop ||
+		die "failed to install .desktop menu files"
+
+	find "${ED}"usr/share -type d -empty -delete
+
+	cd "${ED}"/usr/share/calibre/fonts/liberation || die
+	local x
+	for x in * ; do
+		[[ -f ${EPREFIX}usr/share/fonts/liberation-fonts/${x} ]] || continue
+		ln -sf "../../../fonts/liberation-fonts/${x}" "${x}" || die
+	done
+
+	einfo "Converting python shebangs"
+	python_fix_shebang "${ED}"
+
+	einfo "Compiling python modules"
+	python_optimize "${ED}"usr/lib/calibre
+
+	newinitd "${FILESDIR}"/calibre-server-3.init calibre-server
+	newconfd "${FILESDIR}"/calibre-server-3.conf calibre-server
+
+	bashcomp_alias calibre \
+		lrfviewer \
+		calibre-debug \
+		ebook-meta \
+		calibre-server \
+		ebook-viewer \
+		ebook-polish \
+		fetch-ebook-metadata \
+		lrf2lrs \
+		ebook-convert \
+		ebook-edit \
+		calibre-smtp \
+		ebook-device
+
+}
+
+pkg_postinst() {
+	fdo-mime_desktop_database_update
+	fdo-mime_mime_database_update
+}
+
+pkg_postrm() {
+	fdo-mime_desktop_database_update
+	fdo-mime_mime_database_update
+}

diff --git a/app-text/calibre/files/calibre-server-3.conf b/app-text/calibre/files/calibre-server-3.conf
new file mode 100644
index 00000000000..bb456e858bd
--- /dev/null
+++ b/app-text/calibre/files/calibre-server-3.conf
@@ -0,0 +1,13 @@
+# /etc/conf.d/calibre-server
+# Change this to the user you want to run calibre-server as.
+# You may specify a group too, after a colon
+# NOTE:  This must be set and not to root!
+CALIBRE_USER=
+
+# Set the path of the library to serve.
+# Defaults to the default location for CALIBRE_USER.
+#CALIBRE_LIBRARY='<user home directory>/Calibre Library'
+
+# Extra options to pass to calibre-server.
+# See the calibre-server man page for more options.
+#CALIBRE_SERVER_OPTS="--userdb /srv/calibre/users.sqlite --enable-auth --worker-count 10 --port 8080"

diff --git a/app-text/calibre/files/calibre-server-3.init b/app-text/calibre/files/calibre-server-3.init
new file mode 100644
index 00000000000..049d3e421a1
--- /dev/null
+++ b/app-text/calibre/files/calibre-server-3.init
@@ -0,0 +1,58 @@
+#!/sbin/openrc-run
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License, v2 or later
+
+depend() {
+	need net
+	need localmount
+	after bootmisc
+}
+
+checkconfig() {
+	if [ "${CALIBRE_USER}" = "" -o "${CALIBRE_USER}" = "root" ] ; then
+		eerror "Please edit /etc/conf.d/calibre-server"
+		eerror "You have to specify a user to run calibre-server as, as we will not run it as root!"
+		eerror "Modify CALIBRE_USER to your needs (you can also add a group, after a colon)"
+		return 1
+	fi
+	if ! getent passwd "${CALIBRE_USER%:*}" >/dev/null ; then
+		eerror "Please edit /etc/conf.d/calibre-server"
+		eerror "Your user has to exist!"
+		return 1
+	fi
+	if [ "${CALIBRE_USER%:*}" != "${CALIBRE_USER}" ] ; then
+		if ! getent group "${CALIBRE_USER#*:}" >/dev/null ; then
+			eerror "Please edit /etc/conf.d/calibre-server"
+			eerror "Your group has to exist too!"
+			return 1
+		fi
+	fi
+	if [ "${CALIBRE_LIBRARY}" = "" ] ; then
+		CALIBRE_USER_HOME=$(getent passwd "${CALIBRE_USER%:*}" | cut -d ':' -f 6)
+		CALIBRE_LIBRARY="${CALIBRE_USER_HOME}/Calibre Library"
+	fi
+	if [ ! -d "${CALIBRE_LIBRARY}" ] ; then
+		eerror "Please edit /etc/conf.d/calibre-server"
+		eerror "The Calibre library, '${CALIBRE_LIBRARY},' does not exist."
+		eerror "Please modify CALIBRE_LIBRARY to point to a valid library."
+		return 1
+	fi
+	return 0
+}
+
+start() {
+	checkconfig || return $?
+	local pidfile=/var/run/calibre-server.pid
+	ebegin "Starting calibre-server"
+	start-stop-daemon --user "${CALIBRE_USER}" \
+		--pidfile "${pidfile}" --make-pidfile --background --exec /usr/bin/calibre-server \
+		-- ${CALIBRE_OPTS} "${CALIBRE_LIBRARY}"
+	eend $?
+}
+
+stop() {
+	ebegin "Stopping calibre-server"
+	start-stop-daemon --stop --user "${CALIBRE_USER}" \
+		--pidfile /var/run/calibre-server.pid
+	eend $?
+}


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: app-text/calibre/files/, app-text/calibre/
@ 2020-11-28 22:50 Andreas K. Hüttel
  0 siblings, 0 replies; 13+ messages in thread
From: Andreas K. Hüttel @ 2020-11-28 22:50 UTC (permalink / raw
  To: gentoo-commits

commit:     1d13714f2a66bb0eb4ea88b33dc2404f6d4120df
Author:     Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
AuthorDate: Sat Nov 28 22:50:26 2020 +0000
Commit:     Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
CommitDate: Sat Nov 28 22:50:45 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1d13714f

app-text/calibre: Fix build with icu-68

Closes: https://bugs.gentoo.org/752015
Package-Manager: Portage-3.0.9, Repoman-3.0.2
Signed-off-by: Andreas K. Hüttel <dilfridge <AT> gentoo.org>

 app-text/calibre/calibre-4.22.0.ebuild            |  3 +-
 app-text/calibre/calibre-4.23.0.ebuild            |  3 +-
 app-text/calibre/calibre-5.4.2.ebuild             |  1 +
 app-text/calibre/files/calibre-4.22.0-icu68.patch | 37 +++++++++++++++++++++++
 4 files changed, 42 insertions(+), 2 deletions(-)

diff --git a/app-text/calibre/calibre-4.22.0.ebuild b/app-text/calibre/calibre-4.22.0.ebuild
index 7dca7d16c3d..317dde69399 100644
--- a/app-text/calibre/calibre-4.22.0.ebuild
+++ b/app-text/calibre/calibre-4.22.0.ebuild
@@ -122,7 +122,8 @@ src_prepare() {
 	# disable_plugins: walking sec-hole, wait for upstream to use GHNS interface
 	eapply \
 		"${FILESDIR}/${PN}-2.9.0-no_updates_dialog.patch" \
-		"${FILESDIR}/${PN}-disable_plugins.patch"
+		"${FILESDIR}/${PN}-disable_plugins.patch" \
+		"${FILESDIR}/${PN}-4.22.0-icu68.patch"
 
 	eapply_user
 

diff --git a/app-text/calibre/calibre-4.23.0.ebuild b/app-text/calibre/calibre-4.23.0.ebuild
index 2e529363d2c..fffb7f953b4 100644
--- a/app-text/calibre/calibre-4.23.0.ebuild
+++ b/app-text/calibre/calibre-4.23.0.ebuild
@@ -122,7 +122,8 @@ src_prepare() {
 	# disable_plugins: walking sec-hole, wait for upstream to use GHNS interface
 	eapply \
 		"${FILESDIR}/${PN}-2.9.0-no_updates_dialog.patch" \
-		"${FILESDIR}/${PN}-disable_plugins.patch"
+		"${FILESDIR}/${PN}-disable_plugins.patch" \
+		"${FILESDIR}/${PN}-4.22.0-icu68.patch"
 
 	eapply_user
 

diff --git a/app-text/calibre/calibre-5.4.2.ebuild b/app-text/calibre/calibre-5.4.2.ebuild
index 6c46bbdb063..ca89fb15aef 100644
--- a/app-text/calibre/calibre-5.4.2.ebuild
+++ b/app-text/calibre/calibre-5.4.2.ebuild
@@ -124,6 +124,7 @@ src_prepare() {
 	eapply \
 		"${FILESDIR}/${PN}-2.9.0-no_updates_dialog.patch" \
 		"${FILESDIR}/${PN}-disable_plugins.patch" \
+		"${FILESDIR}/${PN}-4.22.0-icu68.patch" \
 		"${WORKDIR}/${PN}-5.4.2-SIP-v4.patch"
 
 	eapply_user

diff --git a/app-text/calibre/files/calibre-4.22.0-icu68.patch b/app-text/calibre/files/calibre-4.22.0-icu68.patch
new file mode 100644
index 00000000000..33cd7830d35
--- /dev/null
+++ b/app-text/calibre/files/calibre-4.22.0-icu68.patch
@@ -0,0 +1,37 @@
+From c211f9b17af410463ce9cfc9b1b100228b51720f Mon Sep 17 00:00:00 2001
+From: Lars Wendler <polynomial-c@gentoo.org>
+Date: Sat, 31 Oct 2020 10:44:36 +0100
+Subject: [PATCH] Fix build with icu-68.1
+
+icu-68.1 removed public macro definitions for TRUE and FALSE
+
+Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>
+---
+ src/calibre/utils/icu.c     | 4 ++--
+ src/calibre/utils/matcher.c | 1 -
+ 2 files changed, 2 insertions(+), 3 deletions(-)
+
+diff --git a/src/calibre/utils/icu.c b/src/calibre/utils/icu.c
+index 62d05de310..4e918492d9 100644
+--- a/src/calibre/utils/icu.c
++++ b/src/calibre/utils/icu.c
+@@ -238,14 +238,14 @@ icu_Collator_contains(icu_Collator *self, PyObject *args) {
+ 
+     a = python_to_icu(a_, &asz);
+     if (a == NULL) goto end;
+-    if (asz == 0) { found = TRUE; goto end; }
++    if (asz == 0) { found = 1; goto end; }
+     b = python_to_icu(b_, &bsz);
+     if (b == NULL) goto end;
+ 
+     search = usearch_openFromCollator(a, asz, b, bsz, self->collator, NULL, &status);
+     if (U_SUCCESS(status)) {
+         pos = usearch_first(search, &status);
+-        if (pos != USEARCH_DONE) found = TRUE;
++        if (pos != USEARCH_DONE) found = 1;
+     }
+ end:
+     if (search != NULL) usearch_close(search);
+-- 
+2.29.2
+


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: app-text/calibre/files/, app-text/calibre/
@ 2021-06-14 18:13 Zac Medico
  0 siblings, 0 replies; 13+ messages in thread
From: Zac Medico @ 2021-06-14 18:13 UTC (permalink / raw
  To: gentoo-commits

commit:     10deff717a7e89cf16544e9a6b965b870a57ed36
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Jun 14 18:09:26 2021 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Jun 14 18:13:56 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=10deff71

app-text/calibre: Remove old versions

Package-Manager: Portage-3.0.20, Repoman-3.0.3
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 app-text/calibre/Manifest                         |   7 -
 app-text/calibre/calibre-4.22.0.ebuild            | 277 ---------------------
 app-text/calibre/calibre-4.23.0.ebuild            | 278 ----------------------
 app-text/calibre/calibre-5.13.0.ebuild            | 264 --------------------
 app-text/calibre/calibre-5.4.2-r1.ebuild          | 265 ---------------------
 app-text/calibre/calibre-5.6.0.ebuild             | 264 --------------------
 app-text/calibre/files/calibre-4.22.0-icu68.patch |  49 ----
 7 files changed, 1404 deletions(-)

diff --git a/app-text/calibre/Manifest b/app-text/calibre/Manifest
index 1cf88bab312..eae60e865b0 100644
--- a/app-text/calibre/Manifest
+++ b/app-text/calibre/Manifest
@@ -1,9 +1,2 @@
-DIST calibre-4.22.0.tar.xz 36924876 BLAKE2B 19576d5cfc1a4ed6a505ef46656675980b6736be01f55874951a9a0c81a70c82e23e723db1d81d13917eaf615e65752a100fbc1cb43bdca0b3c4543e3b17cf43 SHA512 b9db1c72cf010c25563e3f86a75478ac872249034b3c8b09bb8f0c2519487bb78dea821c9e45564fb645d17431bbee96459a28ee036e57830faedea4cd94b423
-DIST calibre-4.23.0.tar.xz 36908740 BLAKE2B 3a950ac2b3aade547bb686cc99b963357e76b5931049ecb4a5e09ddaf1db26c74fa3b4ebd74e42d83f68c5c9827c534c0247a3c6a9b000641a778cfe5ac33599 SHA512 2a512f29ddc2fed7f6a229314a9f7fceac198c9422b3be19078685032f1d1cb3b9258ac2609c33d15da20683c1277ed09419ea1e9bbc70430cdc676f60395719
-DIST calibre-5.13.0.tar.xz 36746972 BLAKE2B b011114fa558c2dd7418a449b2a43bbbbe6e850ad6ba14bdb8ee70d63b475839a6f489eb273c1c88eb841156feee1f0a6f13b19a38eab11820e8e14a05242a6d SHA512 99f2e007af70e4de9ffc05fc4ed41ac3e62ed5196d05e066ab2624e15694f8a0aa149769e0a2cf163f59e330ed7ab43bc938e65064ac2a9825d641b1735f13cf
 DIST calibre-5.16.0-SIP-v4.patch.xz 6768 BLAKE2B b939233266c7cab0fa71ccdeb748bbcffbf16248081ccf0ab313420fe3898954da71e0796b3d6c44e93c636113221f95fa6affc6be97bf41f4086a909b2849f9 SHA512 eb19e6bb328f60eb4af2c38d54c3d2a09989d41d71d27de10ab5ae443af902c3c12fc70042d4735dd785573cb63bb7d7a10ae5f7ed72afc1e1a9c6aacaf64aec
 DIST calibre-5.16.1.tar.xz 36757204 BLAKE2B 71114eed723180142f5428a680d8c5ceabcd007acbc6a70a9298e45a9f21fc793f0ef86bf60b36c96bbd15e9e3f8d8638d179872fb6ff1f9b9f5e31a93e65ba1 SHA512 41cf29cc32c7af08215baf80609f8f099d44f2b82d34181451cbf3ed1648e07d64712dba9ff0ddec5bad3d342c7d8bde40bb822f6bd5fb93a4b29d25cf188aae
-DIST calibre-5.4.2-SIP-v4-04ad7b.patch 1534 BLAKE2B a0d3a49e13499ec55098c8639ba93c21e04a1b23b857ca8c7e0cb665f6e40b138f44a13c78b7a240784919effa9870817b2ec7ce5b494448807a4b77dd95b06f SHA512 f0acd97fc57bce9b22dd2061be7a85f4b39b7a9c3492304dec4108ede087a9e58ee886e21734823021709686dc1317f41eb1ac99a947a7dc07660b5c1849bc1b
-DIST calibre-5.4.2-SIP-v4.patch.xz 4640 BLAKE2B e8d20d9e23922885ecc3d24b7dd83579911dc83520037bad4e9323725c3127d348dc745dc725d137a3172e8891764355d3fcdee640a26cd6b142a2c26d00da0b SHA512 e79ee69ba0ca7e44c10c6670743889d0391d708e75c798e345e6228f483347f72b070e01e2a258590420a1eea6313d88d816817886747c699e6783bd965ab557
-DIST calibre-5.4.2.tar.xz 36596800 BLAKE2B 00373cdc9af56a8dacc70096d1e7925f8d3da4eaf37727ad58c211d18e6c593a21c3ad0f283048ae28b1bb83889c8c801baaa5e240eb65d972ebc78a79922ec1 SHA512 ef3839f5ff4ceecb3bbd6c84819d6f57cc4bb2a1ae789a9dcf8f029680bc778ef86f9c2eb01832c4990f68c2de892eedafa449205470cec4d86a3bbe9d4b4527
-DIST calibre-5.6.0.tar.xz 36653328 BLAKE2B 44941c50873c285aa552c5b4ac716e5d3dd6bc3e1a4f13b1003d42adb808566ec3a5083c683a40d9679524e4ae70eed6ec8bc4c70770991f9791bcea25387c42 SHA512 5d06b60467bbf332acb8666d4117407c2876cfe2726dca3e9d9ed5d77561614406c7150c2800aacefe3cecb0869c1cd7b2681eba27830248b3c32e362123d50f

diff --git a/app-text/calibre/calibre-4.22.0.ebuild b/app-text/calibre/calibre-4.22.0.ebuild
deleted file mode 100644
index 73be3fb3164..00000000000
--- a/app-text/calibre/calibre-4.22.0.ebuild
+++ /dev/null
@@ -1,277 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-PYTHON_COMPAT=( python3_{7..8} )
-PYTHON_REQ_USE="sqlite,ssl"
-
-inherit bash-completion-r1 desktop toolchain-funcs python-single-r1 xdg-utils
-
-DESCRIPTION="Ebook management application"
-HOMEPAGE="https://calibre-ebook.com/"
-SRC_URI="https://download.calibre-ebook.com/${PV}/${P}.tar.xz"
-
-LICENSE="
-	GPL-3+
-	GPL-3
-	GPL-2+
-	GPL-2
-	GPL-1+
-	LGPL-3+
-	LGPL-2.1+
-	LGPL-2.1
-	BSD
-	MIT
-	Old-MIT
-	Apache-2.0
-	public-domain
-	|| ( Artistic GPL-1+ )
-	CC-BY-3.0
-	OFL-1.1
-	PSF-2
-"
-KEYWORDS="amd64 ~arm x86"
-SLOT="0"
-IUSE="ios +udisks"
-
-REQUIRED_USE="${PYTHON_REQUIRED_USE}"
-
-COMMON_DEPEND="${PYTHON_DEPS}
-	>=app-text/hunspell-1.7:=
-	>=app-text/podofo-0.9.6_pre20171027:=
-	>=app-text/poppler-0.26.5[qt5]
-	>=dev-libs/chmlib-0.40:=
-	dev-libs/glib:2=
-	dev-libs/hyphen:=
-	>=dev-libs/icu-57.1:=
-	dev-libs/libinput:=
-	>=dev-libs/dbus-glib-0.106
-	>=sys-apps/dbus-1.10.8
-	$(python_gen_cond_dep '
-		>=dev-python/apsw-3.25.2_p1[${PYTHON_MULTI_USEDEP}]
-		dev-python/beautifulsoup:4[${PYTHON_MULTI_USEDEP}]
-		>=dev-python/chardet-3.0.3[${PYTHON_MULTI_USEDEP}]
-		>=dev-python/cssselect-0.7.1[${PYTHON_MULTI_USEDEP}]
-		>=dev-python/css-parser-1.0.4[${PYTHON_MULTI_USEDEP}]
-		>=dev-python/dbus-python-1.2.4[${PYTHON_MULTI_USEDEP}]
-		dev-python/dnspython[${PYTHON_MULTI_USEDEP}]
-		>=dev-python/feedparser-5.2.1[${PYTHON_MULTI_USEDEP}]
-		>=dev-python/html2text-2019.8.11[${PYTHON_MULTI_USEDEP}]
-		>=dev-python/html5-parser-0.4.9[${PYTHON_MULTI_USEDEP}]
-		>=dev-python/lxml-3.8.0[${PYTHON_MULTI_USEDEP}]
-		>=dev-python/markdown-3.0.1[${PYTHON_MULTI_USEDEP}]
-		>=dev-python/mechanize-0.3.5[${PYTHON_MULTI_USEDEP}]
-		>=dev-python/msgpack-0.6.2[${PYTHON_MULTI_USEDEP}]
-		>=dev-python/netifaces-0.10.5[${PYTHON_MULTI_USEDEP}]
-		>=dev-python/pillow-3.2.0[${PYTHON_MULTI_USEDEP}]
-		>=dev-python/psutil-4.3.0[${PYTHON_MULTI_USEDEP}]
-		>=dev-python/pygments-2.3.1[${PYTHON_MULTI_USEDEP}]
-		>=dev-python/python-dateutil-2.5.3[${PYTHON_MULTI_USEDEP}]
-		>=dev-python/PyQt5-5.12[gui,svg,widgets,network,printsupport,${PYTHON_MULTI_USEDEP}]
-		>=dev-python/PyQtWebEngine-5.12[${PYTHON_MULTI_USEDEP}]
-		dev-python/regex[${PYTHON_MULTI_USEDEP}]
-		dev-python/zeroconf[${PYTHON_MULTI_USEDEP}]
-	')
-	dev-qt/qtcore:5=
-	dev-qt/qtdbus:5=
-	dev-qt/qtgui:5=[jpeg]
-	>=dev-qt/qtwebengine-5.12
-	dev-qt/qtwidgets:5=
-	dev-util/desktop-file-utils
-	dev-util/gtk-update-icon-cache
-	media-fonts/liberation-fonts
-	media-libs/fontconfig:=
-	>=media-libs/freetype-2:=
-	>=media-libs/libmtp-1.1.11:=
-	>=media-libs/libwmf-0.2.8
-	>=media-gfx/optipng-0.7.6
-	>=sys-libs/zlib-1.2.11:=
-	virtual/libusb:1=
-	x11-libs/libxkbcommon:=
-	x11-libs/libX11:=
-	x11-libs/libXext:=
-	x11-libs/libXrender:=
-	x11-misc/shared-mime-info
-	>=x11-misc/xdg-utils-1.0.2-r2
-	ios? (
-		>=app-pda/usbmuxd-1.0.8
-		>=app-pda/libimobiledevice-1.2.0
-	)
-	udisks? ( virtual/libudev )"
-RDEPEND="${COMMON_DEPEND}
-	udisks? ( sys-fs/udisks:2 )"
-DEPEND="${COMMON_DEPEND}
-	$(python_gen_cond_dep '
-		>=dev-python/setuptools-23.1.0[${PYTHON_MULTI_USEDEP}]
-		<dev-python/sip-5[${PYTHON_MULTI_USEDEP}]
-	')
-	>=virtual/podofo-build-0.9.6_pre20171027
-	virtual/pkgconfig"
-
-pkg_pretend() {
-	if [[ ${MERGE_TYPE} != binary ]] && tc-is-gcc && [[ $(gcc-major-version) -lt 6 ]]; then
-		eerror "Calibre cannot be built with this version of gcc."
-		eerror "You need at least gcc-6.0"
-		die "Your C compiler is too old for this package."
-	fi
-}
-
-src_prepare() {
-	# no_updates: do not annoy user with "new version is availible all the time
-	# disable_plugins: walking sec-hole, wait for upstream to use GHNS interface
-	eapply \
-		"${FILESDIR}/${PN}-2.9.0-no_updates_dialog.patch" \
-		"${FILESDIR}/${PN}-disable_plugins.patch"
-
-	has_version ">=dev-libs/icu-68.1" && eapply "${FILESDIR}/${PN}-4.22.0-icu68.patch"
-
-	eapply_user
-
-	# Fix outdated version constant.
-	#sed -e "s#\\(^numeric_version =\\).*#\\1 (${PV//./, })#" \
-	#	-i src/calibre/constants.py || \
-	#	die "sed failed to patch constants.py"
-
-	# Avoid sandbox violation in /usr/share/gnome/apps when linux.py
-	# calls xdg-* (bug #258938).
-	sed -e "s|'xdg-desktop-menu', 'install'|\\0, '--mode', 'user'|" \
-		-e "s|check_call(\\['xdg-desktop-menu', 'forceupdate'\\])|#\\0|" \
-		-e "s|\\(CurrentDir(tdir)\\), \\\\\$|\\1:|" \
-		-e "s|, PreserveMIMEDefaults():|:|" \
-		-e "s|'xdg-icon-resource', 'install'|\\0, '--mode', 'user'|" \
-		-e "s|cmd\[2\]|cmd[4]|" \
-		-e "s|cc(\\['xdg-desktop-menu', 'forceupdate'\\])|#\\0|" \
-		-e "s|'xdg-mime', 'install'|\\0, '--mode', 'user'|" \
-		-i src/calibre/linux.py || die "sed failed to patch linux.py"
-
-	# Disable unnecessary privilege dropping for bug #287067.
-	sed -e "s:if os.geteuid() == 0:if False and os.geteuid() == 0:" \
-		-i setup/install.py || die "sed failed to patch install.py"
-
-	sed -e "/^                self.check_call(\\[QMAKE\\] + qmc + \\[proname\\])$/a\
-\\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ self.check_call(['sed', \
-'-e', 's|^CFLAGS .*|\\\\\\\\0 ${CFLAGS}|', \
-'-e', 's|^CXXFLAGS .*|\\\\\\\\0 ${CXXFLAGS}|', \
-'-e', 's|^LFLAGS .*|\\\\\\\\0 ${LDFLAGS}|', \
-'-i', '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"
-}
-
-src_install() {
-	# calibre works with python 3, so remove the python 2 constraint
-	export CALIBRE_PY3_PORT=1
-
-	# Bypass kbuildsycoca and update-mime-database in order to
-	# avoid sandbox violations if xdg-mime tries to call them.
-	cat - > "${T}/kbuildsycoca" <<-EOF
-	#!${BASH}
-	echo $0 : $@
-	exit 0
-	EOF
-
-	cp "${T}"/{kbuildsycoca,update-mime-database} || die
-	chmod +x "${T}"/{kbuildsycoca,update-mime-database} || die
-
-	export QMAKE="${EPREFIX}/usr/$(get_libdir)/qt5/bin/qmake"
-
-	# Unset DISPLAY in order to prevent xdg-mime from triggering a sandbox
-	# violation with kbuildsycoca as in bug #287067, comment #13.
-	export -n DISPLAY
-
-	# Bug #352625 - Some LANGUAGE values can trigger the following ValueError:
-	#   File "/usr/lib/python2.6/locale.py", line 486, in getdefaultlocale
-	#    return _parse_localename(localename)
-	#  File "/usr/lib/python2.6/locale.py", line 418, in _parse_localename
-	#    raise ValueError, 'unknown locale: %s' % localename
-	#ValueError: unknown locale: 46
-	export -n LANG LANGUAGE ${!LC_*}
-	export LC_ALL=C.utf8 #709682
-
-	# Bug #295672 - Avoid sandbox violation in ~/.config by forcing
-	# variables to point to our fake temporary $HOME.
-	export HOME="${T}/fake_homedir"
-	export XDG_CONFIG_HOME="${HOME}/.config"
-	export XDG_DATA_HOME="${HOME}/.local/share"
-	export CALIBRE_CONFIG_DIRECTORY="${XDG_CONFIG_HOME}/calibre"
-	mkdir -p "${XDG_DATA_HOME}" "${CALIBRE_CONFIG_DIRECTORY}" || die
-
-	tc-export CC CXX
-	# Bug #334243 - respect LDFLAGS when building extensions
-	export OVERRIDE_CFLAGS="$CFLAGS" OVERRIDE_LDFLAGS="$LDFLAGS"
-	local libdir=$(get_libdir)
-	[[ -n $libdir ]] || die "get_libdir returned an empty string"
-
-	addpredict /dev/dri #665310
-
-	PATH=${T}:${PATH} PYTHONPATH=${S}/src${PYTHONPATH:+:}${PYTHONPATH} \
-	"${PYTHON}" setup.py install \
-		--root="${D}" \
-		--prefix="${EPREFIX}/usr" \
-		--libdir="${EPREFIX}/usr/${libdir}" \
-		--staging-root="${ED}/usr" \
-		--staging-libdir="${ED}/usr/${libdir}" || die
-
-	rm "${ED}/usr/share/applications/defaults.list" || die
-	find "${ED}"/usr/share -type d -empty -delete
-
-	cd "${ED}"/usr/share/calibre/fonts/liberation || die
-	local x
-	for x in * ; do
-		[[ -f ${EPREFIX}/usr/share/fonts/liberation-fonts/${x} ]] || continue
-		ln -sf "../../../fonts/liberation-fonts/${x}" "${x}" || die
-	done
-
-	einfo "Converting python shebangs"
-	python_fix_shebang --force "${ED}"
-
-	einfo "Compiling python modules"
-	python_optimize "${ED}"/usr/lib/calibre
-
-	newinitd "${FILESDIR}"/calibre-server-3.init calibre-server
-	newconfd "${FILESDIR}"/calibre-server-3.conf calibre-server
-
-	bashcomp_alias calibre \
-		lrfviewer \
-		calibre-debug \
-		ebook-meta \
-		calibre-server \
-		ebook-viewer \
-		ebook-polish \
-		fetch-ebook-metadata \
-		lrf2lrs \
-		ebook-convert \
-		ebook-edit \
-		calibre-smtp \
-		ebook-device
-
-}
-
-pkg_preinst() {
-	# Indentify stray directories from upstream's "Binary install"
-	# method (see bug 622728).
-	CALIBRE_LIB_DIR=/usr/$(get_libdir)/calibre
-	CALIBRE_LIB_CONTENT=$(for x in "${ED}${CALIBRE_LIB_DIR}"/*; do
-		printf -- "${x##*/} "; done) || die "Failed to list ${ED}${CALIBRE_LIB_DIR}"
-}
-
-pkg_postinst() {
-	[[ -n ${CALIBRE_LIB_DIR} ]] || die "CALIBRE_LIB_DIR is unset"
-	local x
-	for x in "${EROOT}${CALIBRE_LIB_DIR}"/*; do
-		if [[ " ${CALIBRE_LIB_CONTENT} " != *" ${x##*/} "* ]]; then
-			elog "Purging '${x}'"
-			rm -rf "${x}"
-		fi
-	done
-	xdg_desktop_database_update
-	xdg_mimeinfo_database_update
-	xdg_icon_cache_update
-}
-
-pkg_postrm() {
-	xdg_desktop_database_update
-	xdg_mimeinfo_database_update
-	xdg_icon_cache_update
-}

diff --git a/app-text/calibre/calibre-4.23.0.ebuild b/app-text/calibre/calibre-4.23.0.ebuild
deleted file mode 100644
index ac0a731d05c..00000000000
--- a/app-text/calibre/calibre-4.23.0.ebuild
+++ /dev/null
@@ -1,278 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-PYTHON_COMPAT=( python3_{7..8} )
-PYTHON_REQ_USE="sqlite,ssl"
-
-inherit bash-completion-r1 desktop toolchain-funcs python-single-r1 xdg-utils
-
-DESCRIPTION="Ebook management application"
-HOMEPAGE="https://calibre-ebook.com/"
-SRC_URI="https://download.calibre-ebook.com/${PV}/${P}.tar.xz"
-
-LICENSE="
-	GPL-3+
-	GPL-3
-	GPL-2+
-	GPL-2
-	GPL-1+
-	LGPL-3+
-	LGPL-2.1+
-	LGPL-2.1
-	BSD
-	MIT
-	Old-MIT
-	Apache-2.0
-	public-domain
-	|| ( Artistic GPL-1+ )
-	CC-BY-3.0
-	OFL-1.1
-	PSF-2
-"
-KEYWORDS="~amd64 ~arm ~x86"
-SLOT="0"
-IUSE="ios +udisks"
-
-REQUIRED_USE="${PYTHON_REQUIRED_USE}"
-
-COMMON_DEPEND="${PYTHON_DEPS}
-	>=app-text/hunspell-1.7:=
-	>=app-text/podofo-0.9.6_pre20171027:=
-	>=app-text/poppler-0.26.5[qt5]
-	>=dev-libs/chmlib-0.40:=
-	dev-libs/glib:2=
-	dev-libs/hyphen:=
-	>=dev-libs/icu-57.1:=
-	dev-libs/libinput:=
-	>=dev-libs/dbus-glib-0.106
-	>=sys-apps/dbus-1.10.8
-	$(python_gen_cond_dep '
-		>=dev-python/apsw-3.25.2_p1[${PYTHON_MULTI_USEDEP}]
-		dev-python/beautifulsoup:4[${PYTHON_MULTI_USEDEP}]
-		>=dev-python/chardet-3.0.3[${PYTHON_MULTI_USEDEP}]
-		>=dev-python/cssselect-0.7.1[${PYTHON_MULTI_USEDEP}]
-		>=dev-python/css-parser-1.0.4[${PYTHON_MULTI_USEDEP}]
-		>=dev-python/dbus-python-1.2.4[${PYTHON_MULTI_USEDEP}]
-		dev-python/dnspython[${PYTHON_MULTI_USEDEP}]
-		>=dev-python/feedparser-5.2.1[${PYTHON_MULTI_USEDEP}]
-		>=dev-python/html2text-2019.8.11[${PYTHON_MULTI_USEDEP}]
-		>=dev-python/html5-parser-0.4.9[${PYTHON_MULTI_USEDEP}]
-		>=dev-python/lxml-3.8.0[${PYTHON_MULTI_USEDEP}]
-		>=dev-python/markdown-3.0.1[${PYTHON_MULTI_USEDEP}]
-		>=dev-python/mechanize-0.3.5[${PYTHON_MULTI_USEDEP}]
-		>=dev-python/msgpack-0.6.2[${PYTHON_MULTI_USEDEP}]
-		>=dev-python/netifaces-0.10.5[${PYTHON_MULTI_USEDEP}]
-		>=dev-python/pillow-3.2.0[${PYTHON_MULTI_USEDEP}]
-		>=dev-python/psutil-4.3.0[${PYTHON_MULTI_USEDEP}]
-		>=dev-python/pygments-2.3.1[${PYTHON_MULTI_USEDEP}]
-		>=dev-python/python-dateutil-2.5.3[${PYTHON_MULTI_USEDEP}]
-		>=dev-python/PyQt5-5.12[gui,svg,widgets,network,printsupport,${PYTHON_MULTI_USEDEP}]
-		>=dev-python/PyQtWebEngine-5.12[${PYTHON_MULTI_USEDEP}]
-		dev-python/regex[${PYTHON_MULTI_USEDEP}]
-		dev-python/zeroconf[${PYTHON_MULTI_USEDEP}]
-	')
-	dev-qt/qtcore:5=
-	dev-qt/qtdbus:5=
-	dev-qt/qtgui:5=[jpeg]
-	>=dev-qt/qtwebengine-5.12
-	dev-qt/qtwidgets:5=
-	dev-util/desktop-file-utils
-	dev-util/gtk-update-icon-cache
-	media-fonts/liberation-fonts
-	media-libs/fontconfig:=
-	>=media-libs/freetype-2:=
-	>=media-libs/libmtp-1.1.11:=
-	>=media-libs/libwmf-0.2.8
-	>=media-gfx/optipng-0.7.6
-	>=sys-libs/zlib-1.2.11:=
-	virtual/libusb:1=
-	x11-libs/libxkbcommon:=
-	x11-libs/libX11:=
-	x11-libs/libXext:=
-	x11-libs/libXrender:=
-	x11-misc/shared-mime-info
-	>=x11-misc/xdg-utils-1.0.2-r2
-	ios? (
-		>=app-pda/usbmuxd-1.0.8
-		>=app-pda/libimobiledevice-1.2.0
-	)
-	udisks? ( virtual/libudev )"
-RDEPEND="${COMMON_DEPEND}
-	udisks? ( sys-fs/udisks:2 )"
-DEPEND="${COMMON_DEPEND}
-	$(python_gen_cond_dep '
-		>=dev-python/setuptools-23.1.0[${PYTHON_MULTI_USEDEP}]
-		<dev-python/sip-5[${PYTHON_MULTI_USEDEP}]
-	')
-	>=virtual/podofo-build-0.9.6_pre20171027
-	virtual/pkgconfig"
-
-pkg_pretend() {
-	if [[ ${MERGE_TYPE} != binary ]] && tc-is-gcc && [[ $(gcc-major-version) -lt 6 ]]; then
-		eerror "Calibre cannot be built with this version of gcc."
-		eerror "You need at least gcc-6.0"
-		die "Your C compiler is too old for this package."
-	fi
-}
-
-src_prepare() {
-	# no_updates: do not annoy user with "new version is availible all the time
-	# disable_plugins: walking sec-hole, wait for upstream to use GHNS interface
-	eapply \
-		"${FILESDIR}/${PN}-2.9.0-no_updates_dialog.patch" \
-		"${FILESDIR}/${PN}-disable_plugins.patch"
-
-	has_version ">=dev-libs/icu-68.1" && eapply "${FILESDIR}/${PN}-4.22.0-icu68.patch"
-
-	eapply_user
-
-	# Fix outdated version constant.
-	#sed -e "s#\\(^numeric_version =\\).*#\\1 (${PV//./, })#" \
-	#	-i src/calibre/constants.py || \
-	#	die "sed failed to patch constants.py"
-
-	# Avoid sandbox violation in /usr/share/gnome/apps when linux.py
-	# calls xdg-* (bug #258938).
-	sed -e "s|'xdg-desktop-menu', 'install'|\\0, '--mode', 'user'|" \
-		-e "s|check_call(\\['xdg-desktop-menu', 'forceupdate'\\])|#\\0|" \
-		-e "s|\\(CurrentDir(tdir)\\), \\\\\$|\\1:|" \
-		-e "s|, PreserveMIMEDefaults():|:|" \
-		-e "s|'xdg-icon-resource', 'install'|\\0, '--mode', 'user'|" \
-		-e "s|cmd\[2\]|cmd[4]|" \
-		-e "s|cc(\\['xdg-desktop-menu', 'forceupdate'\\])|#\\0|" \
-		-e "s|'xdg-mime', 'install'|\\0, '--mode', 'user'|" \
-		-i src/calibre/linux.py || die "sed failed to patch linux.py"
-
-	# Disable unnecessary privilege dropping for bug #287067.
-	sed -e "s:if os.geteuid() == 0:if False and os.geteuid() == 0:" \
-		-i setup/install.py || die "sed failed to patch install.py"
-
-	sed -e "/^                self.check_call(\\[QMAKE\\] + qmc + \\[proname\\])$/a\
-\\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ self.check_call(['sed', \
-'-e', 's|^CFLAGS .*|\\\\\\\\0 ${CFLAGS}|', \
-'-e', 's|^CXXFLAGS .*|\\\\\\\\0 ${CXXFLAGS}|', \
-'-e', 's|^LFLAGS .*|\\\\\\\\0 ${LDFLAGS}|', \
-'-i', '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"
-}
-
-src_install() {
-	# calibre works with python 3, so remove the python 2 constraint
-	export CALIBRE_PY3_PORT=1
-
-	# Bypass kbuildsycoca and update-mime-database in order to
-	# avoid sandbox violations if xdg-mime tries to call them.
-	mkdir "${T}/bin" || die
-	cat - > "${T}/bin/kbuildsycoca" <<-EOF
-	#!${BASH}
-	echo $0 : $@
-	exit 0
-	EOF
-
-	cp "${T}"/bin/{kbuildsycoca,update-mime-database} || die
-	chmod +x "${T}"/bin/{kbuildsycoca,update-mime-database} || die
-
-	export QMAKE="${EPREFIX}/usr/$(get_libdir)/qt5/bin/qmake"
-
-	# Unset DISPLAY in order to prevent xdg-mime from triggering a sandbox
-	# violation with kbuildsycoca as in bug #287067, comment #13.
-	export -n DISPLAY
-
-	# Bug #352625 - Some LANGUAGE values can trigger the following ValueError:
-	#   File "/usr/lib/python2.6/locale.py", line 486, in getdefaultlocale
-	#    return _parse_localename(localename)
-	#  File "/usr/lib/python2.6/locale.py", line 418, in _parse_localename
-	#    raise ValueError, 'unknown locale: %s' % localename
-	#ValueError: unknown locale: 46
-	export -n LANG LANGUAGE ${!LC_*}
-	export LC_ALL=C.utf8 #709682
-
-	# Bug #295672 - Avoid sandbox violation in ~/.config by forcing
-	# variables to point to our fake temporary $HOME.
-	export HOME="${T}/fake_homedir"
-	export XDG_CONFIG_HOME="${HOME}/.config"
-	export XDG_DATA_HOME="${HOME}/.local/share"
-	export CALIBRE_CONFIG_DIRECTORY="${XDG_CONFIG_HOME}/calibre"
-	mkdir -p "${XDG_DATA_HOME}" "${CALIBRE_CONFIG_DIRECTORY}" || die
-
-	tc-export CC CXX
-	# Bug #334243 - respect LDFLAGS when building extensions
-	export OVERRIDE_CFLAGS="$CFLAGS" OVERRIDE_LDFLAGS="$LDFLAGS"
-	local libdir=$(get_libdir)
-	[[ -n $libdir ]] || die "get_libdir returned an empty string"
-
-	addpredict /dev/dri #665310
-
-	PATH=${T}/bin:${PATH} PYTHONPATH=${S}/src${PYTHONPATH:+:}${PYTHONPATH} \
-	"${PYTHON}" setup.py install \
-		--root="${D}" \
-		--prefix="${EPREFIX}/usr" \
-		--libdir="${EPREFIX}/usr/${libdir}" \
-		--staging-root="${ED}/usr" \
-		--staging-libdir="${ED}/usr/${libdir}" || die
-
-	rm "${ED}/usr/share/applications/defaults.list" || die
-	find "${ED}"/usr/share -type d -empty -delete
-
-	cd "${ED}"/usr/share/calibre/fonts/liberation || die
-	local x
-	for x in * ; do
-		[[ -f ${EPREFIX}/usr/share/fonts/liberation-fonts/${x} ]] || continue
-		ln -sf "../../../fonts/liberation-fonts/${x}" "${x}" || die
-	done
-
-	einfo "Converting python shebangs"
-	python_fix_shebang --force "${ED}"
-
-	einfo "Compiling python modules"
-	python_optimize "${ED}"/usr/lib/calibre
-
-	newinitd "${FILESDIR}"/calibre-server-3.init calibre-server
-	newconfd "${FILESDIR}"/calibre-server-3.conf calibre-server
-
-	bashcomp_alias calibre \
-		lrfviewer \
-		calibre-debug \
-		ebook-meta \
-		calibre-server \
-		ebook-viewer \
-		ebook-polish \
-		fetch-ebook-metadata \
-		lrf2lrs \
-		ebook-convert \
-		ebook-edit \
-		calibre-smtp \
-		ebook-device
-
-}
-
-pkg_preinst() {
-	# Indentify stray directories from upstream's "Binary install"
-	# method (see bug 622728).
-	CALIBRE_LIB_DIR=/usr/$(get_libdir)/calibre
-	CALIBRE_LIB_CONTENT=$(for x in "${ED}${CALIBRE_LIB_DIR}"/*; do
-		printf -- "${x##*/} "; done) || die "Failed to list ${ED}${CALIBRE_LIB_DIR}"
-}
-
-pkg_postinst() {
-	[[ -n ${CALIBRE_LIB_DIR} ]] || die "CALIBRE_LIB_DIR is unset"
-	local x
-	for x in "${EROOT}${CALIBRE_LIB_DIR}"/*; do
-		if [[ " ${CALIBRE_LIB_CONTENT} " != *" ${x##*/} "* ]]; then
-			elog "Purging '${x}'"
-			rm -rf "${x}"
-		fi
-	done
-	xdg_desktop_database_update
-	xdg_mimeinfo_database_update
-	xdg_icon_cache_update
-}
-
-pkg_postrm() {
-	xdg_desktop_database_update
-	xdg_mimeinfo_database_update
-	xdg_icon_cache_update
-}

diff --git a/app-text/calibre/calibre-5.13.0.ebuild b/app-text/calibre/calibre-5.13.0.ebuild
deleted file mode 100644
index be03ce4ed47..00000000000
--- a/app-text/calibre/calibre-5.13.0.ebuild
+++ /dev/null
@@ -1,264 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-PYTHON_COMPAT=( python3_{8..9} )
-PYTHON_REQ_USE="ipv6,sqlite,ssl"
-
-inherit bash-completion-r1 desktop toolchain-funcs python-single-r1 xdg-utils
-
-DESCRIPTION="Ebook management application"
-HOMEPAGE="https://calibre-ebook.com/"
-SRC_URI="https://download.calibre-ebook.com/${PV}/${P}.tar.xz
-	https://dev.gentoo.org/~zmedico/dist/calibre-5.4.2-SIP-v4-04ad7b.patch
-	https://dev.gentoo.org/~zmedico/dist/calibre-5.4.2-SIP-v4.patch.xz"
-
-LICENSE="
-	GPL-3+
-	GPL-3
-	GPL-2+
-	GPL-2
-	GPL-1+
-	LGPL-3+
-	LGPL-2.1+
-	LGPL-2.1
-	BSD
-	MIT
-	Old-MIT
-	Apache-2.0
-	public-domain
-	|| ( Artistic GPL-1+ )
-	CC-BY-3.0
-	OFL-1.1
-	PSF-2
-"
-KEYWORDS="~amd64 ~arm ~x86"
-SLOT="0"
-IUSE="ios +udisks"
-
-REQUIRED_USE="${PYTHON_REQUIRED_USE}"
-
-COMMON_DEPEND="${PYTHON_DEPS}
-	>=app-text/hunspell-1.7:=
-	>=app-text/podofo-0.9.6_pre20171027:=
-	>=app-text/poppler-0.26.5[qt5]
-	dev-libs/glib:2=
-	dev-libs/hyphen:=
-	>=dev-libs/icu-57.1:=
-	dev-libs/libinput:=
-	>=dev-libs/dbus-glib-0.106
-	>=sys-apps/dbus-1.10.8
-	$(python_gen_cond_dep '
-		>=dev-python/apsw-3.25.2_p1[${PYTHON_MULTI_USEDEP}]
-		dev-python/beautifulsoup:4[${PYTHON_MULTI_USEDEP}]
-		>=dev-python/chardet-3.0.3[${PYTHON_MULTI_USEDEP}]
-		>=dev-python/cssselect-0.7.1[${PYTHON_MULTI_USEDEP}]
-		>=dev-python/css-parser-1.0.4[${PYTHON_MULTI_USEDEP}]
-		>=dev-python/dbus-python-1.2.4[${PYTHON_MULTI_USEDEP}]
-		dev-python/dnspython[${PYTHON_MULTI_USEDEP}]
-		>=dev-python/feedparser-5.2.1[${PYTHON_MULTI_USEDEP}]
-		>=dev-python/html2text-2019.8.11[${PYTHON_MULTI_USEDEP}]
-		>=dev-python/html5-parser-0.4.9[${PYTHON_MULTI_USEDEP}]
-		>=dev-python/lxml-3.8.0[${PYTHON_MULTI_USEDEP}]
-		>=dev-python/markdown-3.0.1[${PYTHON_MULTI_USEDEP}]
-		>=dev-python/mechanize-0.3.5[${PYTHON_MULTI_USEDEP}]
-		>=dev-python/msgpack-0.6.2[${PYTHON_MULTI_USEDEP}]
-		>=dev-python/netifaces-0.10.5[${PYTHON_MULTI_USEDEP}]
-		>=dev-python/pillow-3.2.0[${PYTHON_MULTI_USEDEP}]
-		>=dev-python/psutil-4.3.0[${PYTHON_MULTI_USEDEP}]
-		>=dev-python/pychm-0.8.6[${PYTHON_MULTI_USEDEP}]
-		>=dev-python/pygments-2.3.1[${PYTHON_MULTI_USEDEP}]
-		>=dev-python/python-dateutil-2.5.3[${PYTHON_MULTI_USEDEP}]
-		>=dev-python/PyQt5-5.12[gui,svg,widgets,network,printsupport,${PYTHON_MULTI_USEDEP}]
-		>=dev-python/PyQtWebEngine-5.12[${PYTHON_MULTI_USEDEP}]
-		dev-python/regex[${PYTHON_MULTI_USEDEP}]
-		dev-python/zeroconf[${PYTHON_MULTI_USEDEP}]
-	')
-	dev-qt/qtcore:5=
-	dev-qt/qtdbus:5=
-	dev-qt/qtgui:5=[jpeg]
-	>=dev-qt/qtwebengine-5.12
-	dev-qt/qtwidgets:5=
-	dev-util/desktop-file-utils
-	dev-util/gtk-update-icon-cache
-	media-fonts/liberation-fonts
-	media-libs/fontconfig:=
-	>=media-libs/freetype-2:=
-	>=media-libs/libmtp-1.1.11:=
-	>=media-libs/libwmf-0.2.8
-	>=media-gfx/optipng-0.7.6
-	>=sys-libs/zlib-1.2.11:=
-	virtual/libusb:1=
-	x11-libs/libxkbcommon:=
-	x11-libs/libX11:=
-	x11-libs/libXext:=
-	x11-libs/libXrender:=
-	x11-misc/shared-mime-info
-	>=x11-misc/xdg-utils-1.0.2-r2
-	ios? (
-		>=app-pda/usbmuxd-1.0.8
-		>=app-pda/libimobiledevice-1.2.0
-	)
-	udisks? ( virtual/libudev )"
-RDEPEND="${COMMON_DEPEND}
-	udisks? ( sys-fs/udisks:2 )"
-DEPEND="${COMMON_DEPEND}
-	$(python_gen_cond_dep '
-		>=dev-python/setuptools-23.1.0[${PYTHON_MULTI_USEDEP}]
-		<dev-python/sip-5[${PYTHON_MULTI_USEDEP}]
-	')
-	>=virtual/podofo-build-0.9.6_pre20171027
-	virtual/pkgconfig"
-
-pkg_pretend() {
-	if [[ ${MERGE_TYPE} != binary ]] && tc-is-gcc && [[ $(gcc-major-version) -lt 6 ]]; then
-		eerror "Calibre cannot be built with this version of gcc."
-		eerror "You need at least gcc-6.0"
-		die "Your C compiler is too old for this package."
-	fi
-}
-
-src_prepare() {
-	# no_updates: do not annoy user with "new version is availible all the time
-	# disable_plugins: walking sec-hole, wait for upstream to use GHNS interface
-	eapply \
-		"${FILESDIR}/${PN}-2.9.0-no_updates_dialog.patch" \
-		"${FILESDIR}/${PN}-disable_plugins.patch" \
-		"${DISTDIR}/${PN}-5.4.2-SIP-v4-04ad7b.patch" \
-		"${WORKDIR}/${PN}-5.4.2-SIP-v4.patch"
-
-	eapply_user
-
-	# Fix outdated version constant.
-	#sed -e "s#\\(^numeric_version =\\).*#\\1 (${PV//./, })#" \
-	#	-i src/calibre/constants.py || \
-	#	die "sed failed to patch constants.py"
-
-	# Avoid sandbox violation in /usr/share/gnome/apps when linux.py
-	# calls xdg-* (bug #258938).
-	sed -e "s|'xdg-desktop-menu', 'install'|\\0, '--mode', 'user'|" \
-		-e "s|check_call(\\['xdg-desktop-menu', 'forceupdate'\\])|#\\0|" \
-		-e "s|\\(CurrentDir(tdir)\\), \\\\\$|\\1:|" \
-		-e "s|, PreserveMIMEDefaults():|:|" \
-		-e "s|'xdg-icon-resource', 'install'|\\0, '--mode', 'user'|" \
-		-e "s|cmd\[2\]|cmd[4]|" \
-		-e "s|cc(\\['xdg-desktop-menu', 'forceupdate'\\])|#\\0|" \
-		-e "s|'xdg-mime', 'install'|\\0, '--mode', 'user'|" \
-		-i src/calibre/linux.py || die "sed failed to patch linux.py"
-
-	# Disable unnecessary privilege dropping for bug #287067.
-	sed -e "s:if os.geteuid() == 0:if False and os.geteuid() == 0:" \
-		-i setup/install.py || die "sed failed to patch install.py"
-
-	sed -e "/^                self.check_call(\\[QMAKE\\] + qmc + \\[proname\\])$/a\
-\\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ self.check_call(['sed', \
-'-e', 's|^CFLAGS .*|\\\\\\\\0 ${CFLAGS}|', \
-'-e', 's|^CXXFLAGS .*|\\\\\\\\0 ${CXXFLAGS}|', \
-'-e', 's|^LFLAGS .*|\\\\\\\\0 ${LDFLAGS}|', \
-'-i', '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"
-}
-
-src_install() {
-	# calibre works with python 3, so remove the python 2 constraint
-	export CALIBRE_PY3_PORT=1
-
-	# Bypass kbuildsycoca and update-mime-database in order to
-	# avoid sandbox violations if xdg-mime tries to call them.
-	mkdir "${T}/bin" || die
-	cat - > "${T}/bin/kbuildsycoca" <<-EOF
-	#!${BASH}
-	echo $0 : $@
-	exit 0
-	EOF
-
-	cp "${T}"/bin/{kbuildsycoca,update-mime-database} || die
-	chmod +x "${T}"/bin/{kbuildsycoca,update-mime-database} || die
-
-	export QMAKE="${EPREFIX}/usr/$(get_libdir)/qt5/bin/qmake"
-
-	# Unset DISPLAY in order to prevent xdg-mime from triggering a sandbox
-	# violation with kbuildsycoca as in bug #287067, comment #13.
-	export -n DISPLAY
-
-	# Bug #352625 - Some LANGUAGE values can trigger the following ValueError:
-	#   File "/usr/lib/python2.6/locale.py", line 486, in getdefaultlocale
-	#    return _parse_localename(localename)
-	#  File "/usr/lib/python2.6/locale.py", line 418, in _parse_localename
-	#    raise ValueError, 'unknown locale: %s' % localename
-	#ValueError: unknown locale: 46
-	export -n LANG LANGUAGE ${!LC_*}
-	export LC_ALL=C.utf8 #709682
-
-	# Bug #295672 - Avoid sandbox violation in ~/.config by forcing
-	# variables to point to our fake temporary $HOME.
-	export HOME="${T}/fake_homedir"
-	export XDG_CONFIG_HOME="${HOME}/.config"
-	export XDG_DATA_HOME="${HOME}/.local/share"
-	export CALIBRE_CONFIG_DIRECTORY="${XDG_CONFIG_HOME}/calibre"
-	mkdir -p "${XDG_DATA_HOME}" "${CALIBRE_CONFIG_DIRECTORY}" || die
-
-	tc-export CC CXX
-	# Bug #334243 - respect LDFLAGS when building extensions
-	export OVERRIDE_CFLAGS="$CFLAGS" OVERRIDE_LDFLAGS="$LDFLAGS"
-	local libdir=$(get_libdir)
-	[[ -n $libdir ]] || die "get_libdir returned an empty string"
-
-	addpredict /dev/dri #665310
-
-	PATH=${T}/bin:${PATH} PYTHONPATH=${S}/src${PYTHONPATH:+:}${PYTHONPATH} \
-	"${PYTHON}" setup.py install \
-		--root="${D}" \
-		--prefix="${EPREFIX}/usr" \
-		--libdir="${EPREFIX}/usr/${libdir}" \
-		--staging-root="${ED}/usr" \
-		--staging-libdir="${ED}/usr/${libdir}" || die
-
-	find "${ED}"/usr/share -type d -empty -delete
-
-	cd "${ED}"/usr/share/calibre/fonts/liberation || die
-	local x
-	for x in * ; do
-		[[ -f ${EPREFIX}/usr/share/fonts/liberation-fonts/${x} ]] || continue
-		ln -sf "../../../fonts/liberation-fonts/${x}" "${x}" || die
-	done
-
-	einfo "Converting python shebangs"
-	python_fix_shebang --force "${ED}"
-
-	einfo "Compiling python modules"
-	python_optimize "${ED}"/usr/$(get_libdir)/calibre "${D}/$(python_get_sitedir)"
-
-	newinitd "${FILESDIR}"/calibre-server-3.init calibre-server
-	newconfd "${FILESDIR}"/calibre-server-3.conf calibre-server
-}
-
-pkg_preinst() {
-	# Indentify stray directories from upstream's "Binary install"
-	# method (see bug 622728).
-	CALIBRE_LIB_DIR=/usr/$(get_libdir)/calibre
-	CALIBRE_LIB_CONTENT=$(for x in "${ED}${CALIBRE_LIB_DIR}"/*; do
-		printf -- "${x##*/} "; done) || die "Failed to list ${ED}${CALIBRE_LIB_DIR}"
-}
-
-pkg_postinst() {
-	[[ -n ${CALIBRE_LIB_DIR} ]] || die "CALIBRE_LIB_DIR is unset"
-	local x
-	for x in "${EROOT}${CALIBRE_LIB_DIR}"/*; do
-		if [[ " ${CALIBRE_LIB_CONTENT} " != *" ${x##*/} "* ]]; then
-			elog "Purging '${x}'"
-			rm -rf "${x}"
-		fi
-	done
-	xdg_desktop_database_update
-	xdg_mimeinfo_database_update
-	xdg_icon_cache_update
-}
-
-pkg_postrm() {
-	xdg_desktop_database_update
-	xdg_mimeinfo_database_update
-	xdg_icon_cache_update
-}

diff --git a/app-text/calibre/calibre-5.4.2-r1.ebuild b/app-text/calibre/calibre-5.4.2-r1.ebuild
deleted file mode 100644
index 237c69e913c..00000000000
--- a/app-text/calibre/calibre-5.4.2-r1.ebuild
+++ /dev/null
@@ -1,265 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-PYTHON_COMPAT=( python3_{7..8} )
-PYTHON_REQ_USE="ipv6,sqlite,ssl"
-
-inherit bash-completion-r1 desktop toolchain-funcs python-single-r1 xdg-utils
-
-DESCRIPTION="Ebook management application"
-HOMEPAGE="https://calibre-ebook.com/"
-SRC_URI="https://download.calibre-ebook.com/${PV}/${P}.tar.xz
-	https://dev.gentoo.org/~zmedico/dist/calibre-5.4.2-SIP-v4.patch.xz"
-
-LICENSE="
-	GPL-3+
-	GPL-3
-	GPL-2+
-	GPL-2
-	GPL-1+
-	LGPL-3+
-	LGPL-2.1+
-	LGPL-2.1
-	BSD
-	MIT
-	Old-MIT
-	Apache-2.0
-	public-domain
-	|| ( Artistic GPL-1+ )
-	CC-BY-3.0
-	OFL-1.1
-	PSF-2
-"
-KEYWORDS="~amd64 ~arm ~x86"
-SLOT="0"
-IUSE="ios +udisks"
-
-REQUIRED_USE="${PYTHON_REQUIRED_USE}"
-
-COMMON_DEPEND="${PYTHON_DEPS}
-	>=app-text/hunspell-1.7:=
-	>=app-text/podofo-0.9.6_pre20171027:=
-	>=app-text/poppler-0.26.5[qt5]
-	dev-libs/glib:2=
-	dev-libs/hyphen:=
-	>=dev-libs/icu-57.1:=
-	dev-libs/libinput:=
-	>=dev-libs/dbus-glib-0.106
-	>=sys-apps/dbus-1.10.8
-	$(python_gen_cond_dep '
-		>=dev-python/apsw-3.25.2_p1[${PYTHON_MULTI_USEDEP}]
-		dev-python/beautifulsoup:4[${PYTHON_MULTI_USEDEP}]
-		>=dev-python/chardet-3.0.3[${PYTHON_MULTI_USEDEP}]
-		>=dev-python/cssselect-0.7.1[${PYTHON_MULTI_USEDEP}]
-		>=dev-python/css-parser-1.0.4[${PYTHON_MULTI_USEDEP}]
-		>=dev-python/dbus-python-1.2.4[${PYTHON_MULTI_USEDEP}]
-		dev-python/dnspython[${PYTHON_MULTI_USEDEP}]
-		>=dev-python/feedparser-5.2.1[${PYTHON_MULTI_USEDEP}]
-		>=dev-python/html2text-2019.8.11[${PYTHON_MULTI_USEDEP}]
-		>=dev-python/html5-parser-0.4.9[${PYTHON_MULTI_USEDEP}]
-		>=dev-python/lxml-3.8.0[${PYTHON_MULTI_USEDEP}]
-		>=dev-python/markdown-3.0.1[${PYTHON_MULTI_USEDEP}]
-		>=dev-python/mechanize-0.3.5[${PYTHON_MULTI_USEDEP}]
-		>=dev-python/msgpack-0.6.2[${PYTHON_MULTI_USEDEP}]
-		>=dev-python/netifaces-0.10.5[${PYTHON_MULTI_USEDEP}]
-		>=dev-python/pillow-3.2.0[${PYTHON_MULTI_USEDEP}]
-		>=dev-python/psutil-4.3.0[${PYTHON_MULTI_USEDEP}]
-		>=dev-python/pychm-0.8.6[${PYTHON_MULTI_USEDEP}]
-		>=dev-python/pygments-2.3.1[${PYTHON_MULTI_USEDEP}]
-		>=dev-python/python-dateutil-2.5.3[${PYTHON_MULTI_USEDEP}]
-		>=dev-python/PyQt5-5.12[gui,svg,widgets,network,printsupport,${PYTHON_MULTI_USEDEP}]
-		>=dev-python/PyQtWebEngine-5.12[${PYTHON_MULTI_USEDEP}]
-		dev-python/regex[${PYTHON_MULTI_USEDEP}]
-		dev-python/zeroconf[${PYTHON_MULTI_USEDEP}]
-	')
-	dev-qt/qtcore:5=
-	dev-qt/qtdbus:5=
-	dev-qt/qtgui:5=[jpeg]
-	>=dev-qt/qtwebengine-5.12
-	dev-qt/qtwidgets:5=
-	dev-util/desktop-file-utils
-	dev-util/gtk-update-icon-cache
-	media-fonts/liberation-fonts
-	media-libs/fontconfig:=
-	>=media-libs/freetype-2:=
-	>=media-libs/libmtp-1.1.11:=
-	>=media-libs/libwmf-0.2.8
-	>=media-gfx/optipng-0.7.6
-	>=sys-libs/zlib-1.2.11:=
-	virtual/libusb:1=
-	x11-libs/libxkbcommon:=
-	x11-libs/libX11:=
-	x11-libs/libXext:=
-	x11-libs/libXrender:=
-	x11-misc/shared-mime-info
-	>=x11-misc/xdg-utils-1.0.2-r2
-	ios? (
-		>=app-pda/usbmuxd-1.0.8
-		>=app-pda/libimobiledevice-1.2.0
-	)
-	udisks? ( virtual/libudev )"
-RDEPEND="${COMMON_DEPEND}
-	udisks? ( sys-fs/udisks:2 )"
-DEPEND="${COMMON_DEPEND}
-	$(python_gen_cond_dep '
-		>=dev-python/setuptools-23.1.0[${PYTHON_MULTI_USEDEP}]
-		<dev-python/sip-5[${PYTHON_MULTI_USEDEP}]
-	')
-	>=virtual/podofo-build-0.9.6_pre20171027
-	virtual/pkgconfig"
-
-pkg_pretend() {
-	if [[ ${MERGE_TYPE} != binary ]] && tc-is-gcc && [[ $(gcc-major-version) -lt 6 ]]; then
-		eerror "Calibre cannot be built with this version of gcc."
-		eerror "You need at least gcc-6.0"
-		die "Your C compiler is too old for this package."
-	fi
-}
-
-src_prepare() {
-	# no_updates: do not annoy user with "new version is availible all the time
-	# disable_plugins: walking sec-hole, wait for upstream to use GHNS interface
-	eapply \
-		"${FILESDIR}/${PN}-2.9.0-no_updates_dialog.patch" \
-		"${FILESDIR}/${PN}-disable_plugins.patch" \
-		"${WORKDIR}/${PN}-5.4.2-SIP-v4.patch"
-
-	has_version ">=dev-libs/icu-68.1" && eapply "${FILESDIR}/${PN}-4.22.0-icu68.patch"
-
-	eapply_user
-
-	# Fix outdated version constant.
-	#sed -e "s#\\(^numeric_version =\\).*#\\1 (${PV//./, })#" \
-	#	-i src/calibre/constants.py || \
-	#	die "sed failed to patch constants.py"
-
-	# Avoid sandbox violation in /usr/share/gnome/apps when linux.py
-	# calls xdg-* (bug #258938).
-	sed -e "s|'xdg-desktop-menu', 'install'|\\0, '--mode', 'user'|" \
-		-e "s|check_call(\\['xdg-desktop-menu', 'forceupdate'\\])|#\\0|" \
-		-e "s|\\(CurrentDir(tdir)\\), \\\\\$|\\1:|" \
-		-e "s|, PreserveMIMEDefaults():|:|" \
-		-e "s|'xdg-icon-resource', 'install'|\\0, '--mode', 'user'|" \
-		-e "s|cmd\[2\]|cmd[4]|" \
-		-e "s|cc(\\['xdg-desktop-menu', 'forceupdate'\\])|#\\0|" \
-		-e "s|'xdg-mime', 'install'|\\0, '--mode', 'user'|" \
-		-i src/calibre/linux.py || die "sed failed to patch linux.py"
-
-	# Disable unnecessary privilege dropping for bug #287067.
-	sed -e "s:if os.geteuid() == 0:if False and os.geteuid() == 0:" \
-		-i setup/install.py || die "sed failed to patch install.py"
-
-	sed -e "/^                self.check_call(\\[QMAKE\\] + qmc + \\[proname\\])$/a\
-\\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ self.check_call(['sed', \
-'-e', 's|^CFLAGS .*|\\\\\\\\0 ${CFLAGS}|', \
-'-e', 's|^CXXFLAGS .*|\\\\\\\\0 ${CXXFLAGS}|', \
-'-e', 's|^LFLAGS .*|\\\\\\\\0 ${LDFLAGS}|', \
-'-i', '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"
-}
-
-src_install() {
-	# calibre works with python 3, so remove the python 2 constraint
-	export CALIBRE_PY3_PORT=1
-
-	# Bypass kbuildsycoca and update-mime-database in order to
-	# avoid sandbox violations if xdg-mime tries to call them.
-	mkdir "${T}/bin" || die
-	cat - > "${T}/bin/kbuildsycoca" <<-EOF
-	#!${BASH}
-	echo $0 : $@
-	exit 0
-	EOF
-
-	cp "${T}"/bin/{kbuildsycoca,update-mime-database} || die
-	chmod +x "${T}"/bin/{kbuildsycoca,update-mime-database} || die
-
-	export QMAKE="${EPREFIX}/usr/$(get_libdir)/qt5/bin/qmake"
-
-	# Unset DISPLAY in order to prevent xdg-mime from triggering a sandbox
-	# violation with kbuildsycoca as in bug #287067, comment #13.
-	export -n DISPLAY
-
-	# Bug #352625 - Some LANGUAGE values can trigger the following ValueError:
-	#   File "/usr/lib/python2.6/locale.py", line 486, in getdefaultlocale
-	#    return _parse_localename(localename)
-	#  File "/usr/lib/python2.6/locale.py", line 418, in _parse_localename
-	#    raise ValueError, 'unknown locale: %s' % localename
-	#ValueError: unknown locale: 46
-	export -n LANG LANGUAGE ${!LC_*}
-	export LC_ALL=C.utf8 #709682
-
-	# Bug #295672 - Avoid sandbox violation in ~/.config by forcing
-	# variables to point to our fake temporary $HOME.
-	export HOME="${T}/fake_homedir"
-	export XDG_CONFIG_HOME="${HOME}/.config"
-	export XDG_DATA_HOME="${HOME}/.local/share"
-	export CALIBRE_CONFIG_DIRECTORY="${XDG_CONFIG_HOME}/calibre"
-	mkdir -p "${XDG_DATA_HOME}" "${CALIBRE_CONFIG_DIRECTORY}" || die
-
-	tc-export CC CXX
-	# Bug #334243 - respect LDFLAGS when building extensions
-	export OVERRIDE_CFLAGS="$CFLAGS" OVERRIDE_LDFLAGS="$LDFLAGS"
-	local libdir=$(get_libdir)
-	[[ -n $libdir ]] || die "get_libdir returned an empty string"
-
-	addpredict /dev/dri #665310
-
-	PATH=${T}/bin:${PATH} PYTHONPATH=${S}/src${PYTHONPATH:+:}${PYTHONPATH} \
-	"${PYTHON}" setup.py install \
-		--root="${D}" \
-		--prefix="${EPREFIX}/usr" \
-		--libdir="${EPREFIX}/usr/${libdir}" \
-		--staging-root="${ED}/usr" \
-		--staging-libdir="${ED}/usr/${libdir}" || die
-
-	rm "${ED}/usr/share/applications/defaults.list" || die
-	find "${ED}"/usr/share -type d -empty -delete
-
-	cd "${ED}"/usr/share/calibre/fonts/liberation || die
-	local x
-	for x in * ; do
-		[[ -f ${EPREFIX}/usr/share/fonts/liberation-fonts/${x} ]] || continue
-		ln -sf "../../../fonts/liberation-fonts/${x}" "${x}" || die
-	done
-
-	einfo "Converting python shebangs"
-	python_fix_shebang --force "${ED}"
-
-	einfo "Compiling python modules"
-	python_optimize "${ED}"/usr/$(get_libdir)/calibre "${D}/$(python_get_sitedir)"
-
-	newinitd "${FILESDIR}"/calibre-server-3.init calibre-server
-	newconfd "${FILESDIR}"/calibre-server-3.conf calibre-server
-}
-
-pkg_preinst() {
-	# Indentify stray directories from upstream's "Binary install"
-	# method (see bug 622728).
-	CALIBRE_LIB_DIR=/usr/$(get_libdir)/calibre
-	CALIBRE_LIB_CONTENT=$(for x in "${ED}${CALIBRE_LIB_DIR}"/*; do
-		printf -- "${x##*/} "; done) || die "Failed to list ${ED}${CALIBRE_LIB_DIR}"
-}
-
-pkg_postinst() {
-	[[ -n ${CALIBRE_LIB_DIR} ]] || die "CALIBRE_LIB_DIR is unset"
-	local x
-	for x in "${EROOT}${CALIBRE_LIB_DIR}"/*; do
-		if [[ " ${CALIBRE_LIB_CONTENT} " != *" ${x##*/} "* ]]; then
-			elog "Purging '${x}'"
-			rm -rf "${x}"
-		fi
-	done
-	xdg_desktop_database_update
-	xdg_mimeinfo_database_update
-	xdg_icon_cache_update
-}
-
-pkg_postrm() {
-	xdg_desktop_database_update
-	xdg_mimeinfo_database_update
-	xdg_icon_cache_update
-}

diff --git a/app-text/calibre/calibre-5.6.0.ebuild b/app-text/calibre/calibre-5.6.0.ebuild
deleted file mode 100644
index 9c20538532c..00000000000
--- a/app-text/calibre/calibre-5.6.0.ebuild
+++ /dev/null
@@ -1,264 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-PYTHON_COMPAT=( python3_{8..9} )
-PYTHON_REQ_USE="ipv6,sqlite,ssl"
-
-inherit bash-completion-r1 desktop toolchain-funcs python-single-r1 xdg-utils
-
-DESCRIPTION="Ebook management application"
-HOMEPAGE="https://calibre-ebook.com/"
-SRC_URI="https://download.calibre-ebook.com/${PV}/${P}.tar.xz
-	https://dev.gentoo.org/~zmedico/dist/calibre-5.4.2-SIP-v4.patch.xz"
-
-LICENSE="
-	GPL-3+
-	GPL-3
-	GPL-2+
-	GPL-2
-	GPL-1+
-	LGPL-3+
-	LGPL-2.1+
-	LGPL-2.1
-	BSD
-	MIT
-	Old-MIT
-	Apache-2.0
-	public-domain
-	|| ( Artistic GPL-1+ )
-	CC-BY-3.0
-	OFL-1.1
-	PSF-2
-"
-KEYWORDS="~amd64 ~arm ~x86"
-SLOT="0"
-IUSE="ios +udisks"
-
-REQUIRED_USE="${PYTHON_REQUIRED_USE}"
-
-COMMON_DEPEND="${PYTHON_DEPS}
-	>=app-text/hunspell-1.7:=
-	>=app-text/podofo-0.9.6_pre20171027:=
-	>=app-text/poppler-0.26.5[qt5]
-	dev-libs/glib:2=
-	dev-libs/hyphen:=
-	>=dev-libs/icu-57.1:=
-	dev-libs/libinput:=
-	>=dev-libs/dbus-glib-0.106
-	>=sys-apps/dbus-1.10.8
-	$(python_gen_cond_dep '
-		>=dev-python/apsw-3.25.2_p1[${PYTHON_MULTI_USEDEP}]
-		dev-python/beautifulsoup:4[${PYTHON_MULTI_USEDEP}]
-		>=dev-python/chardet-3.0.3[${PYTHON_MULTI_USEDEP}]
-		>=dev-python/cssselect-0.7.1[${PYTHON_MULTI_USEDEP}]
-		>=dev-python/css-parser-1.0.4[${PYTHON_MULTI_USEDEP}]
-		>=dev-python/dbus-python-1.2.4[${PYTHON_MULTI_USEDEP}]
-		dev-python/dnspython[${PYTHON_MULTI_USEDEP}]
-		>=dev-python/feedparser-5.2.1[${PYTHON_MULTI_USEDEP}]
-		>=dev-python/html2text-2019.8.11[${PYTHON_MULTI_USEDEP}]
-		>=dev-python/html5-parser-0.4.9[${PYTHON_MULTI_USEDEP}]
-		>=dev-python/lxml-3.8.0[${PYTHON_MULTI_USEDEP}]
-		>=dev-python/markdown-3.0.1[${PYTHON_MULTI_USEDEP}]
-		>=dev-python/mechanize-0.3.5[${PYTHON_MULTI_USEDEP}]
-		>=dev-python/msgpack-0.6.2[${PYTHON_MULTI_USEDEP}]
-		>=dev-python/netifaces-0.10.5[${PYTHON_MULTI_USEDEP}]
-		>=dev-python/pillow-3.2.0[${PYTHON_MULTI_USEDEP}]
-		>=dev-python/psutil-4.3.0[${PYTHON_MULTI_USEDEP}]
-		>=dev-python/pychm-0.8.6[${PYTHON_MULTI_USEDEP}]
-		>=dev-python/pygments-2.3.1[${PYTHON_MULTI_USEDEP}]
-		>=dev-python/python-dateutil-2.5.3[${PYTHON_MULTI_USEDEP}]
-		>=dev-python/PyQt5-5.12[gui,svg,widgets,network,printsupport,${PYTHON_MULTI_USEDEP}]
-		>=dev-python/PyQtWebEngine-5.12[${PYTHON_MULTI_USEDEP}]
-		dev-python/regex[${PYTHON_MULTI_USEDEP}]
-		dev-python/zeroconf[${PYTHON_MULTI_USEDEP}]
-	')
-	dev-qt/qtcore:5=
-	dev-qt/qtdbus:5=
-	dev-qt/qtgui:5=[jpeg]
-	>=dev-qt/qtwebengine-5.12
-	dev-qt/qtwidgets:5=
-	dev-util/desktop-file-utils
-	dev-util/gtk-update-icon-cache
-	media-fonts/liberation-fonts
-	media-libs/fontconfig:=
-	>=media-libs/freetype-2:=
-	>=media-libs/libmtp-1.1.11:=
-	>=media-libs/libwmf-0.2.8
-	>=media-gfx/optipng-0.7.6
-	>=sys-libs/zlib-1.2.11:=
-	virtual/libusb:1=
-	x11-libs/libxkbcommon:=
-	x11-libs/libX11:=
-	x11-libs/libXext:=
-	x11-libs/libXrender:=
-	x11-misc/shared-mime-info
-	>=x11-misc/xdg-utils-1.0.2-r2
-	ios? (
-		>=app-pda/usbmuxd-1.0.8
-		>=app-pda/libimobiledevice-1.2.0
-	)
-	udisks? ( virtual/libudev )"
-RDEPEND="${COMMON_DEPEND}
-	udisks? ( sys-fs/udisks:2 )"
-DEPEND="${COMMON_DEPEND}
-	$(python_gen_cond_dep '
-		>=dev-python/setuptools-23.1.0[${PYTHON_MULTI_USEDEP}]
-		<dev-python/sip-5[${PYTHON_MULTI_USEDEP}]
-	')
-	>=virtual/podofo-build-0.9.6_pre20171027
-	virtual/pkgconfig"
-
-pkg_pretend() {
-	if [[ ${MERGE_TYPE} != binary ]] && tc-is-gcc && [[ $(gcc-major-version) -lt 6 ]]; then
-		eerror "Calibre cannot be built with this version of gcc."
-		eerror "You need at least gcc-6.0"
-		die "Your C compiler is too old for this package."
-	fi
-}
-
-src_prepare() {
-	# no_updates: do not annoy user with "new version is availible all the time
-	# disable_plugins: walking sec-hole, wait for upstream to use GHNS interface
-	eapply \
-		"${FILESDIR}/${PN}-2.9.0-no_updates_dialog.patch" \
-		"${FILESDIR}/${PN}-disable_plugins.patch" \
-		"${WORKDIR}/${PN}-5.4.2-SIP-v4.patch"
-
-	has_version ">=dev-libs/icu-68.1" && eapply "${FILESDIR}/${PN}-4.22.0-icu68.patch"
-
-	eapply_user
-
-	# Fix outdated version constant.
-	#sed -e "s#\\(^numeric_version =\\).*#\\1 (${PV//./, })#" \
-	#	-i src/calibre/constants.py || \
-	#	die "sed failed to patch constants.py"
-
-	# Avoid sandbox violation in /usr/share/gnome/apps when linux.py
-	# calls xdg-* (bug #258938).
-	sed -e "s|'xdg-desktop-menu', 'install'|\\0, '--mode', 'user'|" \
-		-e "s|check_call(\\['xdg-desktop-menu', 'forceupdate'\\])|#\\0|" \
-		-e "s|\\(CurrentDir(tdir)\\), \\\\\$|\\1:|" \
-		-e "s|, PreserveMIMEDefaults():|:|" \
-		-e "s|'xdg-icon-resource', 'install'|\\0, '--mode', 'user'|" \
-		-e "s|cmd\[2\]|cmd[4]|" \
-		-e "s|cc(\\['xdg-desktop-menu', 'forceupdate'\\])|#\\0|" \
-		-e "s|'xdg-mime', 'install'|\\0, '--mode', 'user'|" \
-		-i src/calibre/linux.py || die "sed failed to patch linux.py"
-
-	# Disable unnecessary privilege dropping for bug #287067.
-	sed -e "s:if os.geteuid() == 0:if False and os.geteuid() == 0:" \
-		-i setup/install.py || die "sed failed to patch install.py"
-
-	sed -e "/^                self.check_call(\\[QMAKE\\] + qmc + \\[proname\\])$/a\
-\\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ self.check_call(['sed', \
-'-e', 's|^CFLAGS .*|\\\\\\\\0 ${CFLAGS}|', \
-'-e', 's|^CXXFLAGS .*|\\\\\\\\0 ${CXXFLAGS}|', \
-'-e', 's|^LFLAGS .*|\\\\\\\\0 ${LDFLAGS}|', \
-'-i', '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"
-}
-
-src_install() {
-	# calibre works with python 3, so remove the python 2 constraint
-	export CALIBRE_PY3_PORT=1
-
-	# Bypass kbuildsycoca and update-mime-database in order to
-	# avoid sandbox violations if xdg-mime tries to call them.
-	mkdir "${T}/bin" || die
-	cat - > "${T}/bin/kbuildsycoca" <<-EOF
-	#!${BASH}
-	echo $0 : $@
-	exit 0
-	EOF
-
-	cp "${T}"/bin/{kbuildsycoca,update-mime-database} || die
-	chmod +x "${T}"/bin/{kbuildsycoca,update-mime-database} || die
-
-	export QMAKE="${EPREFIX}/usr/$(get_libdir)/qt5/bin/qmake"
-
-	# Unset DISPLAY in order to prevent xdg-mime from triggering a sandbox
-	# violation with kbuildsycoca as in bug #287067, comment #13.
-	export -n DISPLAY
-
-	# Bug #352625 - Some LANGUAGE values can trigger the following ValueError:
-	#   File "/usr/lib/python2.6/locale.py", line 486, in getdefaultlocale
-	#    return _parse_localename(localename)
-	#  File "/usr/lib/python2.6/locale.py", line 418, in _parse_localename
-	#    raise ValueError, 'unknown locale: %s' % localename
-	#ValueError: unknown locale: 46
-	export -n LANG LANGUAGE ${!LC_*}
-	export LC_ALL=C.utf8 #709682
-
-	# Bug #295672 - Avoid sandbox violation in ~/.config by forcing
-	# variables to point to our fake temporary $HOME.
-	export HOME="${T}/fake_homedir"
-	export XDG_CONFIG_HOME="${HOME}/.config"
-	export XDG_DATA_HOME="${HOME}/.local/share"
-	export CALIBRE_CONFIG_DIRECTORY="${XDG_CONFIG_HOME}/calibre"
-	mkdir -p "${XDG_DATA_HOME}" "${CALIBRE_CONFIG_DIRECTORY}" || die
-
-	tc-export CC CXX
-	# Bug #334243 - respect LDFLAGS when building extensions
-	export OVERRIDE_CFLAGS="$CFLAGS" OVERRIDE_LDFLAGS="$LDFLAGS"
-	local libdir=$(get_libdir)
-	[[ -n $libdir ]] || die "get_libdir returned an empty string"
-
-	addpredict /dev/dri #665310
-
-	PATH=${T}/bin:${PATH} PYTHONPATH=${S}/src${PYTHONPATH:+:}${PYTHONPATH} \
-	"${PYTHON}" setup.py install \
-		--root="${D}" \
-		--prefix="${EPREFIX}/usr" \
-		--libdir="${EPREFIX}/usr/${libdir}" \
-		--staging-root="${ED}/usr" \
-		--staging-libdir="${ED}/usr/${libdir}" || die
-
-	find "${ED}"/usr/share -type d -empty -delete
-
-	cd "${ED}"/usr/share/calibre/fonts/liberation || die
-	local x
-	for x in * ; do
-		[[ -f ${EPREFIX}/usr/share/fonts/liberation-fonts/${x} ]] || continue
-		ln -sf "../../../fonts/liberation-fonts/${x}" "${x}" || die
-	done
-
-	einfo "Converting python shebangs"
-	python_fix_shebang --force "${ED}"
-
-	einfo "Compiling python modules"
-	python_optimize "${ED}"/usr/$(get_libdir)/calibre "${D}/$(python_get_sitedir)"
-
-	newinitd "${FILESDIR}"/calibre-server-3.init calibre-server
-	newconfd "${FILESDIR}"/calibre-server-3.conf calibre-server
-}
-
-pkg_preinst() {
-	# Indentify stray directories from upstream's "Binary install"
-	# method (see bug 622728).
-	CALIBRE_LIB_DIR=/usr/$(get_libdir)/calibre
-	CALIBRE_LIB_CONTENT=$(for x in "${ED}${CALIBRE_LIB_DIR}"/*; do
-		printf -- "${x##*/} "; done) || die "Failed to list ${ED}${CALIBRE_LIB_DIR}"
-}
-
-pkg_postinst() {
-	[[ -n ${CALIBRE_LIB_DIR} ]] || die "CALIBRE_LIB_DIR is unset"
-	local x
-	for x in "${EROOT}${CALIBRE_LIB_DIR}"/*; do
-		if [[ " ${CALIBRE_LIB_CONTENT} " != *" ${x##*/} "* ]]; then
-			elog "Purging '${x}'"
-			rm -rf "${x}"
-		fi
-	done
-	xdg_desktop_database_update
-	xdg_mimeinfo_database_update
-	xdg_icon_cache_update
-}
-
-pkg_postrm() {
-	xdg_desktop_database_update
-	xdg_mimeinfo_database_update
-	xdg_icon_cache_update
-}

diff --git a/app-text/calibre/files/calibre-4.22.0-icu68.patch b/app-text/calibre/files/calibre-4.22.0-icu68.patch
deleted file mode 100644
index c4b3baf0570..00000000000
--- a/app-text/calibre/files/calibre-4.22.0-icu68.patch
+++ /dev/null
@@ -1,49 +0,0 @@
-From c211f9b17af410463ce9cfc9b1b100228b51720f Mon Sep 17 00:00:00 2001
-From: Lars Wendler <polynomial-c@gentoo.org>
-Date: Sat, 31 Oct 2020 10:44:36 +0100
-Subject: [PATCH] Fix build with icu-68.1
-
-icu-68.1 removed public macro definitions for TRUE and FALSE
-
-Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>
----
- src/calibre/utils/icu.c     | 4 ++--
- src/calibre/utils/matcher.c | 1 -
- 2 files changed, 2 insertions(+), 3 deletions(-)
-
-diff --git a/src/calibre/utils/icu.c b/src/calibre/utils/icu.c
-index 62d05de310..4e918492d9 100644
---- a/src/calibre/utils/icu.c
-+++ b/src/calibre/utils/icu.c
-@@ -238,14 +238,14 @@ icu_Collator_contains(icu_Collator *self, PyObject *args) {
- 
-     a = python_to_icu(a_, &asz);
-     if (a == NULL) goto end;
--    if (asz == 0) { found = TRUE; goto end; }
-+    if (asz == 0) { found = 1; goto end; }
-     b = python_to_icu(b_, &bsz);
-     if (b == NULL) goto end;
- 
-     search = usearch_openFromCollator(a, asz, b, bsz, self->collator, NULL, &status);
-     if (U_SUCCESS(status)) {
-         pos = usearch_first(search, &status);
--        if (pos != USEARCH_DONE) found = TRUE;
-+        if (pos != USEARCH_DONE) found = 1;
-     }
- end:
-     if (search != NULL) usearch_close(search);
-diff --git a/src/calibre/utils/matcher.c b/src/calibre/utils/matcher.c
-index f38a7082ce..8e57947867 100644
---- a/src/calibre/utils/matcher.c
-+++ b/src/calibre/utils/matcher.c
-@@ -15,7 +15,6 @@
- #define inline
- #endif
- 
--typedef unsigned char bool;
- #define TRUE 1
- #define FALSE 0
- #define MAX(x, y) ((x > y) ? x : y)
--- 
-2.29.2
-


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: app-text/calibre/files/, app-text/calibre/
@ 2021-08-26 23:58 Sam James
  0 siblings, 0 replies; 13+ messages in thread
From: Sam James @ 2021-08-26 23:58 UTC (permalink / raw
  To: gentoo-commits

commit:     09167c5f5f54eb30f27dcb3d580a8b3a0ab530a0
Author:     Marco Genasci <fedeliallalinea <AT> gmail <DOT> com>
AuthorDate: Mon Aug  9 16:18:32 2021 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Aug 26 23:56:18 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=09167c5f

app-text/calibre: fix compilation with >=zeroconf-0.32

Backported upstream patch 4f9e83

Closes: https://bugs.gentoo.org/800233
Package-Manager: Portage-3.0.20, Repoman-3.0.2
Signed-off-by: Marco Genasci <fedeliallalinea <AT> gmail.com>
Closes: https://github.com/gentoo/gentoo/pull/21928
Signed-off-by: Sam James <sam <AT> gentoo.org>

 app-text/calibre/calibre-5.16.1.ebuild             |  3 ++-
 .../calibre/files/calibre-5.16.1-zeroconf.patch    | 30 ++++++++++++++++++++++
 2 files changed, 32 insertions(+), 1 deletion(-)

diff --git a/app-text/calibre/calibre-5.16.1.ebuild b/app-text/calibre/calibre-5.16.1.ebuild
index 497d1187304..546774b0f93 100644
--- a/app-text/calibre/calibre-5.16.1.ebuild
+++ b/app-text/calibre/calibre-5.16.1.ebuild
@@ -123,7 +123,8 @@ src_prepare() {
 	# disable_plugins: walking sec-hole, wait for upstream to use GHNS interface
 	eapply \
 		"${FILESDIR}/${PN}-2.9.0-no_updates_dialog.patch" \
-		"${FILESDIR}/${PN}-disable_plugins.patch"
+		"${FILESDIR}/${PN}-disable_plugins.patch" \
+		"${FILESDIR}/${P}-zeroconf.patch"
 
 	if ! has_version ">=dev-python/sip-5"; then
 		einfo "Applying SIP v4 patch because SIP v5 was not detected"

diff --git a/app-text/calibre/files/calibre-5.16.1-zeroconf.patch b/app-text/calibre/files/calibre-5.16.1-zeroconf.patch
new file mode 100644
index 00000000000..68c09d219c6
--- /dev/null
+++ b/app-text/calibre/files/calibre-5.16.1-zeroconf.patch
@@ -0,0 +1,30 @@
+diff --color -Naru a/src/calibre/devices/smart_device_app/driver.py b/src/calibre/devices/smart_device_app/driver.py
+--- a/src/calibre/devices/smart_device_app/driver.py	2021-08-08 08:32:03.104016444 +0200
++++ b/src/calibre/devices/smart_device_app/driver.py	2021-08-08 08:33:30.699018403 +0200
+@@ -2040,13 +2040,6 @@
+ # Function to monkeypatch zeroconf to remove the 15 character name length restriction.
+ # Copied from https://github.com/jstasiak/python-zeroconf version 0.28.1
+ 
+-
+-from zeroconf import (BadTypeInNameException, _HAS_A_TO_Z,
+-                      _HAS_ONLY_A_TO_Z_NUM_HYPHEN_UNDERSCORE,
+-                      _HAS_ASCII_CONTROL_CHARS,
+-                      _HAS_ONLY_A_TO_Z_NUM_HYPHEN)
+-
+-
+ def service_type_name(type_: str, *, allow_underscores: bool = False) -> str:
+     """
+     Validate a fully qualified service name, instance or subtype. [rfc6763]
+@@ -2087,6 +2080,12 @@
+     :param type_: Type, SubType or service name to validate
+     :return: fully qualified service name (eg: _http._tcp.local.)
+     """
++
++    from zeroconf import (BadTypeInNameException, _HAS_A_TO_Z,
++                      _HAS_ONLY_A_TO_Z_NUM_HYPHEN_UNDERSCORE,
++                      _HAS_ASCII_CONTROL_CHARS,
++                      _HAS_ONLY_A_TO_Z_NUM_HYPHEN)
++
+     if not (type_.endswith('._tcp.local.') or type_.endswith('._udp.local.')):
+         raise BadTypeInNameException("Type '%s' must end with '._tcp.local.' or '._udp.local.'" % type_)
+ 


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: app-text/calibre/files/, app-text/calibre/
@ 2021-10-22  6:29 Zac Medico
  0 siblings, 0 replies; 13+ messages in thread
From: Zac Medico @ 2021-10-22  6:29 UTC (permalink / raw
  To: gentoo-commits

commit:     a0ca413275e10a2297a6c02fd28e3a21ee91c7df
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Oct 22 06:24:01 2021 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Oct 22 06:29:09 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a0ca4132

app-text/calibre: Bump to version 5.30.0

Closes: https://bugs.gentoo.org/818433
Package-Manager: Portage-3.0.28, Repoman-3.0.3
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 app-text/calibre/Manifest                          |   1 +
 app-text/calibre/calibre-5.30.0.ebuild             | 263 +++++++++++++++++++++
 .../calibre/files/calibre-disable_plugins.patch    |   8 +-
 3 files changed, 265 insertions(+), 7 deletions(-)

diff --git a/app-text/calibre/Manifest b/app-text/calibre/Manifest
index d6a70bbcecb..b964061e63a 100644
--- a/app-text/calibre/Manifest
+++ b/app-text/calibre/Manifest
@@ -1,3 +1,4 @@
 DIST calibre-5.16.0-SIP-v4.patch.xz 6768 BLAKE2B b939233266c7cab0fa71ccdeb748bbcffbf16248081ccf0ab313420fe3898954da71e0796b3d6c44e93c636113221f95fa6affc6be97bf41f4086a909b2849f9 SHA512 eb19e6bb328f60eb4af2c38d54c3d2a09989d41d71d27de10ab5ae443af902c3c12fc70042d4735dd785573cb63bb7d7a10ae5f7ed72afc1e1a9c6aacaf64aec
 DIST calibre-5.16.1.tar.xz 36757204 BLAKE2B 71114eed723180142f5428a680d8c5ceabcd007acbc6a70a9298e45a9f21fc793f0ef86bf60b36c96bbd15e9e3f8d8638d179872fb6ff1f9b9f5e31a93e65ba1 SHA512 41cf29cc32c7af08215baf80609f8f099d44f2b82d34181451cbf3ed1648e07d64712dba9ff0ddec5bad3d342c7d8bde40bb822f6bd5fb93a4b29d25cf188aae
 DIST calibre-5.25.0.tar.xz 36849112 BLAKE2B f9cb423317ea1f5b22e7f3540708fd4fa6e7dff2d6d2c667755c74c4f46b72f52aac7672933c51efaf56a5ef57e573c8927649fe30570481c2057e5f757cdfde SHA512 7913fec188d8a8c40cf2768671836f6431d233ac53d1d683222a12f8a753a11cc4023fcfc1dd5ca8b27fd049fb579563b1cdd89624b824ce4eec7b438e25006e
+DIST calibre-5.30.0.tar.xz 37002224 BLAKE2B dc034c54a6ebee838652fe10b467bf8408f8dabd759108d617e2c9f64109e92afe0f2994c5df480ec4346c596361ccb63d0aaab2796edc4993ae0eef4222ba6d SHA512 c2d435ec9a8cfd5f76439f229cd9a7a7f4e829e44d9f2ff37003faf8a925df40cd77471d72d05a8d145bfc104bf92dbdd67ddacabc84e6e3cad055887530d8bd

diff --git a/app-text/calibre/calibre-5.30.0.ebuild b/app-text/calibre/calibre-5.30.0.ebuild
new file mode 100644
index 00000000000..40fa50fcc40
--- /dev/null
+++ b/app-text/calibre/calibre-5.30.0.ebuild
@@ -0,0 +1,263 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{8..9} )
+PYTHON_REQ_USE="ipv6(+),sqlite,ssl"
+
+inherit bash-completion-r1 desktop toolchain-funcs python-single-r1 xdg-utils
+
+DESCRIPTION="Ebook management application"
+HOMEPAGE="https://calibre-ebook.com/"
+SRC_URI="https://download.calibre-ebook.com/${PV}/${P}.tar.xz"
+
+LICENSE="
+	GPL-3+
+	GPL-3
+	GPL-2+
+	GPL-2
+	GPL-1+
+	LGPL-3+
+	LGPL-2.1+
+	LGPL-2.1
+	BSD
+	MIT
+	Old-MIT
+	Apache-2.0
+	public-domain
+	|| ( Artistic GPL-1+ )
+	CC-BY-3.0
+	OFL-1.1
+	PSF-2
+"
+KEYWORDS="~amd64 ~arm ~x86"
+SLOT="0"
+IUSE="ios +udisks"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+COMMON_DEPEND="${PYTHON_DEPS}
+	>=app-text/hunspell-1.7:=
+	>=app-text/podofo-0.9.6_pre20171027:=
+	>=app-text/poppler-0.26.5[qt5]
+	dev-libs/glib:2=
+	dev-libs/hyphen:=
+	>=dev-libs/icu-57.1:=
+	dev-libs/libinput:=
+	>=dev-libs/dbus-glib-0.106
+	dev-libs/snowball-stemmer:=
+	>=sys-apps/dbus-1.10.8
+	$(python_gen_cond_dep '
+		>=dev-python/apsw-3.25.2_p1[${PYTHON_USEDEP}]
+		dev-python/beautifulsoup4[${PYTHON_USEDEP}]
+		>=dev-python/chardet-3.0.3[${PYTHON_USEDEP}]
+		>=dev-python/cssselect-0.7.1[${PYTHON_USEDEP}]
+		>=dev-python/css-parser-1.0.4[${PYTHON_USEDEP}]
+		>=dev-python/dbus-python-1.2.4[${PYTHON_USEDEP}]
+		dev-python/dnspython[${PYTHON_USEDEP}]
+		>=dev-python/feedparser-5.2.1[${PYTHON_USEDEP}]
+		>=dev-python/html2text-2019.8.11[${PYTHON_USEDEP}]
+		>=dev-python/html5-parser-0.4.9[${PYTHON_USEDEP}]
+		dev-python/jeepney[${PYTHON_USEDEP}]
+		>=dev-python/lxml-3.8.0[${PYTHON_USEDEP}]
+		>=dev-python/markdown-3.0.1[${PYTHON_USEDEP}]
+		>=dev-python/mechanize-0.3.5[${PYTHON_USEDEP}]
+		>=dev-python/msgpack-0.6.2[${PYTHON_USEDEP}]
+		>=dev-python/netifaces-0.10.5[${PYTHON_USEDEP}]
+		>=dev-python/pillow-3.2.0[${PYTHON_USEDEP}]
+		>=dev-python/psutil-4.3.0[${PYTHON_USEDEP}]
+		>=dev-python/pychm-0.8.6[${PYTHON_USEDEP}]
+		>=dev-python/pygments-2.3.1[${PYTHON_USEDEP}]
+		>=dev-python/python-dateutil-2.5.3[${PYTHON_USEDEP}]
+		>=dev-python/PyQt5-5.15.5_pre2107091435[gui,svg,widgets,network,printsupport,${PYTHON_USEDEP}]
+		>=dev-python/PyQt-builder-1.10.3[${PYTHON_USEDEP}]
+		>=dev-python/PyQtWebEngine-5.15.5_pre2108100905[${PYTHON_USEDEP}]
+		dev-python/regex[${PYTHON_USEDEP}]
+		dev-python/zeroconf[${PYTHON_USEDEP}]
+	')
+	dev-qt/qtcore:5=
+	dev-qt/qtdbus:5=
+	dev-qt/qtgui:5=[jpeg]
+	>=dev-qt/qtwebengine-5.12
+	dev-qt/qtwidgets:5=
+	dev-util/desktop-file-utils
+	dev-util/gtk-update-icon-cache
+	media-fonts/liberation-fonts
+	media-libs/fontconfig:=
+	>=media-libs/freetype-2:=
+	>=media-libs/libmtp-1.1.11:=
+	>=media-libs/libwmf-0.2.8
+	>=media-gfx/optipng-0.7.6
+	>=sys-libs/zlib-1.2.11:=
+	virtual/libusb:1=
+	x11-libs/libxkbcommon:=
+	x11-libs/libX11:=
+	x11-libs/libXext:=
+	x11-libs/libXrender:=
+	x11-misc/shared-mime-info
+	>=x11-misc/xdg-utils-1.0.2-r2
+	ios? (
+		>=app-pda/usbmuxd-1.0.8
+		>=app-pda/libimobiledevice-1.2.0
+	)
+	udisks? ( virtual/libudev )"
+RDEPEND="${COMMON_DEPEND}
+	udisks? ( sys-fs/udisks:2 )"
+DEPEND="${COMMON_DEPEND}
+	$(python_gen_cond_dep '
+		>=dev-python/setuptools-23.1.0[${PYTHON_USEDEP}]
+		>=dev-python/sip-5[${PYTHON_USEDEP}]
+	')
+	>=virtual/podofo-build-0.9.6_pre20171027
+	virtual/pkgconfig"
+
+pkg_pretend() {
+	if [[ ${MERGE_TYPE} != binary ]] && tc-is-gcc && [[ $(gcc-major-version) -lt 6 ]]; then
+		eerror "Calibre cannot be built with this version of gcc."
+		eerror "You need at least gcc-6.0"
+		die "Your C compiler is too old for this package."
+	fi
+}
+
+src_prepare() {
+	# no_updates: do not annoy user with "new version is availible all the time
+	# disable_plugins: walking sec-hole, wait for upstream to use GHNS interface
+	eapply \
+		"${FILESDIR}/${PN}-2.9.0-no_updates_dialog.patch" \
+		"${FILESDIR}/${PN}-disable_plugins.patch"
+
+	eapply_user
+
+	# Fix outdated version constant.
+	#sed -e "s#\\(^numeric_version =\\).*#\\1 (${PV//./, })#" \
+	#	-i src/calibre/constants.py || \
+	#	die "sed failed to patch constants.py"
+
+	# Avoid sandbox violation in /usr/share/gnome/apps when linux.py
+	# calls xdg-* (bug #258938).
+	sed -e "s|'xdg-desktop-menu', 'install'|\\0, '--mode', 'user'|" \
+		-e "s|check_call(\\['xdg-desktop-menu', 'forceupdate'\\])|#\\0|" \
+		-e "s|\\(CurrentDir(tdir)\\), \\\\\$|\\1:|" \
+		-e "s|, PreserveMIMEDefaults():|:|" \
+		-e "s|'xdg-icon-resource', 'install'|\\0, '--mode', 'user'|" \
+		-e "s|cmd\[2\]|cmd[4]|" \
+		-e "s|cc(\\['xdg-desktop-menu', 'forceupdate'\\])|#\\0|" \
+		-e "s|'xdg-mime', 'install'|\\0, '--mode', 'user'|" \
+		-i src/calibre/linux.py || die "sed failed to patch linux.py"
+
+	# Disable unnecessary privilege dropping for bug #287067.
+	sed -e "s:if os.geteuid() == 0:if False and os.geteuid() == 0:" \
+		-i setup/install.py || die "sed failed to patch install.py"
+
+	sed -e "/^                self.check_call(\\[QMAKE\\] + qmc + \\[proname\\])$/a\
+\\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ self.check_call(['sed', \
+'-e', 's|^CFLAGS .*|\\\\\\\\0 ${CFLAGS}|', \
+'-e', 's|^CXXFLAGS .*|\\\\\\\\0 ${CXXFLAGS}|', \
+'-e', 's|^LFLAGS .*|\\\\\\\\0 ${LDFLAGS}|', \
+'-i', '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"
+}
+
+src_install() {
+	# calibre works with python 3, so remove the python 2 constraint
+	export CALIBRE_PY3_PORT=1
+
+	# Bypass kbuildsycoca and update-mime-database in order to
+	# avoid sandbox violations if xdg-mime tries to call them.
+	mkdir "${T}/bin" || die
+	cat - > "${T}/bin/kbuildsycoca" <<-EOF
+	#!${BASH}
+	echo $0 : $@
+	exit 0
+	EOF
+
+	cp "${T}"/bin/{kbuildsycoca,update-mime-database} || die
+	chmod +x "${T}"/bin/{kbuildsycoca,update-mime-database} || die
+
+	export QMAKE="${EPREFIX}/usr/$(get_libdir)/qt5/bin/qmake"
+
+	# Unset DISPLAY in order to prevent xdg-mime from triggering a sandbox
+	# violation with kbuildsycoca as in bug #287067, comment #13.
+	export -n DISPLAY
+
+	# Bug #352625 - Some LANGUAGE values can trigger the following ValueError:
+	#   File "/usr/lib/python2.6/locale.py", line 486, in getdefaultlocale
+	#    return _parse_localename(localename)
+	#  File "/usr/lib/python2.6/locale.py", line 418, in _parse_localename
+	#    raise ValueError, 'unknown locale: %s' % localename
+	#ValueError: unknown locale: 46
+	export -n LANG LANGUAGE ${!LC_*}
+	export LC_ALL=C.utf8 #709682
+
+	# Bug #295672 - Avoid sandbox violation in ~/.config by forcing
+	# variables to point to our fake temporary $HOME.
+	export HOME="${T}/fake_homedir"
+	export XDG_CONFIG_HOME="${HOME}/.config"
+	export XDG_DATA_HOME="${HOME}/.local/share"
+	export CALIBRE_CONFIG_DIRECTORY="${XDG_CONFIG_HOME}/calibre"
+	mkdir -p "${XDG_DATA_HOME}" "${CALIBRE_CONFIG_DIRECTORY}" || die
+
+	tc-export CC CXX
+	# Bug #334243 - respect LDFLAGS when building extensions
+	export OVERRIDE_CFLAGS="$CFLAGS" OVERRIDE_LDFLAGS="$LDFLAGS"
+	local libdir=$(get_libdir)
+	[[ -n $libdir ]] || die "get_libdir returned an empty string"
+
+	addpredict /dev/dri #665310
+
+	PATH=${T}/bin:${PATH} PYTHONPATH=${S}/src${PYTHONPATH:+:}${PYTHONPATH} \
+	"${PYTHON}" setup.py install \
+		--root="${D}" \
+		--prefix="${EPREFIX}/usr" \
+		--libdir="${EPREFIX}/usr/${libdir}" \
+		--staging-root="${ED}/usr" \
+		--staging-libdir="${ED}/usr/${libdir}" || die
+
+	find "${ED}"/usr/share -type d -empty -delete
+
+	cd "${ED}"/usr/share/calibre/fonts/liberation || die
+	local x
+	for x in * ; do
+		[[ -f ${EPREFIX}/usr/share/fonts/liberation-fonts/${x} ]] || continue
+		ln -sf "../../../fonts/liberation-fonts/${x}" "${x}" || die
+	done
+
+	einfo "Converting python shebangs"
+	python_fix_shebang --force "${ED}"
+
+	einfo "Compiling python modules"
+	python_optimize "${ED}"/usr/$(get_libdir)/calibre "${D}/$(python_get_sitedir)"
+
+	newinitd "${FILESDIR}"/calibre-server-3.init calibre-server
+	newconfd "${FILESDIR}"/calibre-server-3.conf calibre-server
+}
+
+pkg_preinst() {
+	# Indentify stray directories from upstream's "Binary install"
+	# method (see bug 622728).
+	CALIBRE_LIB_DIR=/usr/$(get_libdir)/calibre
+	CALIBRE_LIB_CONTENT=$(for x in "${ED}${CALIBRE_LIB_DIR}"/*; do
+		printf -- "${x##*/} "; done) || die "Failed to list ${ED}${CALIBRE_LIB_DIR}"
+}
+
+pkg_postinst() {
+	[[ -n ${CALIBRE_LIB_DIR} ]] || die "CALIBRE_LIB_DIR is unset"
+	local x
+	for x in "${EROOT}${CALIBRE_LIB_DIR}"/*; do
+		if [[ " ${CALIBRE_LIB_CONTENT} " != *" ${x##*/} "* ]]; then
+			elog "Purging '${x}'"
+			rm -rf "${x}"
+		fi
+	done
+	xdg_desktop_database_update
+	xdg_mimeinfo_database_update
+	xdg_icon_cache_update
+}
+
+pkg_postrm() {
+	xdg_desktop_database_update
+	xdg_mimeinfo_database_update
+	xdg_icon_cache_update
+}

diff --git a/app-text/calibre/files/calibre-disable_plugins.patch b/app-text/calibre/files/calibre-disable_plugins.patch
index 9ef1dd04251..9bd6893a4ae 100644
--- a/app-text/calibre/files/calibre-disable_plugins.patch
+++ b/app-text/calibre/files/calibre-disable_plugins.patch
@@ -6,12 +6,6 @@ Index: calibre-0.8.29+dfsg/src/calibre/gui2/actions/preferences.py
 ===================================================================
 --- calibre-0.8.29+dfsg.orig/src/calibre/gui2/actions/preferences.py	2011-12-16 05:49:14.000000000 +0100
 +++ calibre-0.8.29+dfsg/src/calibre/gui2/actions/preferences.py	2011-12-20 19:29:04.798468930 +0100
-@@ -28,8 +28,6 @@
-             pm.addAction(QIcon(I('config.png')), _('Preferences'), self.do_config)
-         cm('welcome wizard', _('Run welcome wizard'),
-                 icon='wizard.png', triggered=self.gui.run_wizard)
+@@ -33,2 +32,0 @@
 -        cm('plugin updater', _('Get plugins to enhance calibre'),
 -                icon='plugins/plugin_updater.png', triggered=self.get_plugins)
-         if not DEBUG:
-             pm.addSeparator()
-             cm('restart', _('Restart in debug mode'), icon='debug.png',


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: app-text/calibre/files/, app-text/calibre/
@ 2021-11-02 22:45 Sam James
  0 siblings, 0 replies; 13+ messages in thread
From: Sam James @ 2021-11-02 22:45 UTC (permalink / raw
  To: gentoo-commits

commit:     e4b531064e3ccf757e231d2073cbe4a6f15292ef
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Tue Nov  2 22:44:39 2021 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Nov  2 22:45:19 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e4b53106

app-text/calibre: tidy up ebuild further

Signed-off-by: Sam James <sam <AT> gentoo.org>

 app-text/calibre/calibre-5.31.1.ebuild             | 40 ++++++++++++++--------
 .../files/calibre-5.31.0-qt-image-test.patch       | 11 ++++++
 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 2a71b980175..283305d4191 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 00000000000..5c38e2d6a52
--- /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))


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: app-text/calibre/files/, app-text/calibre/
@ 2023-02-09 10:25 Andreas Sturmlechner
  0 siblings, 0 replies; 13+ messages in thread
From: Andreas Sturmlechner @ 2023-02-09 10:25 UTC (permalink / raw
  To: gentoo-commits

commit:     2a5e53723dc747c2175b5649431a357cf1d80574
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Tue Feb  7 10:48:55 2023 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Thu Feb  9 10:25:03 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2a5e5372

app-text/calibre: drop 5.16.1-r1

Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>

 app-text/calibre/Manifest                          |   2 -
 app-text/calibre/calibre-5.16.1-r1.ebuild          | 254 ---------------------
 .../calibre/files/calibre-5.16.1-zeroconf.patch    |  30 ---
 .../calibre/files/calibre-disable_plugins.patch    |  11 -
 4 files changed, 297 deletions(-)

diff --git a/app-text/calibre/Manifest b/app-text/calibre/Manifest
index 629b07ae235b..27588a4b8fc0 100644
--- a/app-text/calibre/Manifest
+++ b/app-text/calibre/Manifest
@@ -1,4 +1,2 @@
-DIST calibre-5.16.0-SIP-v4.patch.xz 6768 BLAKE2B b939233266c7cab0fa71ccdeb748bbcffbf16248081ccf0ab313420fe3898954da71e0796b3d6c44e93c636113221f95fa6affc6be97bf41f4086a909b2849f9 SHA512 eb19e6bb328f60eb4af2c38d54c3d2a09989d41d71d27de10ab5ae443af902c3c12fc70042d4735dd785573cb63bb7d7a10ae5f7ed72afc1e1a9c6aacaf64aec
-DIST calibre-5.16.1.tar.xz 36757204 BLAKE2B 71114eed723180142f5428a680d8c5ceabcd007acbc6a70a9298e45a9f21fc793f0ef86bf60b36c96bbd15e9e3f8d8638d179872fb6ff1f9b9f5e31a93e65ba1 SHA512 41cf29cc32c7af08215baf80609f8f099d44f2b82d34181451cbf3ed1648e07d64712dba9ff0ddec5bad3d342c7d8bde40bb822f6bd5fb93a4b29d25cf188aae
 DIST calibre-5.43.0.tar.xz 38641220 BLAKE2B dddf9e5f7303845f8d86826d38d08dfbf05f144c4fb80d215197f51dc6685f09d848148f00f9795c441f8cd8c541ed9d4988b0a5d2020ce98eb8f8bcd4853dac SHA512 1a5b95c621e47b660841d989445ab56244b9c805aa5d01efc4d95d8c37c5290e93523cedec92a6ca12d16e5f74b63743d6e682bf4084f400d080678ff540a190
 DIST calibre-5.44.0.tar.xz 41015696 BLAKE2B c7053e728da20fccfa981ed4f56e24a4d5b382b7687c92ecb039b078fd4828de0529380093e4ab33f77d78aa54a59758c1620cf8f918937a9a64f13decdf77ee SHA512 3d79e76d820cd1a41605dfd4c1d992599a6e4a759e57a8383d42d86982177e4539313f59e647758ab1896ce5874cb2a93c7678bf962e332c44171651aabf0230

diff --git a/app-text/calibre/calibre-5.16.1-r1.ebuild b/app-text/calibre/calibre-5.16.1-r1.ebuild
deleted file mode 100644
index aaba3db9a372..000000000000
--- a/app-text/calibre/calibre-5.16.1-r1.ebuild
+++ /dev/null
@@ -1,254 +0,0 @@
-# Copyright 1999-2023 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-PYTHON_COMPAT=( python3_9 )
-PYTHON_REQ_USE="ipv6(+),sqlite,ssl"
-
-inherit bash-completion-r1 desktop toolchain-funcs python-single-r1 qmake-utils xdg-utils
-
-DESCRIPTION="Ebook management application"
-HOMEPAGE="https://calibre-ebook.com/"
-SRC_URI="https://download.calibre-ebook.com/${PV}/${P}.tar.xz
-	https://dev.gentoo.org/~zmedico/dist/calibre-5.16.0-SIP-v4.patch.xz"
-
-LICENSE="
-	GPL-3+
-	GPL-3
-	GPL-2+
-	GPL-2
-	GPL-1+
-	LGPL-3+
-	LGPL-2.1+
-	LGPL-2.1
-	BSD
-	MIT
-	Old-MIT
-	Apache-2.0
-	public-domain
-	|| ( Artistic GPL-1+ )
-	CC-BY-3.0
-	OFL-1.1
-	PSF-2
-"
-KEYWORDS="amd64 ~arm ~x86"
-SLOT="0"
-IUSE="ios +udisks"
-
-REQUIRED_USE="${PYTHON_REQUIRED_USE}"
-
-COMMON_DEPEND="${PYTHON_DEPS}
-	>=app-text/hunspell-1.7:=
-	>=app-text/podofo-0.9.6_pre20171027:=
-	>=app-text/poppler-0.26.5[qt5]
-	dev-libs/glib:2=
-	dev-libs/hyphen:=
-	>=dev-libs/icu-57.1:=
-	dev-libs/libinput:=
-	>=dev-libs/dbus-glib-0.106
-	>=sys-apps/dbus-1.10.8
-	$(python_gen_cond_dep '
-		>=dev-python/apsw-3.25.2_p1[${PYTHON_USEDEP}]
-		dev-python/beautifulsoup4[${PYTHON_USEDEP}]
-		>=dev-python/chardet-3.0.3[${PYTHON_USEDEP}]
-		>=dev-python/cssselect-0.7.1[${PYTHON_USEDEP}]
-		>=dev-python/css-parser-1.0.4[${PYTHON_USEDEP}]
-		>=dev-python/dbus-python-1.2.4[${PYTHON_USEDEP}]
-		dev-python/dnspython[${PYTHON_USEDEP}]
-		>=dev-python/feedparser-5.2.1[${PYTHON_USEDEP}]
-		>=dev-python/html2text-2019.8.11[${PYTHON_USEDEP}]
-		>=dev-python/html5-parser-0.4.9[${PYTHON_USEDEP}]
-		>=dev-python/lxml-3.8.0[${PYTHON_USEDEP}]
-		>=dev-python/markdown-3.0.1[${PYTHON_USEDEP}]
-		>=dev-python/mechanize-0.3.5[${PYTHON_USEDEP}]
-		>=dev-python/msgpack-0.6.2[${PYTHON_USEDEP}]
-		>=dev-python/netifaces-0.10.5[${PYTHON_USEDEP}]
-		>=dev-python/pillow-3.2.0[${PYTHON_USEDEP}]
-		>=dev-python/psutil-4.3.0[${PYTHON_USEDEP}]
-		>=dev-python/pychm-0.8.6[${PYTHON_USEDEP}]
-		>=dev-python/pygments-2.3.1[${PYTHON_USEDEP}]
-		>=dev-python/python-dateutil-2.5.3[${PYTHON_USEDEP}]
-		dev-python/python-zeroconf[${PYTHON_USEDEP}]
-		>=dev-python/PyQt5-5.12[gui,svg,widgets,network,printsupport,${PYTHON_USEDEP}]
-		>=dev-python/PyQtWebEngine-5.12[${PYTHON_USEDEP}]
-		dev-python/regex[${PYTHON_USEDEP}]
-	')
-	dev-qt/qtcore:5=
-	dev-qt/qtdbus:5=
-	dev-qt/qtgui:5=[jpeg]
-	dev-qt/qtwidgets:5=
-	dev-util/desktop-file-utils
-	dev-util/gtk-update-icon-cache
-	media-fonts/liberation-fonts
-	media-libs/fontconfig:=
-	>=media-libs/freetype-2:=
-	>=media-libs/libmtp-1.1.11:=
-	>=media-libs/libwmf-0.2.8
-	>=media-gfx/optipng-0.7.6
-	>=sys-libs/zlib-1.2.11:=
-	virtual/libusb:1=
-	x11-libs/libxkbcommon:=
-	x11-libs/libX11:=
-	x11-libs/libXext:=
-	x11-libs/libXrender:=
-	x11-misc/shared-mime-info
-	>=x11-misc/xdg-utils-1.0.2-r2
-	ios? (
-		>=app-pda/usbmuxd-1.0.8
-		>=app-pda/libimobiledevice-1.2.0
-	)
-	udisks? ( virtual/libudev )"
-RDEPEND="${COMMON_DEPEND}
-	udisks? ( sys-fs/udisks:2 )"
-DEPEND="${COMMON_DEPEND}
-	$(python_gen_cond_dep '
-		>=dev-python/setuptools-23.1.0[${PYTHON_USEDEP}]
-		<dev-python/sip-5[${PYTHON_USEDEP}]
-	')
-	>=virtual/podofo-build-0.9.6_pre20171027
-	virtual/pkgconfig"
-
-src_prepare() {
-	# no_updates: do not annoy user with "new version is availible all the time
-	# disable_plugins: walking sec-hole, wait for upstream to use GHNS interface
-	eapply \
-		"${FILESDIR}/${PN}-2.9.0-no_updates_dialog.patch" \
-		"${FILESDIR}/${PN}-disable_plugins.patch" \
-		"${FILESDIR}/${P}-zeroconf.patch" \
-		"${WORKDIR}/${PN}-5.16.0-SIP-v4.patch"
-
-	eapply_user
-
-	# Fix outdated version constant.
-	#sed -e "s#\\(^numeric_version =\\).*#\\1 (${PV//./, })#" \
-	#	-i src/calibre/constants.py || \
-	#	die "sed failed to patch constants.py"
-
-	# Avoid sandbox violation in /usr/share/gnome/apps when linux.py
-	# calls xdg-* (bug #258938).
-	sed -e "s|'xdg-desktop-menu', 'install'|\\0, '--mode', 'user'|" \
-		-e "s|check_call(\\['xdg-desktop-menu', 'forceupdate'\\])|#\\0|" \
-		-e "s|\\(CurrentDir(tdir)\\), \\\\\$|\\1:|" \
-		-e "s|, PreserveMIMEDefaults():|:|" \
-		-e "s|'xdg-icon-resource', 'install'|\\0, '--mode', 'user'|" \
-		-e "s|cmd\[2\]|cmd[4]|" \
-		-e "s|cc(\\['xdg-desktop-menu', 'forceupdate'\\])|#\\0|" \
-		-e "s|'xdg-mime', 'install'|\\0, '--mode', 'user'|" \
-		-i src/calibre/linux.py || die "sed failed to patch linux.py"
-
-	# Disable unnecessary privilege dropping for bug #287067.
-	sed -e "s:if os.geteuid() == 0:if False and os.geteuid() == 0:" \
-		-i setup/install.py || die "sed failed to patch install.py"
-
-	sed -e "/^                self.check_call(\\[QMAKE\\] + qmc + \\[proname\\])$/a\
-\\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ self.check_call(['sed', \
-'-e', 's|^CFLAGS .*|\\\\\\\\0 ${CFLAGS}|', \
-'-e', 's|^CXXFLAGS .*|\\\\\\\\0 ${CXXFLAGS}|', \
-'-e', 's|^LFLAGS .*|\\\\\\\\0 ${LDFLAGS}|', \
-'-i', '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"
-}
-
-src_install() {
-	# calibre works with python 3, so remove the python 2 constraint
-	export CALIBRE_PY3_PORT=1
-
-	# Bypass kbuildsycoca and update-mime-database in order to
-	# avoid sandbox violations if xdg-mime tries to call them.
-	mkdir "${T}/bin" || die
-	cat - > "${T}/bin/kbuildsycoca" <<-EOF
-	#!${BASH}
-	echo $0 : $@
-	exit 0
-	EOF
-
-	cp "${T}"/bin/{kbuildsycoca,update-mime-database} || die
-	chmod +x "${T}"/bin/{kbuildsycoca,update-mime-database} || die
-
-	export QMAKE="$(qt5_get_bindir)/qmake"
-
-	# Unset DISPLAY in order to prevent xdg-mime from triggering a sandbox
-	# violation with kbuildsycoca as in bug #287067, comment #13.
-	export -n DISPLAY
-
-	# Bug #352625 - Some LANGUAGE values can trigger the following ValueError:
-	#   File "/usr/lib/python2.6/locale.py", line 486, in getdefaultlocale
-	#    return _parse_localename(localename)
-	#  File "/usr/lib/python2.6/locale.py", line 418, in _parse_localename
-	#    raise ValueError, 'unknown locale: %s' % localename
-	#ValueError: unknown locale: 46
-	export -n LANG LANGUAGE ${!LC_*}
-	export LC_ALL=C.utf8 #709682
-
-	# Bug #295672 - Avoid sandbox violation in ~/.config by forcing
-	# variables to point to our fake temporary $HOME.
-	export HOME="${T}/fake_homedir"
-	export XDG_CONFIG_HOME="${HOME}/.config"
-	export XDG_DATA_HOME="${HOME}/.local/share"
-	export CALIBRE_CONFIG_DIRECTORY="${XDG_CONFIG_HOME}/calibre"
-	mkdir -p "${XDG_DATA_HOME}" "${CALIBRE_CONFIG_DIRECTORY}" || die
-
-	tc-export CC CXX
-	# Bug #334243 - respect LDFLAGS when building extensions
-	export OVERRIDE_CFLAGS="$CFLAGS" OVERRIDE_LDFLAGS="$LDFLAGS"
-	local libdir=$(get_libdir)
-	[[ -n $libdir ]] || die "get_libdir returned an empty string"
-
-	addpredict /dev/dri #665310
-
-	PATH=${T}/bin:$(qt5_get_bindir):${PATH} PYTHONPATH=${S}/src${PYTHONPATH:+:}${PYTHONPATH} \
-	"${PYTHON}" setup.py install \
-		--root="${D}" \
-		--prefix="${EPREFIX}/usr" \
-		--libdir="${EPREFIX}/usr/${libdir}" \
-		--staging-root="${ED}/usr" \
-		--staging-libdir="${ED}/usr/${libdir}" || die
-
-	find "${ED}"/usr/share -type d -empty -delete
-
-	cd "${ED}"/usr/share/calibre/fonts/liberation || die
-	local x
-	for x in * ; do
-		[[ -f ${EPREFIX}/usr/share/fonts/liberation-fonts/${x} ]] || continue
-		ln -sf "../../../fonts/liberation-fonts/${x}" "${x}" || die
-	done
-
-	einfo "Converting python shebangs"
-	python_fix_shebang --force "${ED}"
-
-	einfo "Compiling python modules"
-	python_optimize "${ED}"/usr/$(get_libdir)/calibre "${D}/$(python_get_sitedir)"
-
-	newinitd "${FILESDIR}"/calibre-server-3.init calibre-server
-	newconfd "${FILESDIR}"/calibre-server-3.conf calibre-server
-}
-
-pkg_preinst() {
-	# Indentify stray directories from upstream's "Binary install"
-	# method (see bug 622728).
-	CALIBRE_LIB_DIR=/usr/$(get_libdir)/calibre
-	CALIBRE_LIB_CONTENT=$(for x in "${ED}${CALIBRE_LIB_DIR}"/*; do
-		printf -- "${x##*/} "; done) || die "Failed to list ${ED}${CALIBRE_LIB_DIR}"
-}
-
-pkg_postinst() {
-	[[ -n ${CALIBRE_LIB_DIR} ]] || die "CALIBRE_LIB_DIR is unset"
-	local x
-	for x in "${EROOT}${CALIBRE_LIB_DIR}"/*; do
-		if [[ " ${CALIBRE_LIB_CONTENT} " != *" ${x##*/} "* ]]; then
-			elog "Purging '${x}'"
-			rm -rf "${x}"
-		fi
-	done
-	xdg_desktop_database_update
-	xdg_mimeinfo_database_update
-	xdg_icon_cache_update
-}
-
-pkg_postrm() {
-	xdg_desktop_database_update
-	xdg_mimeinfo_database_update
-	xdg_icon_cache_update
-}

diff --git a/app-text/calibre/files/calibre-5.16.1-zeroconf.patch b/app-text/calibre/files/calibre-5.16.1-zeroconf.patch
deleted file mode 100644
index 68c09d219c60..000000000000
--- a/app-text/calibre/files/calibre-5.16.1-zeroconf.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-diff --color -Naru a/src/calibre/devices/smart_device_app/driver.py b/src/calibre/devices/smart_device_app/driver.py
---- a/src/calibre/devices/smart_device_app/driver.py	2021-08-08 08:32:03.104016444 +0200
-+++ b/src/calibre/devices/smart_device_app/driver.py	2021-08-08 08:33:30.699018403 +0200
-@@ -2040,13 +2040,6 @@
- # Function to monkeypatch zeroconf to remove the 15 character name length restriction.
- # Copied from https://github.com/jstasiak/python-zeroconf version 0.28.1
- 
--
--from zeroconf import (BadTypeInNameException, _HAS_A_TO_Z,
--                      _HAS_ONLY_A_TO_Z_NUM_HYPHEN_UNDERSCORE,
--                      _HAS_ASCII_CONTROL_CHARS,
--                      _HAS_ONLY_A_TO_Z_NUM_HYPHEN)
--
--
- def service_type_name(type_: str, *, allow_underscores: bool = False) -> str:
-     """
-     Validate a fully qualified service name, instance or subtype. [rfc6763]
-@@ -2087,6 +2080,12 @@
-     :param type_: Type, SubType or service name to validate
-     :return: fully qualified service name (eg: _http._tcp.local.)
-     """
-+
-+    from zeroconf import (BadTypeInNameException, _HAS_A_TO_Z,
-+                      _HAS_ONLY_A_TO_Z_NUM_HYPHEN_UNDERSCORE,
-+                      _HAS_ASCII_CONTROL_CHARS,
-+                      _HAS_ONLY_A_TO_Z_NUM_HYPHEN)
-+
-     if not (type_.endswith('._tcp.local.') or type_.endswith('._udp.local.')):
-         raise BadTypeInNameException("Type '%s' must end with '._tcp.local.' or '._udp.local.'" % type_)
- 

diff --git a/app-text/calibre/files/calibre-disable_plugins.patch b/app-text/calibre/files/calibre-disable_plugins.patch
deleted file mode 100644
index 9bd6893a4ae0..000000000000
--- a/app-text/calibre/files/calibre-disable_plugins.patch
+++ /dev/null
@@ -1,11 +0,0 @@
-Description: Disable plugin dialog. It uses a totally non-authenticated and non-trusted way of installing arbitrary code.
-Author: Martin Pitt <mpitt@debian.org>
-Bug-Debian: http://bugs.debian.org/640026
-
-Index: calibre-0.8.29+dfsg/src/calibre/gui2/actions/preferences.py
-===================================================================
---- calibre-0.8.29+dfsg.orig/src/calibre/gui2/actions/preferences.py	2011-12-16 05:49:14.000000000 +0100
-+++ calibre-0.8.29+dfsg/src/calibre/gui2/actions/preferences.py	2011-12-20 19:29:04.798468930 +0100
-@@ -33,2 +32,0 @@
--        cm('plugin updater', _('Get plugins to enhance calibre'),
--                icon='plugins/plugin_updater.png', triggered=self.get_plugins)


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: app-text/calibre/files/, app-text/calibre/
@ 2023-11-24 16:55 Sam James
  0 siblings, 0 replies; 13+ messages in thread
From: Sam James @ 2023-11-24 16:55 UTC (permalink / raw
  To: gentoo-commits

commit:     858195a7781e2689e5eef2d63301d95f6b604df5
Author:     Eli Schwartz <eschwartz93 <AT> gmail <DOT> com>
AuthorDate: Fri Nov 24 04:53:03 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Nov 24 16:53:10 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=858195a7

app-text/calibre: remove old

Signed-off-by: Eli Schwartz <eschwartz93 <AT> gmail.com>
Closes: https://github.com/gentoo/gentoo/pull/33960
Signed-off-by: Sam James <sam <AT> gentoo.org>

 app-text/calibre/Manifest                          |   1 -
 app-text/calibre/calibre-5.43.0.ebuild             | 310 ---------------------
 app-text/calibre/calibre-5.44.0-r1.ebuild          | 300 --------------------
 .../files/calibre-5.31.0-qt-image-test.patch       |  10 -
 4 files changed, 621 deletions(-)

diff --git a/app-text/calibre/Manifest b/app-text/calibre/Manifest
index 3be350510266..120f7daf0715 100644
--- a/app-text/calibre/Manifest
+++ b/app-text/calibre/Manifest
@@ -1,4 +1,3 @@
-DIST calibre-5.43.0.tar.xz 38641220 BLAKE2B dddf9e5f7303845f8d86826d38d08dfbf05f144c4fb80d215197f51dc6685f09d848148f00f9795c441f8cd8c541ed9d4988b0a5d2020ce98eb8f8bcd4853dac SHA512 1a5b95c621e47b660841d989445ab56244b9c805aa5d01efc4d95d8c37c5290e93523cedec92a6ca12d16e5f74b63743d6e682bf4084f400d080678ff540a190
 DIST calibre-5.44.0.tar.xz 41015696 BLAKE2B c7053e728da20fccfa981ed4f56e24a4d5b382b7687c92ecb039b078fd4828de0529380093e4ab33f77d78aa54a59758c1620cf8f918937a9a64f13decdf77ee SHA512 3d79e76d820cd1a41605dfd4c1d992599a6e4a759e57a8383d42d86982177e4539313f59e647758ab1896ce5874cb2a93c7678bf962e332c44171651aabf0230
 DIST calibre-5.44.0.tar.xz.sig 566 BLAKE2B 413b95855d79bdb5b17ca5d760f834006797b4d3e413604f27d351a3392e16d647e772dc063306bf973e1156c34f68cb38152a66164bca849ebed5484e7f6065 SHA512 59957bf35a73f218241bf76cc86994d5af87cea11d3b0800e83f157bf0b2cfcaf4b6c1314562e74a1141d0c167fdb1619cb9a90e93b67f55dd55ceed77045059
 DIST calibre-6.29.0.tar.xz 41487064 BLAKE2B 55472db2f510465f32729fe2f5ccd1127f8df8d548a0141c0cbeae50cc17d836cde04c7c69228da4e81512b7438a527922a6a42149bf3b852f7fc2666ef41ec9 SHA512 32f5d03d68ba4a2f5572cab1acf68ddc46cbda83edfaba0dc0d793d950060fa54cdb85ba4f5700a56895f915ed126617f2e0b74ca200836b812ad765c9d298e8

diff --git a/app-text/calibre/calibre-5.43.0.ebuild b/app-text/calibre/calibre-5.43.0.ebuild
deleted file mode 100644
index 34e009b48f0a..000000000000
--- a/app-text/calibre/calibre-5.43.0.ebuild
+++ /dev/null
@@ -1,310 +0,0 @@
-# Copyright 1999-2023 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-PYTHON_COMPAT=( python3_{9..10} )
-PYTHON_REQ_USE="ipv6(+),sqlite,ssl"
-
-inherit toolchain-funcs python-single-r1 qmake-utils xdg-utils
-
-DESCRIPTION="Ebook management application"
-HOMEPAGE="https://calibre-ebook.com/"
-SRC_URI="https://download.calibre-ebook.com/${PV}/${P}.tar.xz"
-
-LICENSE="
-	GPL-3+
-	GPL-3
-	GPL-2+
-	GPL-2
-	GPL-1+
-	LGPL-3+
-	LGPL-2.1+
-	LGPL-2.1
-	BSD
-	MIT
-	Old-MIT
-	Apache-2.0
-	public-domain
-	|| ( Artistic GPL-1+ )
-	CC-BY-3.0
-	OFL-1.1
-	PSF-2
-"
-KEYWORDS="amd64 ~arm ~x86"
-SLOT="0"
-IUSE="ios +udisks"
-
-REQUIRED_USE="${PYTHON_REQUIRED_USE}"
-
-COMMON_DEPEND="${PYTHON_DEPS}
-	>=app-text/hunspell-1.7:=
-	>=app-text/podofo-0.9.6_pre20171027:=
-	<app-text/podofo-0.10:=
-	>=app-text/poppler-0.26.5[qt5]
-	dev-libs/glib:2=
-	dev-libs/hyphen:=
-	>=dev-libs/icu-57.1:=
-	dev-libs/libinput:=
-	>=dev-libs/dbus-glib-0.106
-	dev-libs/openssl:=
-	dev-libs/snowball-stemmer:=
-	>=sys-apps/dbus-1.10.8
-	$(python_gen_cond_dep '
-		app-accessibility/speech-dispatcher[python,${PYTHON_USEDEP}]
-		>=dev-python/apsw-3.25.2_p1[${PYTHON_USEDEP}]
-		dev-python/beautifulsoup4[${PYTHON_USEDEP}]
-		dev-python/cchardet[${PYTHON_USEDEP}]
-		>=dev-python/chardet-3.0.3[${PYTHON_USEDEP}]
-		>=dev-python/cssselect-0.7.1[${PYTHON_USEDEP}]
-		>=dev-python/css-parser-1.0.4[${PYTHON_USEDEP}]
-		>=dev-python/dbus-python-1.2.4[${PYTHON_USEDEP}]
-		dev-python/dnspython[${PYTHON_USEDEP}]
-		>=dev-python/feedparser-5.2.1[${PYTHON_USEDEP}]
-		>=dev-python/html2text-2019.8.11[${PYTHON_USEDEP}]
-		>=dev-python/html5-parser-0.4.9[${PYTHON_USEDEP}]
-		dev-python/jeepney[${PYTHON_USEDEP}]
-		>=dev-python/lxml-3.8.0[${PYTHON_USEDEP}]
-		>=dev-python/markdown-3.0.1[${PYTHON_USEDEP}]
-		>=dev-python/mechanize-0.3.5[${PYTHON_USEDEP}]
-		>=dev-python/msgpack-0.6.2[${PYTHON_USEDEP}]
-		>=dev-python/netifaces-0.10.5[${PYTHON_USEDEP}]
-		>=dev-python/pillow-3.2.0[${PYTHON_USEDEP}]
-		>=dev-python/psutil-4.3.0[${PYTHON_USEDEP}]
-		>=dev-python/pychm-0.8.6[${PYTHON_USEDEP}]
-		dev-python/pycryptodome[${PYTHON_USEDEP}]
-		>=dev-python/pygments-2.3.1[${PYTHON_USEDEP}]
-		>=dev-python/python-dateutil-2.5.3[${PYTHON_USEDEP}]
-		dev-python/zeroconf[${PYTHON_USEDEP}]
-		>=dev-python/PyQt5-5.15.5_pre2107091435[gui,svg,widgets,network,printsupport,${PYTHON_USEDEP}]
-		>=dev-python/PyQt-builder-1.10.3[${PYTHON_USEDEP}]
-		>=dev-python/PyQtWebEngine-5.15.5_pre2108100905[${PYTHON_USEDEP}]
-		dev-python/regex[${PYTHON_USEDEP}]
-	')
-	dev-qt/qtcore:5=
-	dev-qt/qtdbus:5=
-	dev-qt/qtgui:5=[jpeg]
-	dev-qt/qtwidgets:5=
-	dev-util/desktop-file-utils
-	dev-util/gtk-update-icon-cache
-	media-fonts/liberation-fonts
-	media-libs/fontconfig:=
-	>=media-libs/freetype-2:=
-	>=media-libs/libmtp-1.1.11:=
-	>=media-libs/libwmf-0.2.8
-	>=media-gfx/optipng-0.7.6
-	>=sys-libs/zlib-1.2.11:=
-	virtual/libusb:1=
-	x11-libs/libxkbcommon:=
-	x11-libs/libX11:=
-	x11-libs/libXext:=
-	x11-libs/libXrender:=
-	x11-misc/shared-mime-info
-	>=x11-misc/xdg-utils-1.0.2-r2
-	ios? (
-		>=app-pda/usbmuxd-1.0.8
-		>=app-pda/libimobiledevice-1.2.0
-	)
-	udisks? ( virtual/libudev )"
-RDEPEND="${COMMON_DEPEND}
-	udisks? ( sys-fs/udisks:2 )"
-DEPEND="${COMMON_DEPEND}"
-BDEPEND="$(python_gen_cond_dep '
-		>=dev-python/setuptools-23.1.0[${PYTHON_USEDEP}]
-		>=dev-python/sip-5[${PYTHON_USEDEP}]
-	')
-	>=virtual/podofo-build-0.9.6_pre20171027
-	<virtual/podofo-build-0.10
-	virtual/pkgconfig"
-
-PATCHES=(
-	# 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.35.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"
-)
-
-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 || \
-	#	die "sed failed to patch constants.py"
-
-	# Avoid sandbox violation in /usr/share/gnome/apps when linux.py
-	# calls xdg-* (bug #258938).
-	sed -e "s|'xdg-desktop-menu', 'install'|\\0, '--mode', 'user'|" \
-		-e "s|check_call(\\['xdg-desktop-menu', 'forceupdate'\\])|#\\0|" \
-		-e "s|\\(CurrentDir(tdir)\\), \\\\\$|\\1:|" \
-		-e "s|, PreserveMIMEDefaults():|:|" \
-		-e "s|'xdg-icon-resource', 'install'|\\0, '--mode', 'user'|" \
-		-e "s|cmd\[2\]|cmd[4]|" \
-		-e "s|cc(\\['xdg-desktop-menu', 'forceupdate'\\])|#\\0|" \
-		-e "s|'xdg-mime', 'install'|\\0, '--mode', 'user'|" \
-		-i src/calibre/linux.py || die "sed failed to patch linux.py"
-
-	# Disable unnecessary privilege dropping for bug #287067.
-	sed -e "s:if os.geteuid() == 0:if False and os.geteuid() == 0:" \
-		-i setup/install.py || die "sed failed to patch install.py"
-	sed -e "/^            os.chdir(os.path.join(src_dir, 'build'))$/a\
-\\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ self.check_call(['sed', \
-'-e', 's|^CFLAGS .*|\\\\\\\\0 ${CFLAGS}|', \
-'-e', 's|^CXXFLAGS .*|\\\\\\\\0 ${CXXFLAGS}|', \
-'-e', 's|^LFLAGS .*|\\\\\\\\0 ${LDFLAGS}|', \
-'-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"
-}
-
-src_compile() {
-	# TODO: get qmake called by setup.py to respect CC and CXX too
-	tc-export CC CXX
-
-	# bug 821871
-	local MY_LIBDIR="${ESYSROOT}/usr/$(get_libdir)"
-	export FT_LIB_DIR="${MY_LIBDIR}" HUNSPELL_LIB_DIR="${MY_LIBDIR}" PODOFO_LIB_DIR="${MY_LIBDIR}"
-
-	PATH="${T}/bin:$(qt5_get_bindir):${PATH}" ${EPYTHON} setup.py build || die
-}
-
-src_test() {
-	# Skipped tests:
-	# - 7z (unpackaged Python dependency: py7zr)
-	# - test_unrar (unpackaged Python dependency: unrardll)
-	#
-	# 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_mem_leaks \
-			--exclude-test-name test_searching \
-			--exclude-test-name test_unrar || die
-}
-
-src_install() {
-	# calibre works with python 3, so remove the python 2 constraint
-	export CALIBRE_PY3_PORT=1
-
-	# Bypass kbuildsycoca and update-mime-database in order to
-	# avoid sandbox violations if xdg-mime tries to call them.
-	mkdir "${T}/bin" || die
-	cat - > "${T}/bin/kbuildsycoca" <<-EOF
-	#!${BASH}
-	echo $0 : $@
-	exit 0
-	EOF
-
-	cp "${T}"/bin/{kbuildsycoca,update-mime-database} || die
-	chmod +x "${T}"/bin/{kbuildsycoca,update-mime-database} || die
-
-	export QMAKE="$(qt5_get_bindir)/qmake"
-
-	# Unset DISPLAY in order to prevent xdg-mime from triggering a sandbox
-	# violation with kbuildsycoca as in bug #287067, comment #13.
-	export -n DISPLAY
-
-	# Bug #352625 - Some LANGUAGE values can trigger the following ValueError:
-	#   File "/usr/lib/python2.6/locale.py", line 486, in getdefaultlocale
-	#    return _parse_localename(localename)
-	#  File "/usr/lib/python2.6/locale.py", line 418, in _parse_localename
-	#    raise ValueError, 'unknown locale: %s' % localename
-	#ValueError: unknown locale: 46
-	export -n LANG LANGUAGE ${!LC_*}
-	export LC_ALL=C.utf8 #709682
-
-	# Bug #295672 - Avoid sandbox violation in ~/.config by forcing
-	# variables to point to our fake temporary $HOME.
-	export HOME="${T}/fake_homedir"
-	export XDG_CONFIG_HOME="${HOME}/.config"
-	export XDG_DATA_HOME="${HOME}/.local/share"
-	export CALIBRE_CONFIG_DIRECTORY="${XDG_CONFIG_HOME}/calibre"
-	mkdir -p "${XDG_DATA_HOME}" "${CALIBRE_CONFIG_DIRECTORY}" || die
-
-	tc-export CC CXX
-	# Bug #334243 - respect LDFLAGS when building extensions
-	export OVERRIDE_CFLAGS="$CFLAGS" OVERRIDE_LDFLAGS="$LDFLAGS"
-	local libdir=$(get_libdir)
-	[[ -n $libdir ]] || die "get_libdir returned an empty string"
-
-	addpredict /dev/dri #665310
-
-	PATH=${T}/bin:${PATH} PYTHONPATH=${S}/src${PYTHONPATH:+:}${PYTHONPATH} \
-		"${PYTHON}" setup.py install \
-		--root="${D}" \
-		--prefix="${EPREFIX}/usr" \
-		--libdir="${EPREFIX}/usr/${libdir}" \
-		--staging-root="${ED}/usr" \
-		--staging-libdir="${ED}/usr/${libdir}" || die
-
-	find "${ED}"/usr/share -type d -empty -delete
-
-	cd "${ED}"/usr/share/calibre/fonts/liberation || die
-	local x
-	for x in * ; do
-		[[ -f ${EPREFIX}/usr/share/fonts/liberation-fonts/${x} ]] || continue
-		ln -sf "../../../fonts/liberation-fonts/${x}" "${x}" || die
-	done
-
-	einfo "Converting python shebangs"
-	python_fix_shebang --force "${ED}"
-
-	einfo "Compiling python modules"
-	python_optimize "${ED}"/usr/$(get_libdir)/calibre "${D}/$(python_get_sitedir)"
-
-	newinitd "${FILESDIR}"/calibre-server-3.init calibre-server
-	newconfd "${FILESDIR}"/calibre-server-3.conf calibre-server
-}
-
-pkg_preinst() {
-	# Indentify stray directories from upstream's "Binary install"
-	# method (see bug 622728).
-	CALIBRE_LIB_DIR=/usr/$(get_libdir)/calibre
-	CALIBRE_LIB_CONTENT=$(for x in "${ED}${CALIBRE_LIB_DIR}"/*; do
-		printf -- "${x##*/} "; done) || die "Failed to list ${ED}${CALIBRE_LIB_DIR}"
-}
-
-pkg_postinst() {
-	[[ -n ${CALIBRE_LIB_DIR} ]] || die "CALIBRE_LIB_DIR is unset"
-	local x
-	for x in "${EROOT}${CALIBRE_LIB_DIR}"/*; do
-		if [[ " ${CALIBRE_LIB_CONTENT} " != *" ${x##*/} "* ]]; then
-			elog "Purging '${x}'"
-			rm -rf "${x}"
-		fi
-	done
-	xdg_desktop_database_update
-	xdg_mimeinfo_database_update
-	xdg_icon_cache_update
-}
-
-pkg_postrm() {
-	xdg_desktop_database_update
-	xdg_mimeinfo_database_update
-	xdg_icon_cache_update
-}

diff --git a/app-text/calibre/calibre-5.44.0-r1.ebuild b/app-text/calibre/calibre-5.44.0-r1.ebuild
deleted file mode 100644
index 67d720c5d9b8..000000000000
--- a/app-text/calibre/calibre-5.44.0-r1.ebuild
+++ /dev/null
@@ -1,300 +0,0 @@
-# Copyright 1999-2023 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-PYTHON_COMPAT=( python3_{9..11} )
-PYTHON_REQ_USE="ipv6(+),sqlite,ssl"
-
-inherit toolchain-funcs python-single-r1 qmake-utils verify-sig xdg-utils
-
-DESCRIPTION="Ebook management application"
-HOMEPAGE="https://calibre-ebook.com/"
-SRC_URI="
-	https://download.calibre-ebook.com/${PV}/${P}.tar.xz
-	verify-sig? ( https://calibre-ebook.com/signatures/${P}.tar.xz.sig )
-"
-VERIFY_SIG_OPENPGP_KEY_PATH="/usr/share/openpgp-keys/kovidgoyal.gpg"
-
-LICENSE="
-	GPL-3+
-	GPL-3
-	GPL-2+
-	GPL-2
-	GPL-1+
-	LGPL-3+
-	LGPL-2.1+
-	LGPL-2.1
-	BSD
-	MIT
-	Old-MIT
-	Apache-2.0
-	public-domain
-	|| ( Artistic GPL-1+ )
-	CC-BY-3.0
-	OFL-1.1
-	PSF-2
-"
-KEYWORDS="amd64 ~arm ~x86"
-SLOT="0"
-IUSE="ios +udisks"
-
-REQUIRED_USE="${PYTHON_REQUIRED_USE}"
-
-COMMON_DEPEND="${PYTHON_DEPS}
-	>=app-text/hunspell-1.7:=
-	>=app-text/podofo-0.9.6_pre20171027:=
-	<app-text/podofo-0.10:=
-	>=app-text/poppler-0.26.5[qt5]
-	dev-libs/glib:2=
-	dev-libs/hyphen:=
-	>=dev-libs/icu-57.1:=
-	dev-libs/libinput:=
-	>=dev-libs/dbus-glib-0.106
-	dev-libs/openssl:=
-	dev-libs/snowball-stemmer:=
-	>=sys-apps/dbus-1.10.8
-	$(python_gen_cond_dep '
-		app-accessibility/speech-dispatcher[python,${PYTHON_USEDEP}]
-		>=dev-python/apsw-3.25.2_p1[${PYTHON_USEDEP}]
-		dev-python/beautifulsoup4[${PYTHON_USEDEP}]
-		dev-python/cchardet[${PYTHON_USEDEP}]
-		>=dev-python/chardet-3.0.3[${PYTHON_USEDEP}]
-		>=dev-python/cssselect-0.7.1[${PYTHON_USEDEP}]
-		>=dev-python/css-parser-1.0.4[${PYTHON_USEDEP}]
-		>=dev-python/dbus-python-1.2.4[${PYTHON_USEDEP}]
-		dev-python/dnspython[${PYTHON_USEDEP}]
-		>=dev-python/feedparser-5.2.1[${PYTHON_USEDEP}]
-		>=dev-python/html2text-2019.8.11[${PYTHON_USEDEP}]
-		>=dev-python/html5-parser-0.4.9[${PYTHON_USEDEP}]
-		dev-python/jeepney[${PYTHON_USEDEP}]
-		>=dev-python/lxml-3.8.0[${PYTHON_USEDEP}]
-		>=dev-python/markdown-3.0.1[${PYTHON_USEDEP}]
-		>=dev-python/mechanize-0.3.5[${PYTHON_USEDEP}]
-		>=dev-python/msgpack-0.6.2[${PYTHON_USEDEP}]
-		>=dev-python/netifaces-0.10.5[${PYTHON_USEDEP}]
-		>=dev-python/pillow-3.2.0[truetype,${PYTHON_USEDEP}]
-		>=dev-python/psutil-4.3.0[${PYTHON_USEDEP}]
-		>=dev-python/pychm-0.8.6[${PYTHON_USEDEP}]
-		dev-python/pycryptodome[${PYTHON_USEDEP}]
-		>=dev-python/pygments-2.3.1[${PYTHON_USEDEP}]
-		>=dev-python/python-dateutil-2.5.3[${PYTHON_USEDEP}]
-		dev-python/zeroconf[${PYTHON_USEDEP}]
-		>=dev-python/PyQt5-5.15.5_pre2107091435[gui,svg,widgets,network,printsupport,${PYTHON_USEDEP}]
-		>=dev-python/PyQt-builder-1.10.3[${PYTHON_USEDEP}]
-		>=dev-python/PyQtWebEngine-5.15.5_pre2108100905[${PYTHON_USEDEP}]
-		dev-python/regex[${PYTHON_USEDEP}]
-	')
-	dev-qt/qtcore:5=
-	dev-qt/qtdbus:5=
-	dev-qt/qtgui:5=[jpeg]
-	dev-qt/qtwidgets:5=
-	dev-util/desktop-file-utils
-	dev-util/gtk-update-icon-cache
-	media-fonts/liberation-fonts
-	media-libs/fontconfig:=
-	>=media-libs/freetype-2:=
-	>=media-libs/libmtp-1.1.11:=
-	>=media-libs/libwmf-0.2.8
-	>=media-gfx/optipng-0.7.6
-	>=sys-libs/zlib-1.2.11:=
-	virtual/libusb:1=
-	x11-libs/libxkbcommon:=
-	x11-libs/libX11:=
-	x11-libs/libXext:=
-	x11-libs/libXrender:=
-	x11-misc/shared-mime-info
-	>=x11-misc/xdg-utils-1.0.2-r2
-	ios? (
-		>=app-pda/usbmuxd-1.0.8
-		>=app-pda/libimobiledevice-1.2.0
-	)
-	udisks? ( virtual/libudev )"
-RDEPEND="${COMMON_DEPEND}
-	udisks? ( sys-fs/udisks:2 )"
-DEPEND="${COMMON_DEPEND}"
-BDEPEND="$(python_gen_cond_dep '
-		>=dev-python/setuptools-23.1.0[${PYTHON_USEDEP}]
-		>=dev-python/sip-5[${PYTHON_USEDEP}]
-	')
-	>=virtual/podofo-build-0.9.6_pre20171027
-	<virtual/podofo-build-0.10
-	virtual/pkgconfig
-	verify-sig? ( sec-keys/openpgp-keys-kovidgoyal )
-"
-
-PATCHES=(
-	# 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.35.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"
-)
-
-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 || \
-	#	die "sed failed to patch constants.py"
-
-	# Avoid sandbox violation in /usr/share/gnome/apps when linux.py
-	# calls xdg-* (bug #258938).
-	sed -e "s|'xdg-desktop-menu', 'install'|\\0, '--mode', 'user'|" \
-		-e "s|check_call(\\['xdg-desktop-menu', 'forceupdate'\\])|#\\0|" \
-		-e "s|\\(CurrentDir(tdir)\\), \\\\\$|\\1:|" \
-		-e "s|, PreserveMIMEDefaults():|:|" \
-		-e "s|'xdg-icon-resource', 'install'|\\0, '--mode', 'user'|" \
-		-e "s|cmd\[2\]|cmd[4]|" \
-		-e "s|cc(\\['xdg-desktop-menu', 'forceupdate'\\])|#\\0|" \
-		-e "s|'xdg-mime', 'install'|\\0, '--mode', 'user'|" \
-		-i src/calibre/linux.py || die "sed failed to patch linux.py"
-
-	# Disable unnecessary privilege dropping for bug #287067.
-	sed -e "s:if os.geteuid() == 0:if False and os.geteuid() == 0:" \
-		-i setup/install.py || die "sed failed to patch install.py"
-	sed -e "/^            os.chdir(os.path.join(src_dir, 'build'))$/a\
-\\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ self.check_call(['sed', \
-'-e', 's|^CFLAGS .*|\\\\\\\\0 ${CFLAGS}|', \
-'-e', 's|^CXXFLAGS .*|\\\\\\\\0 ${CXXFLAGS}|', \
-'-e', 's|^LFLAGS .*|\\\\\\\\0 ${LDFLAGS}|', \
-'-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"
-}
-
-src_compile() {
-	# TODO: get qmake called by setup.py to respect CC and CXX too
-	tc-export CC CXX
-
-	# bug 821871
-	local MY_LIBDIR="${ESYSROOT}/usr/$(get_libdir)"
-	export FT_LIB_DIR="${MY_LIBDIR}" HUNSPELL_LIB_DIR="${MY_LIBDIR}" PODOFO_LIB_DIR="${MY_LIBDIR}"
-
-	PATH="${T}/bin:$(qt5_get_bindir):${PATH}" ${EPYTHON} setup.py build || die
-}
-
-src_test() {
-	# Skipped tests:
-	# - 7z (unpackaged Python dependency: py7zr)
-	# - test_unrar (unpackaged Python dependency: unrardll)
-	#
-	# 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_mem_leaks \
-			--exclude-test-name test_searching \
-			--exclude-test-name test_unrar || die
-}
-
-src_install() {
-	# calibre works with python 3, so remove the python 2 constraint
-	export CALIBRE_PY3_PORT=1
-
-	# Bypass kbuildsycoca and update-mime-database in order to
-	# avoid sandbox violations if xdg-mime tries to call them.
-	mkdir "${T}/bin" || die
-	cat - > "${T}/bin/kbuildsycoca" <<-EOF
-	#!${BASH}
-	echo $0 : $@
-	exit 0
-	EOF
-
-	cp "${T}"/bin/{kbuildsycoca,update-mime-database} || die
-	chmod +x "${T}"/bin/{kbuildsycoca,update-mime-database} || die
-
-	export QMAKE="$(qt5_get_bindir)/qmake"
-
-	# Unset DISPLAY in order to prevent xdg-mime from triggering a sandbox
-	# violation with kbuildsycoca as in bug #287067, comment #13.
-	export -n DISPLAY
-
-	# Bug #352625 - Some LANGUAGE values can trigger the following ValueError:
-	#   File "/usr/lib/python2.6/locale.py", line 486, in getdefaultlocale
-	#    return _parse_localename(localename)
-	#  File "/usr/lib/python2.6/locale.py", line 418, in _parse_localename
-	#    raise ValueError, 'unknown locale: %s' % localename
-	#ValueError: unknown locale: 46
-	export -n LANG LANGUAGE ${!LC_*}
-	export LC_ALL=C.utf8 #709682
-
-	# Bug #295672 - Avoid sandbox violation in ~/.config by forcing
-	# variables to point to our fake temporary $HOME.
-	export HOME="${T}/fake_homedir"
-	export XDG_CONFIG_HOME="${HOME}/.config"
-	export XDG_DATA_HOME="${HOME}/.local/share"
-	export CALIBRE_CONFIG_DIRECTORY="${XDG_CONFIG_HOME}/calibre"
-	mkdir -p "${XDG_DATA_HOME}" "${CALIBRE_CONFIG_DIRECTORY}" || die
-
-	tc-export CC CXX
-	# Bug #334243 - respect LDFLAGS when building extensions
-	export OVERRIDE_CFLAGS="$CFLAGS" OVERRIDE_LDFLAGS="$LDFLAGS"
-	local libdir=$(get_libdir)
-	[[ -n $libdir ]] || die "get_libdir returned an empty string"
-
-	addpredict /dev/dri #665310
-
-	PATH=${T}/bin:${PATH} PYTHONPATH=${S}/src${PYTHONPATH:+:}${PYTHONPATH} \
-		"${PYTHON}" setup.py install \
-		--root="${D}" \
-		--prefix="${EPREFIX}/usr" \
-		--libdir="${EPREFIX}/usr/${libdir}" \
-		--staging-root="${ED}/usr" \
-		--staging-libdir="${ED}/usr/${libdir}" || die
-
-	find "${ED}"/usr/share -type d -empty -delete
-
-	cd "${ED}"/usr/share/calibre/fonts/liberation || die
-	local x
-	for x in * ; do
-		[[ -f ${EPREFIX}/usr/share/fonts/liberation-fonts/${x} ]] || continue
-		ln -sf "../../../fonts/liberation-fonts/${x}" "${x}" || die
-	done
-
-	einfo "Converting python shebangs"
-	python_fix_shebang --force "${ED}"
-
-	einfo "Compiling python modules"
-	python_optimize "${ED}"/usr/$(get_libdir)/calibre "${D}/$(python_get_sitedir)"
-
-	newinitd "${FILESDIR}"/calibre-server-3.init calibre-server
-	newconfd "${FILESDIR}"/calibre-server-3.conf calibre-server
-}
-
-pkg_postinst() {
-	xdg_desktop_database_update
-	xdg_mimeinfo_database_update
-	xdg_icon_cache_update
-}
-
-pkg_postrm() {
-	xdg_desktop_database_update
-	xdg_mimeinfo_database_update
-	xdg_icon_cache_update
-}

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
deleted file mode 100644
index cfecd4c2a5ca..000000000000
--- a/app-text/calibre/files/calibre-5.31.0-qt-image-test.patch
+++ /dev/null
@@ -1,10 +0,0 @@
---- 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))


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: app-text/calibre/files/, app-text/calibre/
@ 2023-11-28  0:40 Zac Medico
  0 siblings, 0 replies; 13+ messages in thread
From: Zac Medico @ 2023-11-28  0:40 UTC (permalink / raw
  To: gentoo-commits

commit:     20cd7b8cadeb67402a3c8f067df2b7aabcd85923
Author:     Eli Schwartz <eschwartz93 <AT> gmail <DOT> com>
AuthorDate: Tue Nov 28 00:22:43 2023 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Nov 28 00:40:07 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=20cd7b8c

app-text/calibre: backport fix for CVE-2023-46303 to the 5.x branch

Bug: https://bugs.gentoo.org/918429
Signed-off-by: Eli Schwartz <eschwartz93 <AT> gmail.com>
Closes: https://github.com/gentoo/gentoo/pull/34022
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 app-text/calibre/calibre-5.44.0-r3.ebuild          | 269 +++++++++++++++++++++
 ...Dont-add-resources-that-exist-outside-the.patch |  55 +++++
 2 files changed, 324 insertions(+)

diff --git a/app-text/calibre/calibre-5.44.0-r3.ebuild b/app-text/calibre/calibre-5.44.0-r3.ebuild
new file mode 100644
index 000000000000..1286833e62d5
--- /dev/null
+++ b/app-text/calibre/calibre-5.44.0-r3.ebuild
@@ -0,0 +1,269 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{10..11} )
+PYTHON_REQ_USE="ipv6(+),sqlite,ssl"
+
+inherit toolchain-funcs python-single-r1 qmake-utils verify-sig xdg-utils
+
+DESCRIPTION="Ebook management application"
+HOMEPAGE="https://calibre-ebook.com/"
+SRC_URI="
+	https://download.calibre-ebook.com/${PV}/${P}.tar.xz
+	verify-sig? ( https://calibre-ebook.com/signatures/${P}.tar.xz.sig )
+"
+VERIFY_SIG_OPENPGP_KEY_PATH="/usr/share/openpgp-keys/kovidgoyal.gpg"
+
+LICENSE="
+	GPL-3+
+	GPL-3
+	GPL-2+
+	GPL-2
+	GPL-1+
+	LGPL-3+
+	LGPL-2.1+
+	LGPL-2.1
+	BSD
+	MIT
+	Old-MIT
+	Apache-2.0
+	public-domain
+	|| ( Artistic GPL-1+ )
+	CC-BY-3.0
+	OFL-1.1
+	PSF-2
+"
+KEYWORDS="~amd64 ~arm ~x86"
+SLOT="0"
+IUSE="ios speech test +udisks"
+
+RESTRICT="!test? ( test )"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+# Qt slotted dependencies are used because the libheadless.so plugin links to
+# QT_*_PRIVATE_ABI. It only uses core/gui/dbus.
+COMMON_DEPEND="${PYTHON_DEPS}
+	>=app-text/hunspell-1.7:=
+	>=app-text/podofo-0.9.6_pre20171027:=
+	<app-text/podofo-0.10:=
+	app-text/poppler[utils]
+	dev-libs/hyphen:=
+	>=dev-libs/icu-57.1:=
+	dev-libs/openssl:=
+	dev-libs/snowball-stemmer:=
+	$(python_gen_cond_dep '
+		>=dev-python/apsw-3.25.2_p1[${PYTHON_USEDEP}]
+		dev-python/beautifulsoup4[${PYTHON_USEDEP}]
+		dev-python/cchardet[${PYTHON_USEDEP}]
+		>=dev-python/css-parser-1.0.4[${PYTHON_USEDEP}]
+		dev-python/dnspython[${PYTHON_USEDEP}]
+		>=dev-python/feedparser-5.2.1[${PYTHON_USEDEP}]
+		>=dev-python/html2text-2019.8.11[${PYTHON_USEDEP}]
+		>=dev-python/html5-parser-0.4.9[${PYTHON_USEDEP}]
+		dev-python/jeepney[${PYTHON_USEDEP}]
+		>=dev-python/lxml-3.8.0[${PYTHON_USEDEP}]
+		>=dev-python/markdown-3.0.1[${PYTHON_USEDEP}]
+		>=dev-python/mechanize-0.3.5[${PYTHON_USEDEP}]
+		>=dev-python/msgpack-0.6.2[${PYTHON_USEDEP}]
+		>=dev-python/netifaces-0.10.5[${PYTHON_USEDEP}]
+		>=dev-python/pillow-3.2.0[jpeg,truetype,webp,zlib,${PYTHON_USEDEP}]
+		>=dev-python/psutil-4.3.0[${PYTHON_USEDEP}]
+		>=dev-python/pychm-0.8.6[${PYTHON_USEDEP}]
+		>=dev-python/pygments-2.3.1[${PYTHON_USEDEP}]
+		>=dev-python/python-dateutil-2.5.3[${PYTHON_USEDEP}]
+		dev-python/zeroconf[${PYTHON_USEDEP}]
+		>=dev-python/PyQt5-5.15.5_pre2107091435[gui,widgets,network,printsupport,svg,${PYTHON_USEDEP}]
+		>=dev-python/PyQtWebEngine-5.15.5_pre2108100905[${PYTHON_USEDEP}]
+		dev-python/regex[${PYTHON_USEDEP}]
+	')
+	dev-qt/qtimageformats:5
+	dev-qt/qtcore:5=
+	dev-qt/qtdbus:5=
+	dev-qt/qtgui:5=[jpeg,png]
+	dev-qt/qtwidgets:5
+	dev-util/desktop-file-utils
+	dev-util/gtk-update-icon-cache
+	media-fonts/liberation-fonts
+	media-libs/fontconfig:=
+	>=media-libs/freetype-2:=
+	>=media-libs/libmtp-1.1.11:=
+	>=media-gfx/optipng-0.7.6
+	virtual/libusb:1=
+	x11-misc/shared-mime-info
+	>=x11-misc/xdg-utils-1.0.2-r2
+	ios? (
+		>=app-pda/usbmuxd-1.0.8
+		>=app-pda/libimobiledevice-1.2.0
+	)
+	speech? ( $(python_gen_cond_dep 'app-accessibility/speech-dispatcher[python,${PYTHON_USEDEP}]') )
+	udisks? ( virtual/libudev )"
+RDEPEND="${COMMON_DEPEND}
+	udisks? ( sys-fs/udisks:2 )"
+DEPEND="${COMMON_DEPEND}
+	test? ( $(python_gen_cond_dep '>=dev-python/chardet-3.0.3[${PYTHON_USEDEP}]') )
+"
+BDEPEND="$(python_gen_cond_dep '
+		>=dev-python/PyQt-builder-1.10.3[${PYTHON_USEDEP}]
+		>=dev-python/sip-5[${PYTHON_USEDEP}]
+	')
+	>=virtual/podofo-build-0.9.6_pre20171027
+	<virtual/podofo-build-0.10
+	virtual/pkgconfig
+	verify-sig? ( sec-keys/openpgp-keys-kovidgoyal )
+"
+
+PATCHES=(
+	# 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.35.0-jxr-test.patch"
+
+	# fix compatibility with recent versions of zeroconf
+	"${FILESDIR}"/${PN}-5.44.0-Fix-compatibility-with-zeroconf-0.73.patch
+
+	# Security backport for CVE-2023-46303
+	"${FILESDIR}"/0001-HTML-Input-Dont-add-resources-that-exist-outside-the.patch
+)
+
+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's packaging is recommended.
+
+	# Disable unnecessary privilege dropping for bug #287067.
+	sed -e "s:if os.geteuid() == 0:if False and os.geteuid() == 0:" \
+		-i setup/install.py || die "sed failed to patch install.py"
+	sed -e "/^            os.chdir(os.path.join(src_dir, 'build'))$/a\
+\\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ self.check_call(['sed', \
+'-e', 's|^CFLAGS .*|\\\\\\\\0 ${CFLAGS}|', \
+'-e', 's|^CXXFLAGS .*|\\\\\\\\0 ${CXXFLAGS}|', \
+'-e', 's|^LFLAGS .*|\\\\\\\\0 ${LDFLAGS}|', \
+'-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"
+
+	# This is only ever used at build time. It contains a small embedded copy
+	# of the rapydscript-ng compiler usable inside of qtwebengine, if you don't
+	# have rapydscript-ng (a nodejs package) itself installed. Its only purpose
+	# is to build some resources that come bundled in dist tarballs already...
+	# and which we may also need to regenerate e.g. to use system-mathjax.
+	#
+	# However, running qtwebengine violates the portage sandbox (among other
+	# things, it tries to create directories in /usr! amazing) so this is a
+	# wash anyway. The only real solution here is to package rapydscript-ng.
+	#
+	# We do not need it at build time, and *no one* needs it at install time.
+	# Delete the cruft.
+	rm -r resources/rapydscript/ || die
+}
+
+src_compile() {
+	# TODO: get qmake called by setup.py to respect CC and CXX too
+	tc-export CC CXX
+
+	# bug 821871
+	local MY_LIBDIR="${ESYSROOT}/usr/$(get_libdir)"
+	export FT_LIB_DIR="${MY_LIBDIR}" HUNSPELL_LIB_DIR="${MY_LIBDIR}" PODOFO_LIB_DIR="${MY_LIBDIR}"
+	export QMAKE="$(qt5_get_bindir)/qmake"
+
+	${EPYTHON} setup.py build || die
+	${EPYTHON} setup.py gui || die
+
+	# A few different resources are bundled in the distfile by default, because
+	# not all systems necessarily have them. We un-vendor them, using the
+	# upstream integrated approach if possible. See setup/revendor.py and
+	# consider migrating other resources to this if they do not use it, in
+	# *preference* over manual rm'ing.
+	${EPYTHON} setup.py liberation_fonts \
+		--path-to-liberation_fonts "${EPREFIX}"/usr/share/fonts/liberation-fonts \
+		--system-liberation_fonts || die
+}
+
+src_test() {
+	# Skipped tests:
+	local _test_excludes=(
+		# unpackaged Python dependency: py7zr
+		7z
+		# unpackaged Python dependency: unrardll
+		test_unrar
+		# tests if a completely unused module is bundled
+		pycryptodome
+
+		$(usev !speech speech_dispatcher)
+
+		# undocumented reasons
+		test_mem_leaks
+		test_searching
+	)
+
+	${PYTHON} setup.py test "${_test_excludes[@]/#/--exclude-test-name=}" || die
+}
+
+src_install() {
+	# Bug #352625 - Some LANGUAGE values can trigger the following ValueError:
+	#   File "/usr/lib/python2.6/locale.py", line 486, in getdefaultlocale
+	#    return _parse_localename(localename)
+	#  File "/usr/lib/python2.6/locale.py", line 418, in _parse_localename
+	#    raise ValueError, 'unknown locale: %s' % localename
+	#ValueError: unknown locale: 46
+	export -n LANG LANGUAGE ${!LC_*}
+	export LC_ALL=C.utf8 #709682
+
+	# Bug #295672 - Avoid sandbox violation in ~/.config by forcing
+	# variables to point to our fake temporary $HOME.
+	export HOME="${T}/fake_homedir"
+	export CALIBRE_CONFIG_DIRECTORY="${HOME}/.config/calibre"
+	mkdir -p "${CALIBRE_CONFIG_DIRECTORY}" || die
+
+	addpredict /dev/dri #665310
+
+	# If this directory doesn't exist, zsh completion won't install
+	dodir /usr/share/zsh/site-functions
+
+	"${PYTHON}" setup.py install \
+		--staging-root="${ED}/usr" \
+		--prefix="${EPREFIX}/usr" \
+		--libdir="${EPREFIX}/usr/$(get_libdir)" \
+		--staging-libdir="${ED}/usr/$(get_libdir)" \
+		--system-plugins-location="${EPREFIX}/usr/share/calibre/system-plugins" || die
+
+	cp -r man-pages/ "${ED}"/usr/share/man || die
+
+	find "${ED}"/usr/share -type d -empty -delete || die
+
+	einfo "Converting python shebangs"
+	python_fix_shebang "${ED}/usr/bin"
+
+	einfo "Compiling python modules"
+	python_optimize "${ED}"/usr/$(get_libdir)/calibre "${D}/$(python_get_sitedir)"
+
+	newinitd "${FILESDIR}"/calibre-server-3.init calibre-server
+	newconfd "${FILESDIR}"/calibre-server-3.conf calibre-server
+}
+
+pkg_postinst() {
+	xdg_desktop_database_update
+	xdg_mimeinfo_database_update
+	xdg_icon_cache_update
+}
+
+pkg_postrm() {
+	xdg_desktop_database_update
+	xdg_mimeinfo_database_update
+	xdg_icon_cache_update
+}

diff --git a/app-text/calibre/files/0001-HTML-Input-Dont-add-resources-that-exist-outside-the.patch b/app-text/calibre/files/0001-HTML-Input-Dont-add-resources-that-exist-outside-the.patch
new file mode 100644
index 000000000000..f33fd3345e27
--- /dev/null
+++ b/app-text/calibre/files/0001-HTML-Input-Dont-add-resources-that-exist-outside-the.patch
@@ -0,0 +1,55 @@
+From 57190699030dc6746320e49695a67ce83c62d549 Mon Sep 17 00:00:00 2001
+From: Kovid Goyal <kovid@kovidgoyal.net>
+Date: Sun, 28 May 2023 14:03:15 +0530
+Subject: [PATCH] HTML Input: Dont add resources that exist outside the folder
+ hierarchy rooted at the parent folder of the input HTML file by default
+
+(cherry picked from commit bbbddd2bf4ef4ddb467b0aeb0abe8765ed7f8a6b)
+---
+ .../ebooks/conversion/plugins/html_input.py      | 16 ++++++++++++++++
+ 1 file changed, 16 insertions(+)
+
+diff --git a/src/calibre/ebooks/conversion/plugins/html_input.py b/src/calibre/ebooks/conversion/plugins/html_input.py
+index 6f9c2084ea..742f3e0279 100644
+--- a/src/calibre/ebooks/conversion/plugins/html_input.py
++++ b/src/calibre/ebooks/conversion/plugins/html_input.py
+@@ -64,6 +64,16 @@ class HTMLInput(InputFormatPlugin):
+                 )
+         ),
+ 
++        OptionRecommendation(name='allow_local_files_outside_root',
++            recommended_value=False, level=OptionRecommendation.LOW,
++            help=_('Normally, resources linked to by the HTML file or its children will only be allowed'
++                   ' if they are in a sub-folder of the original HTML file. This option allows including'
++                   ' local files from any location on your computer. This can be a security risk if you'
++                   ' are converting untrusted HTML and expecting to distribute the result of the conversion.'
++                )
++        ),
++
++
+     }
+ 
+     def convert(self, stream, opts, file_ext, log,
+@@ -76,6 +86,7 @@ def convert(self, stream, opts, file_ext, log,
+         if hasattr(stream, 'name'):
+             basedir = os.path.dirname(stream.name)
+             fname = os.path.basename(stream.name)
++        self.root_dir_of_input = os.path.abspath(basedir) + os.sep
+ 
+         if file_ext != 'opf':
+             if opts.dont_package:
+@@ -250,6 +261,11 @@ def link_to_local_path(self, link_, base=None):
+         frag = l.fragment
+         if not link:
+             return None, None
++        link = os.path.abspath(os.path.realpath(link))
++        if not link.startswith(self.root_dir_of_input):
++            if not self.opts.allow_local_files_outside_root:
++                self.log.warn('Not adding {} as it is outside the document root: {}'.format(link, self.root_dir_of_input))
++                return None, None
+         return link, frag
+ 
+     def resource_adder(self, link_, base=None):
+-- 
+2.41.0
+


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: app-text/calibre/files/, app-text/calibre/
@ 2024-07-21 21:18 Eli Schwartz
  0 siblings, 0 replies; 13+ messages in thread
From: Eli Schwartz @ 2024-07-21 21:18 UTC (permalink / raw
  To: gentoo-commits

commit:     64fad029fd9e98ba427fe61628b12b79f448e8ac
Author:     Eli Schwartz <eschwartz <AT> gentoo <DOT> org>
AuthorDate: Sun Jul 21 21:09:43 2024 +0000
Commit:     Eli Schwartz <eschwartz <AT> gentoo <DOT> org>
CommitDate: Sun Jul 21 21:17:56 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=64fad029

app-text/calibre: in 5.x, fix building against icu 75

And backport a test-only fix so that tests pass. Haven't actually tested
icu 75 though since it requires rebuilding webengine... but a user did.
Besides, it's the same change upstream made in newer versions.

Closes: https://bugs.gentoo.org/936270
Signed-off-by: Eli Schwartz <eschwartz <AT> gentoo.org>

 app-text/calibre/calibre-5.44.0-r3.ebuild          |  4 +++
 app-text/calibre/files/calibre-5.44.0-icu75.patch  | 28 +++++++++++++++++
 .../e9cc00560a28f56a303cca97630ab58e519dd9c8.patch | 35 ++++++++++++++++++++++
 3 files changed, 67 insertions(+)

diff --git a/app-text/calibre/calibre-5.44.0-r3.ebuild b/app-text/calibre/calibre-5.44.0-r3.ebuild
index 34e4e197b419..ed6d79aa0779 100644
--- a/app-text/calibre/calibre-5.44.0-r3.ebuild
+++ b/app-text/calibre/calibre-5.44.0-r3.ebuild
@@ -130,6 +130,10 @@ PATCHES=(
 
 	# Security backport for CVE-2023-46303
 	"${FILESDIR}"/0001-HTML-Input-Dont-add-resources-that-exist-outside-the.patch
+	# bug #936270
+	"${FILESDIR}"/${P}-icu75.patch
+	# backport test-only fix for lxml 5
+	"${FILESDIR}"/e9cc00560a28f56a303cca97630ab58e519dd9c8.patch
 )
 
 src_prepare() {

diff --git a/app-text/calibre/files/calibre-5.44.0-icu75.patch b/app-text/calibre/files/calibre-5.44.0-icu75.patch
new file mode 100644
index 000000000000..3f79a9b4f79f
--- /dev/null
+++ b/app-text/calibre/files/calibre-5.44.0-icu75.patch
@@ -0,0 +1,28 @@
+logical changes backported from:
+https://github.com/kovidgoyal/calibre/commit/a3d3d8d33e314ccabb5099e78e4056a79b7c9aa2
+https://bugs.gentoo.org/936270
+
+diff -rup a/setup/build.py b/setup/build.py
+--- a/setup/build.py	2022-06-17 04:35:27.000000000 +0200
++++ b/setup/build.py	2024-07-19 11:51:56.374389213 +0200
+@@ -65,6 +65,8 @@ class Extension:
+                     self.cflags.insert(0, '-std=c++11')
+                 elif kwargs.get('needs_c++14'):
+                     self.cflags.insert(0, '-std=c++14')
++                elif kwargs.get('needs_c++17'):
++                    self.cflags.insert(0, '-std=c++17')
+             else:
+                 if kwargs.get('needs_c99'):
+                     self.cflags.insert(0, '-std=c99')
+diff -rup a/setup/extensions.json b/setup/extensions.json
+--- a/setup/extensions.json	2022-06-17 04:35:27.000000000 +0200
++++ b/setup/extensions.json	2024-07-19 11:52:11.253389395 +0200
+@@ -75,7 +75,7 @@
+         "name": "sqlite_extension",
+         "headers": "calibre/utils/cpp_binding.h",
+         "sources": "calibre/db/sqlite_extension.cpp",
+-		"needs_c++14": true,
++		"needs_c++17": true,
+         "libraries": "icudata icui18n icuuc icuio stemmer",
+         "windows_libraries": "icudt icuin icuuc icuio libstemmer",
+         "lib_dirs": "!icu_lib_dirs",

diff --git a/app-text/calibre/files/e9cc00560a28f56a303cca97630ab58e519dd9c8.patch b/app-text/calibre/files/e9cc00560a28f56a303cca97630ab58e519dd9c8.patch
new file mode 100644
index 000000000000..deae34e201e3
--- /dev/null
+++ b/app-text/calibre/files/e9cc00560a28f56a303cca97630ab58e519dd9c8.patch
@@ -0,0 +1,35 @@
+From e9cc00560a28f56a303cca97630ab58e519dd9c8 Mon Sep 17 00:00:00 2001
+From: Kovid Goyal <kovid@kovidgoyal.net>
+Date: Mon, 8 Jan 2024 09:12:35 +0530
+Subject: [PATCH] Fix #2048475 [Tests fail with lxml
+ 5.0](https://bugs.launchpad.net/calibre/+bug/2048475)
+
+---
+ src/calibre/utils/xml_parse.py | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/src/calibre/utils/xml_parse.py b/src/calibre/utils/xml_parse.py
+index a31c6ed83ed7..339538b90057 100644
+--- a/src/calibre/utils/xml_parse.py
++++ b/src/calibre/utils/xml_parse.py
+@@ -36,6 +36,11 @@ def safe_xml_fromstring(string_or_bytes, recover=True):
+     return ans
+ 
+ 
++def unsafe_xml_fromstring(string_or_bytes):
++    parser = etree.XMLParser(resolve_entities=True)
++    return fs(string_or_bytes, parser=parser)
++
++
+ def find_tests():
+     import unittest, tempfile, os
+     from calibre.constants import iswindows
+@@ -61,7 +66,7 @@ def t(tid, val, expected, safe=True):
+                 raw = templ.format(id=tid, val=val)
+                 err = None
+                 try:
+-                    root = safe_xml_fromstring(raw) if safe else etree.fromstring(raw)
++                    root = safe_xml_fromstring(raw) if safe else unsafe_xml_fromstring(raw)
+                 except Exception as e:
+                     err = str(e)
+                     root = None


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: app-text/calibre/files/, app-text/calibre/
@ 2024-07-31  3:53 Eli Schwartz
  0 siblings, 0 replies; 13+ messages in thread
From: Eli Schwartz @ 2024-07-31  3:53 UTC (permalink / raw
  To: gentoo-commits

commit:     34c67cbd5d13469221f14e46981a8e6a91fb2068
Author:     Eli Schwartz <eschwartz <AT> gentoo <DOT> org>
AuthorDate: Wed Jul 31 03:49:37 2024 +0000
Commit:     Eli Schwartz <eschwartz <AT> gentoo <DOT> org>
CommitDate: Wed Jul 31 03:51:38 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=34c67cbd

app-text/calibre: backport fix for CVE-2024-7008 to 5.44

Although 4 CVEs were fixed in 7.16.0, only one of them (relatively
minor) is present in 5.x.

Bug: https://bugs.gentoo.org/936961
Signed-off-by: Eli Schwartz <eschwartz <AT> gentoo.org>

 ...e-5.44.0-r4.ebuild => calibre-5.44.0-r5.ebuild} |  2 ++
 .../files/calibre-5.44.0-xss-backport.patch        | 33 ++++++++++++++++++++++
 2 files changed, 35 insertions(+)

diff --git a/app-text/calibre/calibre-5.44.0-r4.ebuild b/app-text/calibre/calibre-5.44.0-r5.ebuild
similarity index 99%
rename from app-text/calibre/calibre-5.44.0-r4.ebuild
rename to app-text/calibre/calibre-5.44.0-r5.ebuild
index 2c00399d5c90..48b7aadde2b2 100644
--- a/app-text/calibre/calibre-5.44.0-r4.ebuild
+++ b/app-text/calibre/calibre-5.44.0-r5.ebuild
@@ -135,6 +135,8 @@ PATCHES=(
 	"${FILESDIR}"/${P}-icu75.patch
 	# backport test-only fix for lxml 5
 	"${FILESDIR}"/e9cc00560a28f56a303cca97630ab58e519dd9c8.patch
+	# Security backport for CVE-2024-7008
+	"${FILESDIR}"/${P}-xss-backport.patch
 )
 
 src_prepare() {

diff --git a/app-text/calibre/files/calibre-5.44.0-xss-backport.patch b/app-text/calibre/files/calibre-5.44.0-xss-backport.patch
new file mode 100644
index 000000000000..83bb8cca8cf5
--- /dev/null
+++ b/app-text/calibre/files/calibre-5.44.0-xss-backport.patch
@@ -0,0 +1,33 @@
+Changelog:
+
+Only relevant if you embed the calibre server within a larger server, it
+means attackers who can convince users to click on a specially crafted
+link, can run JavaScript code with the same origin as the larger server
+calibre is embedded in.
+
+From e75f85919a3c3a5f2d87861050d8483d66561c06 Mon Sep 17 00:00:00 2001
+From: Kovid Goyal <kovid@kovidgoyal.net>
+Date: Tue, 30 Jul 2024 13:40:21 +0530
+Subject: [PATCH] Fix #2075130 [Private
+ bug](https://bugs.launchpad.net/calibre/+bug/2075130)
+
+---
+ src/calibre/srv/legacy.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/calibre/srv/legacy.py b/src/calibre/srv/legacy.py
+index 055228ebee..85586b07a6 100644
+--- a/src/calibre/srv/legacy.py
++++ b/src/calibre/srv/legacy.py
+@@ -255,7 +255,7 @@ def browse(ctx, rd, rest):
+     if rest.startswith('book/'):
+         # implementation of https://bugs.launchpad.net/calibre/+bug/1698411
+         # redirect old server book URLs to new URLs
+-        redirect = ctx.url_for(None) + '#book_id=' + rest[5:] + "&amp;panel=book_details"
++        redirect = ctx.url_for(None) + '#book_id=' + int(rest[5:]) + "&amp;panel=book_details"
+         from lxml import etree as ET
+         return html(ctx, rd, endpoint,
+                  E.html(E.head(
+-- 
+2.44.2
+


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: app-text/calibre/files/, app-text/calibre/
@ 2024-08-23  7:20 Eli Schwartz
  0 siblings, 0 replies; 13+ messages in thread
From: Eli Schwartz @ 2024-08-23  7:20 UTC (permalink / raw
  To: gentoo-commits

commit:     534905bcf0a78f7604661980d91e15e9505948d5
Author:     Eli Schwartz <eschwartz <AT> gentoo <DOT> org>
AuthorDate: Fri Aug 23 07:05:41 2024 +0000
Commit:     Eli Schwartz <eschwartz <AT> gentoo <DOT> org>
CommitDate: Fri Aug 23 07:19:24 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=534905bc

app-text/calibre: add 7.17.0

There have been some updates to the binary builds for Qt stuff that
basically amount to building PyQt6 with USE=speech. It's not yet active
in live codepaths, so patching it out of the testsuite for now. Will
keep an eye on it in the future with attention paid to the
practicalities of USE=speech. Recheck in future version bumps...

Signed-off-by: Eli Schwartz <eschwartz <AT> gentoo.org>

 app-text/calibre/Manifest                          |   2 +
 app-text/calibre/calibre-7.17.0.ebuild             | 246 +++++++++++++++++++++
 .../files/calibre-7.17.0-qt-texttospeech.patch     |  38 ++++
 3 files changed, 286 insertions(+)

diff --git a/app-text/calibre/Manifest b/app-text/calibre/Manifest
index 2e023d6be5a8..db0341d892c8 100644
--- a/app-text/calibre/Manifest
+++ b/app-text/calibre/Manifest
@@ -2,3 +2,5 @@ DIST calibre-5.44.0.tar.xz 41015696 BLAKE2B c7053e728da20fccfa981ed4f56e24a4d5b3
 DIST calibre-5.44.0.tar.xz.sig 566 BLAKE2B 413b95855d79bdb5b17ca5d760f834006797b4d3e413604f27d351a3392e16d647e772dc063306bf973e1156c34f68cb38152a66164bca849ebed5484e7f6065 SHA512 59957bf35a73f218241bf76cc86994d5af87cea11d3b0800e83f157bf0b2cfcaf4b6c1314562e74a1141d0c167fdb1619cb9a90e93b67f55dd55ceed77045059
 DIST calibre-7.16.0.tar.xz 44833684 BLAKE2B 2b609a0d014d43998f693a69c10f6d8b0165bf97f8c9d388cf4e1e398e7254b300d53b26e5ec24af651e03bb625bb088331dc77aa2ed6edea13de2beb0e75339 SHA512 5ea11badd972422299ce143e2aa33f58f7abcfd2837acba47d2a7aa6f0997a711245273205ed043c783e5e82bbaaf7cab44e5c03c00e274a03a4ba29be53a708
 DIST calibre-7.16.0.tar.xz.sig 566 BLAKE2B 1d09e8dd49ad53c88632dc23573fa9cd5403d45a308598ac4ed7d4f2dd5a84cc3ae6812ac652ff4a98fc5d67589ad1584411f7746b6b98468bf03a35a0585de6 SHA512 91f3897d95d234a8d673006273974d32cb6c5aa4953d247700d6d89d511c9b1450dc8e222eabf5d1e4d82de206e425ee440defaff38d1ca83efdbf4bcada7c7c
+DIST calibre-7.17.0.tar.xz 45053400 BLAKE2B 93149c4fab7a25e1239c4b8c72b766e5ffc71eb27d1206225bc8436f26d2c76f9323e0f0f63d8444291f02a5a7e94d4500715398a71df4ab2a5b16e325e7be73 SHA512 916337dc425916110528828bac0fbdc24db9496362c1e8dad67eafdfda42b90174fb6a4352400cd34af0f11268aabed82b166b3e4875f59e317359079e10bf3b
+DIST calibre-7.17.0.tar.xz.sig 566 BLAKE2B c041904919ef300f51ba7363daf7d2bc70fc8bb819ffef157e53c28f91b9716be56b1e95465180ecd67069241a5810b70ac08027f4837426a5426792fab05e49 SHA512 af88bcbf394ac6ec68c40d661545a17e956b31dd7797d1cc8490e090437206902a64c7a642cf1e34184e379c79066843959e1459eb1836bddbd615febbc85c07

diff --git a/app-text/calibre/calibre-7.17.0.ebuild b/app-text/calibre/calibre-7.17.0.ebuild
new file mode 100644
index 000000000000..ba0528419925
--- /dev/null
+++ b/app-text/calibre/calibre-7.17.0.ebuild
@@ -0,0 +1,246 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{10..12} )
+PYTHON_REQ_USE="sqlite,ssl"
+
+inherit edo toolchain-funcs python-single-r1 qmake-utils verify-sig xdg
+
+DESCRIPTION="Ebook management application"
+HOMEPAGE="https://calibre-ebook.com/"
+SRC_URI="
+	https://download.calibre-ebook.com/${PV}/${P}.tar.xz
+	verify-sig? ( https://calibre-ebook.com/signatures/${P}.tar.xz.sig )
+"
+VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/kovidgoyal.gpg
+
+LICENSE="
+	GPL-3+
+	GPL-3
+	GPL-2+
+	GPL-2
+	GPL-1+
+	LGPL-3+
+	LGPL-2.1+
+	LGPL-2.1
+	BSD
+	MIT
+	Old-MIT
+	Apache-2.0
+	public-domain
+	|| ( Artistic GPL-1+ )
+	CC-BY-3.0
+	OFL-1.1
+	PSF-2
+"
+SLOT="0"
+KEYWORDS="~amd64 ~arm64"
+IUSE="+font-subsetting ios speech +system-mathjax test +udisks unrar"
+
+RESTRICT="!test? ( test )"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+# Qt slotted dependencies are used because the libheadless.so plugin links to
+# QT_*_PRIVATE_ABI. It only uses core/gui/dbus.
+COMMON_DEPEND="${PYTHON_DEPS}
+	app-i18n/uchardet
+	>=app-text/hunspell-1.7:=
+	>=app-text/podofo-0.10.0:=
+	app-text/poppler[utils]
+	dev-libs/hyphen:=
+	>=dev-libs/icu-57.1:=
+	dev-libs/openssl:=
+	dev-libs/snowball-stemmer:=
+	$(python_gen_cond_dep '
+		>=dev-python/apsw-3.25.2_p1[${PYTHON_USEDEP}]
+		dev-python/beautifulsoup4[${PYTHON_USEDEP}]
+		>=dev-python/css-parser-1.0.4[${PYTHON_USEDEP}]
+		dev-python/dnspython[${PYTHON_USEDEP}]
+		>=dev-python/feedparser-5.2.1[${PYTHON_USEDEP}]
+		>=dev-python/html2text-2019.8.11[${PYTHON_USEDEP}]
+		>=dev-python/html5-parser-0.4.9[${PYTHON_USEDEP}]
+		dev-python/jeepney[${PYTHON_USEDEP}]
+		>=dev-python/lxml-3.8.0[${PYTHON_USEDEP}]
+		dev-python/lxml-html-clean[${PYTHON_USEDEP}]
+		>=dev-python/markdown-3.0.1[${PYTHON_USEDEP}]
+		>=dev-python/mechanize-0.3.5[${PYTHON_USEDEP}]
+		>=dev-python/msgpack-0.6.2[${PYTHON_USEDEP}]
+		>=dev-python/netifaces-0.10.5[${PYTHON_USEDEP}]
+		>=dev-python/pillow-3.2.0[jpeg,truetype,webp,zlib,${PYTHON_USEDEP}]
+		>=dev-python/psutil-4.3.0[${PYTHON_USEDEP}]
+		>=dev-python/pychm-0.8.6[${PYTHON_USEDEP}]
+		>=dev-python/pygments-2.3.1[${PYTHON_USEDEP}]
+		>=dev-python/python-dateutil-2.5.3[${PYTHON_USEDEP}]
+		dev-python/PyQt6[gui,network,opengl,printsupport,quick,svg,widgets,${PYTHON_USEDEP}]
+		dev-python/PyQt6-WebEngine[widgets,${PYTHON_USEDEP}]
+		dev-python/regex[${PYTHON_USEDEP}]
+		dev-python/xxhash[${PYTHON_USEDEP}]
+		>=dev-python/zeroconf-0.75.0[${PYTHON_USEDEP}]
+	')
+	dev-qt/qtbase:6=[gui,widgets]
+	dev-qt/qtimageformats:6
+	dev-util/desktop-file-utils
+	dev-util/gtk-update-icon-cache
+	media-fonts/liberation-fonts
+	media-libs/fontconfig:=
+	>=media-libs/freetype-2:=
+	>=media-libs/libmtp-1.1.11:=
+	>=media-gfx/optipng-0.7.6
+	virtual/libusb:1=
+	x11-misc/shared-mime-info
+	>=x11-misc/xdg-utils-1.0.2-r2
+	font-subsetting? ( $(python_gen_cond_dep 'dev-python/fonttools[${PYTHON_USEDEP}]') )
+	ios? (
+		>=app-pda/usbmuxd-1.0.8
+		>=app-pda/libimobiledevice-1.2.0
+	)
+	speech? ( $(python_gen_cond_dep 'app-accessibility/speech-dispatcher[python,${PYTHON_USEDEP}]') )
+	system-mathjax? ( >=dev-libs/mathjax-3:= )
+	udisks? ( virtual/libudev )
+	unrar? ( dev-python/unrardll )
+"
+RDEPEND="${COMMON_DEPEND}
+	udisks? ( sys-fs/udisks:2 )"
+DEPEND="${COMMON_DEPEND}
+	test? ( $(python_gen_cond_dep '>=dev-python/chardet-3.0.3[${PYTHON_USEDEP}]') )
+"
+BDEPEND="$(python_gen_cond_dep '
+		>=dev-python/PyQt-builder-1.10.3[${PYTHON_USEDEP}]
+		>=dev-python/sip-5[${PYTHON_USEDEP}]
+	')
+	virtual/pkgconfig
+	system-mathjax? ( dev-lang/rapydscript-ng )
+	verify-sig? ( sec-keys/openpgp-keys-kovidgoyal )
+"
+
+PATCHES=(
+	# 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}-7.0.0-jxr-test.patch"
+	# Don't test availability of PyQt6 tts module, which is not yet used.
+	# Recheck this with future version bumps...
+	"${FILESDIR}"/calibre-7.17.0-qt-texttospeech.patch
+)
+
+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's packaging is recommended.
+
+	# Disable unnecessary privilege dropping for bug #287067.
+	sed -e "s:if os.geteuid() == 0:if False and os.geteuid() == 0:" \
+		-i setup/install.py || die "sed failed to patch install.py"
+
+	# This is only ever used at build time. It contains a small embedded copy
+	# of the rapydscript-ng compiler usable inside of qtwebengine, if you don't
+	# have rapydscript-ng (a nodejs package) itself installed. Its only purpose
+	# is to build some resources that come bundled in dist tarballs already...
+	# and which we may also need to regenerate e.g. to use system-mathjax.
+	#
+	# However, running qtwebengine violates the portage sandbox (among other
+	# things, it tries to create directories in /usr! amazing) so this is a
+	# wash anyway. The only real solution here is to package rapydscript-ng.
+	#
+	# We do not need it at build time, and *no one* needs it at install time.
+	# Delete the cruft.
+	rm -r resources/rapydscript/ || die
+}
+
+src_compile() {
+	# TODO: get qmake called by setup.py to respect CC and CXX too
+	tc-export CC CXX
+
+	# bug 821871
+	local MY_LIBDIR="${ESYSROOT}/usr/$(get_libdir)"
+	export FT_LIB_DIR="${MY_LIBDIR}" HUNSPELL_LIB_DIR="${MY_LIBDIR}" PODOFO_LIB_DIR="${MY_LIBDIR}"
+	export QMAKE="$(qt6_get_bindir)/qmake"
+
+	edo ${EPYTHON} setup.py build
+	edo ${EPYTHON} setup.py gui
+
+	# A few different resources are bundled in the distfile by default, because
+	# not all systems necessarily have them. We un-vendor them, using the
+	# upstream integrated approach if possible. See setup/revendor.py and
+	# consider migrating other resources to this if they do not use it, in
+	# *preference* over manual rm'ing.
+	edo ${EPYTHON} setup.py liberation_fonts \
+		--path-to-liberation_fonts "${EPREFIX}"/usr/share/fonts/liberation-fonts \
+		--system-liberation_fonts
+	if use system-mathjax; then
+		edo ${EPYTHON} setup.py mathjax --path-to-mathjax "${EPREFIX}"/usr/share/mathjax --system-mathjax
+		edo ${EPYTHON} setup.py rapydscript
+	fi
+}
+
+src_test() {
+	# Skipped tests:
+	local _test_excludes=(
+		# unpackaged Python dependency: py7zr
+		7z
+		# unpackaged Python dependency: pyzstd
+		test_zstd
+		# tests if a completely unused module is bundled
+		pycryptodome
+
+		$(usev !speech speech_dispatcher)
+		$(usev !unrar test_unrar)
+
+		# undocumented reasons
+		test_mem_leaks
+		test_searching
+	)
+
+	edo ${PYTHON} setup.py test "${_test_excludes[@]/#/--exclude-test-name=}"
+}
+
+src_install() {
+	# Bug #352625 - Some LANGUAGE values can trigger the following ValueError:
+	#   File "/usr/lib/python2.6/locale.py", line 486, in getdefaultlocale
+	#    return _parse_localename(localename)
+	#  File "/usr/lib/python2.6/locale.py", line 418, in _parse_localename
+	#    raise ValueError, 'unknown locale: %s' % localename
+	#ValueError: unknown locale: 46
+	export -n LANG LANGUAGE ${!LC_*}
+	export LC_ALL=C.utf8 # bug #709682
+
+	# Bug #295672 - Avoid sandbox violation in ~/.config by forcing
+	# variables to point to our fake temporary $HOME.
+	export HOME="${T}/fake_homedir"
+	export CALIBRE_CONFIG_DIRECTORY="${HOME}/.config/calibre"
+	mkdir -p "${CALIBRE_CONFIG_DIRECTORY}" || die
+
+	addpredict /dev/dri #665310
+
+	# If this directory doesn't exist, zsh completion won't install
+	dodir /usr/share/zsh/site-functions
+
+	edo "${PYTHON}" setup.py install \
+		--staging-root="${ED}/usr" \
+		--prefix="${EPREFIX}/usr" \
+		--libdir="${EPREFIX}/usr/$(get_libdir)" \
+		--staging-libdir="${ED}/usr/$(get_libdir)" \
+		--system-plugins-location="${EPREFIX}/usr/share/calibre/system-plugins"
+
+	cp -r man-pages/ "${ED}"/usr/share/man || die
+
+	find "${ED}"/usr/share -type d -empty -delete || die
+
+	python_fix_shebang "${ED}/usr/bin"
+
+	python_optimize "${ED}"/usr/$(get_libdir)/calibre "${D}/$(python_get_sitedir)"
+
+	newinitd "${FILESDIR}"/calibre-server-3.init calibre-server
+	newconfd "${FILESDIR}"/calibre-server-3.conf calibre-server
+}

diff --git a/app-text/calibre/files/calibre-7.17.0-qt-texttospeech.patch b/app-text/calibre/files/calibre-7.17.0-qt-texttospeech.patch
new file mode 100644
index 000000000000..ff50735e4788
--- /dev/null
+++ b/app-text/calibre/files/calibre-7.17.0-qt-texttospeech.patch
@@ -0,0 +1,38 @@
+From 6d87aa054724155c9413e5692fa1f242f9cc0efc Mon Sep 17 00:00:00 2001
+From: Eli Schwartz <eschwartz93@gmail.com>
+Date: Fri, 23 Aug 2024 02:20:00 -0400
+Subject: [PATCH] tests: delete qt TTS assert which is not yet used
+
+It will be used in future versions of calibre, and should likely be
+gated on USE=speech.
+---
+ src/calibre/test_build.py | 6 +-----
+ 1 file changed, 1 insertion(+), 5 deletions(-)
+
+diff --git a/src/calibre/test_build.py b/src/calibre/test_build.py
+index 4f19363680..898caad665 100644
+--- a/src/calibre/test_build.py
++++ b/src/calibre/test_build.py
+@@ -314,7 +314,7 @@ def test_apsw(self):
+     def test_qt(self):
+         if is_sanitized:
+             raise unittest.SkipTest('Skipping Qt build test as sanitizer is enabled')
+-        from qt.core import QApplication, QFontDatabase, QImageReader, QLoggingCategory, QNetworkAccessManager, QSslSocket, QTextToSpeech, QTimer
++        from qt.core import QApplication, QFontDatabase, QImageReader, QLoggingCategory, QNetworkAccessManager, QSslSocket, QTimer
+         QLoggingCategory.setFilterRules('''qt.webenginecontext.debug=true''')
+         if hasattr(os, 'geteuid') and os.geteuid() == 0:
+             # likely a container build, webengine cannot run as root with sandbox
+@@ -348,10 +348,6 @@ def test_qt(self):
+         try:
+             ensure_app()
+             self.assertGreaterEqual(len(QFontDatabase.families()), 5, 'The QPA headless plugin is not able to locate enough system fonts via fontconfig')
+-            available_tts_engines = tuple(x for x in QTextToSpeech.availableEngines() if x != 'mock')
+-            self.assertTrue(available_tts_engines)
+-
+-            self.assertGreaterEqual
+             from calibre.ebooks.oeb.transforms.rasterize import rasterize_svg
+             img = rasterize_svg(as_qimage=True)
+             self.assertFalse(img.isNull())
+-- 
+2.44.2
+


^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2024-08-23  7:20 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-28  0:40 [gentoo-commits] repo/gentoo:master commit in: app-text/calibre/files/, app-text/calibre/ Zac Medico
  -- strict thread matches above, loose matches on Subject: below --
2024-08-23  7:20 Eli Schwartz
2024-07-31  3:53 Eli Schwartz
2024-07-21 21:18 Eli Schwartz
2023-11-24 16:55 Sam James
2023-02-09 10:25 Andreas Sturmlechner
2021-11-02 22:45 Sam James
2021-10-22  6:29 Zac Medico
2021-08-26 23:58 Sam James
2021-06-14 18:13 Zac Medico
2020-11-28 22:50 Andreas K. Hüttel
2017-06-26  8:05 Zac Medico
2017-04-24  0:05 Zac Medico

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox