Add nix files

This commit is contained in:
2026-03-11 10:39:00 -07:00
parent c03fac0e37
commit b36b62150c
4 changed files with 101 additions and 0 deletions

View File

@@ -23,6 +23,13 @@ fn main() {
.expect("unexpected OUT_DIR structure")
.to_path_buf();
// If PDFIUM_LIB_DIR is set (e.g. by Nix), use the pre-installed library directly.
if let Ok(lib_dir) = env::var("PDFIUM_LIB_DIR") {
println!("cargo:rustc-link-search=native={lib_dir}");
println!("cargo:rustc-link-lib=dylib=pdfium");
return;
}
let lib_path = profile_dir.join("libpdfium.so");
if !lib_path.exists() {