Build piper binaries on macOS as well

This commit is contained in:
Kovid Goyal 2024-09-04 17:36:02 +05:30
parent 8d7c41cdba
commit 9190114d0d
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 14 additions and 30 deletions

View File

@ -15,7 +15,7 @@ from functools import partial
from bypy.constants import LIBDIR, OUTPUT_DIR, PREFIX, python_major_minor_version from bypy.constants import LIBDIR, OUTPUT_DIR, PREFIX, python_major_minor_version
from bypy.constants import SRC as CALIBRE_DIR 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.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 j = os.path.join
self_dir = os.path.dirname(os.path.abspath(__file__)) self_dir = os.path.dirname(os.path.abspath(__file__))
@ -109,7 +109,11 @@ def import_site_packages(srcdir, dest):
def copy_piper(env): def copy_piper(env):
print('Copying piper...') 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): def copy_libs(env):

View File

@ -1159,18 +1159,18 @@
}, },
{ {
"name": "onnx", "name": "onnx",
"comment": "This is the version needed for the version of piper-phonemize we use (see CMakeLists.txt in piper-phonemize)", "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", "os": "linux,macos",
"unix": { "unix": {
"filename": "onnx-1.14.1.tar.gz", "filename": "onnx-1.19.0.tar.gz",
"hash": "sha256:f998352b131bb89fa7dd1f1d87ddbafe647dfaddd11929b6b5168b3f4ef857de", "hash": "sha256:dd945b2fb8c2e7df7243e9d96c0293f45350058f0f713f66c519834a49a6c99d",
"urls": ["https://github.com/microsoft/onnxruntime/archive/refs/tags/v1.14.1.tar.gz"] "urls": ["https://github.com/microsoft/onnxruntime/archive/refs/tags/v1.19.0.tar.gz"]
} }
}, },
{ {
"name": "piper-espeak", "name": "piper-espeak",
"comment": "This is the version needed for the version of piper-phonemize we use (see CMakeLists.txt in piper-phonemize)", "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": { "unix": {
"filename": "espeak-1.zip", "filename": "espeak-1.zip",
"hash": "sha256:150fc955926a084a77ebe25c9e8287bde2e2a17bbf9b23a25c147b556837949f", "hash": "sha256:150fc955926a084a77ebe25c9e8287bde2e2a17bbf9b23a25c147b556837949f",
@ -1180,36 +1180,16 @@
{ {
"name": "piper-phonemize", "name": "piper-phonemize",
"comment": "This is the version needed for the version of piper we use (see CMakeLists.txt in piper)", "comment": "This is the version needed for the version of piper we use (see CMakeLists.txt in piper)",
"os": "linux", "os": "linux,macos",
"unix": { "unix": {
"filename": "piper-phonemize-1.zip", "filename": "piper-phonemize-1.zip",
"hash": "sha256:cc57a4a00a0f5bd50555a93c94c0622da065a2a90b9c896bfbe8b45519e2e9c2", "hash": "sha256:cc57a4a00a0f5bd50555a93c94c0622da065a2a90b9c896bfbe8b45519e2e9c2",
"urls": ["https://github.com/rhasspy/piper-phonemize/archive/bfc2e7549957829b0227c66a305d11cc88167bda.zip"] "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", "name": "piper",
"os": "linux", "os": "linux,macos",
"unix": { "unix": {
"filename": "piper-2023.11.14.tar.gz", "filename": "piper-2023.11.14.tar.gz",
"hash": "sha256:8b684e102cfe23af097830db9555a8641f17735725853c531a1daeb34b6ed1a8", "hash": "sha256:8b684e102cfe23af097830db9555a8641f17735725853c531a1daeb34b6ed1a8",