From eb1247dcbdde759491064f5dd77b8bc9ffca70d0 Mon Sep 17 00:00:00 2001 From: Hyoda Kazuaki Date: Sun, 23 Apr 2023 00:46:01 +0900 Subject: [PATCH] Add iOS support (#471) * support iOS target : - x86_64-apple-ios - aarch64-apple-ios - aarch64-apple-ios-sim * remove python wheel * fix FIXME comment about process_path for iOS support Co-authored-by: Ryo Yamashita --------- Co-authored-by: Ryo Yamashita --- .github/workflows/build_and_deploy.yml | 15 +++++++++++++++ Cargo.lock | 10 +++++----- Cargo.toml | 4 ++-- crates/voicevox_core/Cargo.toml | 4 ++-- crates/voicevox_core_c_api/build.rs | 2 +- 5 files changed, 25 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build_and_deploy.yml b/.github/workflows/build_and_deploy.yml index c0ab49061..e98958d67 100644 --- a/.github/workflows/build_and_deploy.yml +++ b/.github/workflows/build_and_deploy.yml @@ -89,6 +89,21 @@ jobs: artifact_name: osx-x64-cpu whl_local_version: cpu use_cuda: false + - os: macos-12 + features: "" + target: aarch64-apple-ios + artifact_name: ios-arm64-cpu + use_cuda: false + - os: macos-12 + features: "" + target: aarch64-apple-ios-sim + artifact_name: ios-arm64-cpu-sim + use_cuda: false + - os: macos-12 + features: "" + target: x86_64-apple-ios + artifact_name: ios-x64-cpu + use_cuda: false runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v3 diff --git a/Cargo.lock b/Cargo.lock index 2111b2275..bfc44ce78 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2157,7 +2157,7 @@ checksum = "e82dad04139b71a90c080c8463fe0dc7902db5192d939bd0950f074d014339e1" [[package]] name = "onnxruntime" version = "0.1.0" -source = "git+https://github.com/VOICEVOX/onnxruntime-rs.git?rev=09dc0c764e6f1d5c4bdcb8a96cfc3c41789e66bc#09dc0c764e6f1d5c4bdcb8a96cfc3c41789e66bc" +source = "git+https://github.com/VOICEVOX/onnxruntime-rs.git?rev=c322c6ac8f4d58afbbe6412ad674c59a01933620#c322c6ac8f4d58afbbe6412ad674c59a01933620" dependencies = [ "lazy_static", "ndarray", @@ -2169,7 +2169,7 @@ dependencies = [ [[package]] name = "onnxruntime-sys" version = "0.0.25" -source = "git+https://github.com/VOICEVOX/onnxruntime-rs.git?rev=09dc0c764e6f1d5c4bdcb8a96cfc3c41789e66bc#09dc0c764e6f1d5c4bdcb8a96cfc3c41789e66bc" +source = "git+https://github.com/VOICEVOX/onnxruntime-rs.git?rev=c322c6ac8f4d58afbbe6412ad674c59a01933620#c322c6ac8f4d58afbbe6412ad674c59a01933620" dependencies = [ "flate2", "once_cell", @@ -2187,7 +2187,7 @@ checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" [[package]] name = "open_jtalk" version = "0.1.25" -source = "git+https://github.com/VOICEVOX/open_jtalk-rs.git?rev=aa50be1c372a4733e9b5eed79902af1d4b3f155a#aa50be1c372a4733e9b5eed79902af1d4b3f155a" +source = "git+https://github.com/VOICEVOX/open_jtalk-rs.git?rev=4a812570bb792be1579148c5adce0d047e22aa94#4a812570bb792be1579148c5adce0d047e22aa94" dependencies = [ "open_jtalk-sys", "thiserror", @@ -2196,7 +2196,7 @@ dependencies = [ [[package]] name = "open_jtalk-sys" version = "0.16.111" -source = "git+https://github.com/VOICEVOX/open_jtalk-rs.git?rev=aa50be1c372a4733e9b5eed79902af1d4b3f155a#aa50be1c372a4733e9b5eed79902af1d4b3f155a" +source = "git+https://github.com/VOICEVOX/open_jtalk-rs.git?rev=4a812570bb792be1579148c5adce0d047e22aa94#4a812570bb792be1579148c5adce0d047e22aa94" dependencies = [ "bindgen", "cmake", @@ -2496,7 +2496,7 @@ dependencies = [ [[package]] name = "process_path" version = "0.1.4" -source = "git+https://github.com/wesleywiser/process_path.git?rev=ff028326505f7198ce528feecead9a367a43adc4#ff028326505f7198ce528feecead9a367a43adc4" +source = "git+https://github.com/VOICEVOX/process_path.git?rev=de226a26e8e18edbdb1d6f986afe37bbbf35fbf4#de226a26e8e18edbdb1d6f986afe37bbbf35fbf4" dependencies = [ "libc", "winapi", diff --git a/Cargo.toml b/Cargo.toml index 93d0d00aa..94b1e19f0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,8 +19,8 @@ clap = { version = "4.0.10", features = ["derive"] } easy-ext = "1.0.1" fs-err = { version = "2.9.0", features = ["tokio"] } once_cell = "1.15.0" -# FIXME: 最新のコミットでのみAndroidのビルドが通るため -process_path = { git = "https://github.com/wesleywiser/process_path.git", rev = "ff028326505f7198ce528feecead9a367a43adc4" } +# FIXME: iOS対応のpull request(https://github.com/wesleywiser/process_path/pull/16)がマージされる見込みが無いため +process_path = { git = "https://github.com/VOICEVOX/process_path.git", rev = "de226a26e8e18edbdb1d6f986afe37bbbf35fbf4" } regex = "1.6.0" serde = { version = "1.0.145", features = ["derive"] } serde_json = "1.0.85" diff --git a/crates/voicevox_core/Cargo.toml b/crates/voicevox_core/Cargo.toml index 3af2a8b0e..e2f33fbe7 100644 --- a/crates/voicevox_core/Cargo.toml +++ b/crates/voicevox_core/Cargo.toml @@ -17,13 +17,13 @@ derive-new = "0.5.9" easy-ext.workspace = true fs-err.workspace = true once_cell.workspace = true -onnxruntime = { git = "https://github.com/VOICEVOX/onnxruntime-rs.git", rev="09dc0c764e6f1d5c4bdcb8a96cfc3c41789e66bc" } +onnxruntime = { git = "https://github.com/VOICEVOX/onnxruntime-rs.git", rev="c322c6ac8f4d58afbbe6412ad674c59a01933620" } process_path.workspace = true serde.workspace = true serde_json.workspace = true thiserror.workspace = true tracing.workspace = true -open_jtalk = { git = "https://github.com/VOICEVOX/open_jtalk-rs.git", rev="aa50be1c372a4733e9b5eed79902af1d4b3f155a" } +open_jtalk = { git = "https://github.com/VOICEVOX/open_jtalk-rs.git", rev="4a812570bb792be1579148c5adce0d047e22aa94" } regex.workspace = true [dev-dependencies] diff --git a/crates/voicevox_core_c_api/build.rs b/crates/voicevox_core_c_api/build.rs index 71e5837bc..535e73676 100644 --- a/crates/voicevox_core_c_api/build.rs +++ b/crates/voicevox_core_c_api/build.rs @@ -2,7 +2,7 @@ fn main() { #[cfg(target_os = "linux")] println!("cargo:rustc-link-arg=-Wl,-rpath,$ORIGIN"); - #[cfg(target_os = "macos")] + #[cfg(any(target_os = "macos", target_os = "ios"))] { println!("cargo:rustc-link-arg=-Wl,-rpath,@loader_path/"); println!("cargo:rustc-link-arg=-Wl,-install_name,@rpath/libvoicevox_core.dylib");