Skip to content

Commit

Permalink
fix: Doc.rs Build Fails For livekit-api = 0.4.1 (#495)
Browse files Browse the repository at this point in the history
  • Loading branch information
tommady authored Nov 30, 2024
1 parent 154555b commit 9d68b19
Show file tree
Hide file tree
Showing 7 changed files with 326 additions and 556 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ jobs:
steps:
- name: Install Rust toolchain
run: |
rustup update --no-self-update stable
rustup target add ${{ matrix.target }}
rustup update --no-self-update nightly
rustup target add ${{ matrix.target }} --toolchain nightly
- name: Install linux dependencies
if: ${{ matrix.os == 'ubuntu-20.04' }}
Expand All @@ -57,6 +57,6 @@ jobs:
submodules: true

- name: Test
run: cargo test --release --verbose --target ${{ matrix.target }} -- --nocapture
run: cargo +nightly test --release --verbose --target ${{ matrix.target }} -- --nocapture


2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[workspace]
resolver = "2"
members = [
"livekit",
"livekit-api",
Expand All @@ -14,7 +15,7 @@ members = [
[workspace.dependencies]
libwebrtc = { version = "0.3.7", path = "libwebrtc" }
livekit-api = { version = "0.4.1", path = "livekit-api" }
livekit-ffi = { version = "0.12.2", path = "livekit-ffi" }
livekit-ffi = { version = "0.12.3", path = "livekit-ffi" }
livekit-protocol = { version = "0.3.6", path = "livekit-protocol" }
livekit-runtime = { version = "0.3.1", path = "livekit-runtime" }
livekit = { version = "0.7.0", path = "livekit" }
Expand Down
2 changes: 1 addition & 1 deletion livekit-ffi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ imgproc = "0.3.11"
jni = "0.21.1"

[build-dependencies]
webrtc-sys-build = { path = "../webrtc-sys/build", version = "0.3.2" }
webrtc-sys-build = { path = "../webrtc-sys/build", version = "0.3.5" }

[dev-dependencies]
livekit-api = { path = "../livekit-api", version = "0.4.1" }
Expand Down
36 changes: 25 additions & 11 deletions livekit-ffi/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,34 @@ fn main() {
return;
}

webrtc_sys_build::download_webrtc().unwrap();
if env::var("CARGO_CFG_TARGET_OS").unwrap() == "android" {
webrtc_sys_build::configure_jni_symbols().unwrap();
let webrtc_dir = webrtc_sys_build::webrtc_dir();
if !webrtc_dir.exists() {
webrtc_sys_build::download_webrtc().unwrap();
}

{
// Copy the webrtc license to CARGO_MANIFEST_DIR
// (used by the ffi release action)
let webrtc_dir = webrtc_sys_build::webrtc_dir();
let license = webrtc_dir.join("LICENSE.md");
let target_dir = env::var("CARGO_MANIFEST_DIR").unwrap();
let target_os = env::var("CARGO_CFG_TARGET_OS").unwrap();
match target_os.as_str() {
"windows" => {}
"linux" => {
// Link webrtc library
println!("cargo:rustc-link-lib=static=webrtc");
}
"android" => {
webrtc_sys_build::configure_jni_symbols().unwrap();
// Copy the webrtc license to CARGO_MANIFEST_DIR
// (used by the ffi release action)
let license = webrtc_dir.join("LICENSE.md");
let target_dir = env::var("CARGO_MANIFEST_DIR").unwrap();

let out_file = Path::new(&target_dir).join("WEBRTC_LICENSE.md");
let out_file = Path::new(&target_dir).join("WEBRTC_LICENSE.md");

std::fs::copy(license, out_file).unwrap();
std::fs::copy(license, out_file).unwrap();
}
"macos" => {
println!("cargo:rustc-link-arg=-ObjC");
}
_ => {
panic!("Unsupported target, {}", target_os);
}
}
}
Loading

0 comments on commit 9d68b19

Please sign in to comment.