Try fixing docs.rs build (again)
This commit is contained in:
parent
71ab110e04
commit
5154c9edcb
2 changed files with 11 additions and 2 deletions
|
|
@ -4,7 +4,7 @@ exclude = ["examples/full_usage"]
|
||||||
|
|
||||||
[package]
|
[package]
|
||||||
name = "whisper-rs"
|
name = "whisper-rs"
|
||||||
version = "0.13.1"
|
version = "0.13.2"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
description = "Rust bindings for whisper.cpp"
|
description = "Rust bindings for whisper.cpp"
|
||||||
license = "Unlicense"
|
license = "Unlicense"
|
||||||
|
|
|
||||||
11
build.rs
11
build.rs
|
|
@ -1,8 +1,17 @@
|
||||||
use std::env;
|
use std::env;
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
let whisper_cpp_version = env::var("DEP_WHISPER_WHISPER_CPP_VERSION").unwrap_or_else(|e| {
|
||||||
|
if env::var("DOCS_RS").is_ok() {
|
||||||
|
// not sure why but this fails on docs.rs
|
||||||
|
// return a default string
|
||||||
|
"0.0.0-fake".to_string()
|
||||||
|
} else {
|
||||||
|
panic!("Failed to find upstream whisper.cpp version: your build environment is messed up. {}", e);
|
||||||
|
}
|
||||||
|
});
|
||||||
println!(
|
println!(
|
||||||
"cargo:rustc-env=WHISPER_CPP_VERSION={}",
|
"cargo:rustc-env=WHISPER_CPP_VERSION={}",
|
||||||
env::var("DEP_WHISPER_WHISPER_CPP_VERSION").unwrap()
|
whisper_cpp_version
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue