From 9190114d0d7ab53202c857995e377b72028865a7 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 4 Sep 2024 17:36:02 +0530 Subject: [PATCH] Build piper binaries on macOS as well --- bypy/linux/__main__.py | 8 ++++++-- bypy/sources.json | 36 ++++++++---------------------------- 2 files changed, 14 insertions(+), 30 deletions(-) diff --git a/bypy/linux/__main__.py b/bypy/linux/__main__.py index 70faff1fad..7a9da1e787 100644 --- a/bypy/linux/__main__.py +++ b/bypy/linux/__main__.py @@ -15,7 +15,7 @@ from functools import partial from bypy.constants import LIBDIR, OUTPUT_DIR, PREFIX, python_major_minor_version from bypy.constants import SRC as CALIBRE_DIR from bypy.freeze import extract_extension_modules, fix_pycryptodome, freeze_python, is_package_dir, path_to_freeze_dir -from bypy.utils import create_job, get_dll_path, mkdtemp, parallel_build, py_compile, run, walk +from bypy.utils import copy_binaries, create_job, get_dll_path, mkdtemp, parallel_build, py_compile, run, walk j = os.path.join self_dir = os.path.dirname(os.path.abspath(__file__)) @@ -109,7 +109,11 @@ def import_site_packages(srcdir, dest): def copy_piper(env): print('Copying piper...') - shutil.copytree(os.path.join(PREFIX, 'piper'), os.path.join(env.bin_dir, 'piper')) + src = os.path.join(PREFIX, 'piper') + dest = os.path.join(env.bin_dir, 'piper') + copy_binaries(os.path.join(src, 'lib*'), dest) + copy_binaries(os.path.join(src, 'piper*'), dest) + shutil.copytree(os.path.join(src, 'espeak-ng-data'), os.path.join(dest, 'espeak-ng-data')) def copy_libs(env): diff --git a/bypy/sources.json b/bypy/sources.json index f6c9d0a6d4..f10212c5a8 100644 --- a/bypy/sources.json +++ b/bypy/sources.json @@ -1159,18 +1159,18 @@ }, { "name": "onnx", - "comment": "This is the version needed for the version of piper-phonemize we use (see CMakeLists.txt in piper-phonemize)", - "os": "linux", + "comment": "This is newer than the version needed for the version of piper-phonemize to get it to build on macOS (see CMakeLists.txt in piper-phonemize)", + "os": "linux,macos", "unix": { - "filename": "onnx-1.14.1.tar.gz", - "hash": "sha256:f998352b131bb89fa7dd1f1d87ddbafe647dfaddd11929b6b5168b3f4ef857de", - "urls": ["https://github.com/microsoft/onnxruntime/archive/refs/tags/v1.14.1.tar.gz"] + "filename": "onnx-1.19.0.tar.gz", + "hash": "sha256:dd945b2fb8c2e7df7243e9d96c0293f45350058f0f713f66c519834a49a6c99d", + "urls": ["https://github.com/microsoft/onnxruntime/archive/refs/tags/v1.19.0.tar.gz"] } }, { "name": "piper-espeak", "comment": "This is the version needed for the version of piper-phonemize we use (see CMakeLists.txt in piper-phonemize)", - "os": "linux", + "os": "linux,macos", "unix": { "filename": "espeak-1.zip", "hash": "sha256:150fc955926a084a77ebe25c9e8287bde2e2a17bbf9b23a25c147b556837949f", @@ -1180,36 +1180,16 @@ { "name": "piper-phonemize", "comment": "This is the version needed for the version of piper we use (see CMakeLists.txt in piper)", - "os": "linux", + "os": "linux,macos", "unix": { "filename": "piper-phonemize-1.zip", "hash": "sha256:cc57a4a00a0f5bd50555a93c94c0622da065a2a90b9c896bfbe8b45519e2e9c2", "urls": ["https://github.com/rhasspy/piper-phonemize/archive/bfc2e7549957829b0227c66a305d11cc88167bda.zip"] } }, - { - "name": "piper-fmt", - "comment": "This is the version needed for the version of piper we use (see CMakeLists.txt in piper)", - "os": "linux", - "unix": { - "filename": "fmt-10.0.0.zip", - "hash": "sha256:4943cb165f3f587f26da834d3056ee8733c397e024145ca7d2a8a96bb71ac281", - "urls": ["https://github.com/fmtlib/fmt/releases/download/10.0.0/{filename}"] - } - }, - { - "name": "piper-spdlog", - "comment": "This is the version needed for the version of piper we use (see CMakeLists.txt in piper)", - "os": "linux", - "unix": { - "filename": "piper-spdlog-1.12.0.0.0.tar.gz", - "hash": "sha256:4dccf2d10f410c1e2feaff89966bfc49a1abb29ef6f08246335b110e001e09a9", - "urls": ["https://github.com/gabime/spdlog/archive/refs/tags/v1.12.0.tar.gz"] - } - }, { "name": "piper", - "os": "linux", + "os": "linux,macos", "unix": { "filename": "piper-2023.11.14.tar.gz", "hash": "sha256:8b684e102cfe23af097830db9555a8641f17735725853c531a1daeb34b6ed1a8",