x
Some checks failed
CI / Typos (push) Successful in 28s
CI / Build and test (push) Has been cancelled
CI / Clippy (push) Has been cancelled
CI / Build and test (all features) (push) Has been cancelled

This commit is contained in:
2026-03-11 12:20:50 -07:00
parent c17596e1d4
commit 179effc32c
2 changed files with 9 additions and 0 deletions

View File

@@ -23,6 +23,13 @@ fn main() {
.expect("unexpected OUT_DIR structure") .expect("unexpected OUT_DIR structure")
.to_path_buf(); .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"); let lib_path = profile_dir.join("libpdfium.so");
if !lib_path.exists() { if !lib_path.exists() {

View File

@@ -24,6 +24,8 @@ pileRustPlatform.buildRustPackage {
cargoLock.lockFile = ./Cargo.lock; cargoLock.lockFile = ./Cargo.lock;
PDFIUM_LIB_DIR = "${pkgs.pdfium-binaries}/lib";
buildInputs = [ buildInputs = [
pkgs.pdfium-binaries pkgs.pdfium-binaries
pkgs.openssl pkgs.openssl