Added app-text/calibre-8.15.0

This commit is contained in:
saundersp
2025-11-25 17:36:04 +01:00
parent d892dfa5d7
commit 8004a2f6ab
8 changed files with 444 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
diff --git a/src/calibre/utils/img.py b/src/calibre/utils/img.py
index b61627b63e..ff51c76e75 100644
--- a/src/calibre/utils/img.py
+++ b/src/calibre/utils/img.py
@@ -129,8 +129,6 @@ def image_from_data(data):
i = QImage()
if not i.loadFromData(data):
q = what(None, data)
- if q == 'jxr':
- return load_jxr_data(data)
raise NotImage(f'Not a valid image (detected type: {q})')
return i
@@ -693,13 +691,6 @@ def test(): # {{{
despeckle_image(img)
remove_borders_from_image(img)
image_to_data(img, fmt='GIF')
- p = subprocess.Popen([get_exe_path('JxrDecApp'), '-h'],
- creationflags=subprocess.DETACHED_PROCESS if iswindows else 0,
- stdout=subprocess.PIPE)
- raw, _ = p.communicate()
- p.wait()
- if b'JPEG XR Decoder Utility' not in raw:
- raise SystemExit('Failed to run JxrDecApp')
# }}}

View File

@@ -0,0 +1,47 @@
piper deps aren't packaged yet, and should be USE conditional anyway
https://bugs.gentoo.org/961974
diff --git a/setup/extensions.json b/setup/extensions.json
index b39ce6d..c105031 100644
--- a/setup/extensions.json
+++ b/setup/extensions.json
@@ -134,14 +134,6 @@
"error": "!podofo_error",
"needs_c++": "17"
},
- {
- "name": "piper",
- "sources": "calibre/utils/tts/piper.cpp",
- "needs_c++": "17",
- "libraries": "!piper_libs",
- "lib_dirs": "!piper_lib_dirs",
- "inc_dirs": "!piper_inc_dirs"
- },
{
"name": "html_as_json",
"sources": "calibre/srv/html_as_json.cpp",
diff --git a/src/calibre/constants.py b/src/calibre/constants.py
index fa4b211459..7b27768953 100644
--- a/src/calibre/constants.py
+++ b/src/calibre/constants.py
@@ -258,7 +258,6 @@ def __init__(self):
'rcc_backend',
'icu',
'speedup',
- 'piper',
'html_as_json',
'fast_css_transform',
'fast_html_entities',
diff --git a/src/calibre/utils/run_tests.py b/src/calibre/utils/run_tests.py
index ffd0f95c04..c80a35f83d 100644
--- a/src/calibre/utils/run_tests.py
+++ b/src/calibre/utils/run_tests.py
@@ -192,6 +192,7 @@ def test_import_of_all_python_modules(self):
}
if 'SKIP_SPEECH_TESTS' in os.environ:
exclude_packages.add('calibre.gui2.tts')
+ exclude_modules.add('calibre.utils.tts.piper')
if not isbsd:
exclude_modules.add('calibre.devices.usbms.hal')
d = os.path.dirname

View File

@@ -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"

View File

@@ -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 $?
}