diff --git a/Cargo.toml b/Cargo.toml index 5ea8246..a0d688c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,7 +4,7 @@ exclude = ["examples/full_usage"] [package] name = "whisper-rs" -version = "0.13.1" +version = "0.13.2" edition = "2021" description = "Rust bindings for whisper.cpp" license = "Unlicense" diff --git a/build.rs b/build.rs index c550526..632c849 100644 --- a/build.rs +++ b/build.rs @@ -1,8 +1,17 @@ use std::env; 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!( "cargo:rustc-env=WHISPER_CPP_VERSION={}", - env::var("DEP_WHISPER_WHISPER_CPP_VERSION").unwrap() + whisper_cpp_version ); }