mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-06-23 15:30:45 -04:00
Include the piper binaries in the Linux binary build
This commit is contained in:
parent
7fbc1d7184
commit
25620a7886
@ -107,6 +107,11 @@ def import_site_packages(srcdir, dest):
|
||||
shutil.copytree(f, j(dest, x), ignore=ignore_in_lib)
|
||||
|
||||
|
||||
def copy_piper(env):
|
||||
print('Copying piper...')
|
||||
shutil.copytree(os.path.join(PREFIX, 'piper'), os.path.join(env.bin_dir, 'piper'))
|
||||
|
||||
|
||||
def copy_libs(env):
|
||||
print('Copying libs...')
|
||||
|
||||
@ -252,7 +257,7 @@ def strip_files(files, argv_max=(256 * 1024)):
|
||||
|
||||
|
||||
def strip_binaries(env):
|
||||
files = {j(env.bin_dir, x) for x in os.listdir(env.bin_dir)} | {
|
||||
files = {j(env.bin_dir, x) for x in os.listdir(env.bin_dir) if x != 'piper'} | {
|
||||
x for x in {
|
||||
j(os.path.dirname(env.bin_dir), x) for x in os.listdir(env.bin_dir)} if os.path.exists(x)}
|
||||
for x in walk(env.lib_dir):
|
||||
@ -304,6 +309,7 @@ def main():
|
||||
env = Env()
|
||||
copy_libs(env)
|
||||
copy_python(env, ext_dir)
|
||||
copy_piper(env)
|
||||
build_launchers(env)
|
||||
if not args.skip_tests:
|
||||
run_tests(j(env.base, 'calibre-debug'), env.base)
|
||||
|
@ -488,7 +488,7 @@ def get_umask():
|
||||
return mask
|
||||
|
||||
|
||||
# call this at startup as it changed process global state, which doesn't work
|
||||
# call this at startup as it changes process global state, which doesn't work
|
||||
# with multi-threading. It's absurd there is no way to safely read the current
|
||||
# umask of a process.
|
||||
get_umask()
|
||||
@ -511,8 +511,7 @@ def bundled_binaries_dir() -> str:
|
||||
def piper_cmdline() -> tuple[str, ...]:
|
||||
ext = '.exe' if iswindows else ''
|
||||
if bbd := bundled_binaries_dir():
|
||||
# TODO: Add path to espeak-ng-data with --
|
||||
return (os.path.join(bbd, 'piper' + ext),)
|
||||
return (os.path.join(bbd, 'piper', 'piper' + ext),)
|
||||
if pd := os.environ.get('PIPER_TTS_DIR'):
|
||||
return (os.path.join(pd, 'piper' + ext),)
|
||||
import shutil
|
||||
|
Loading…
x
Reference in New Issue
Block a user