From 3db301f899899c4e404fc2eaa7503d5f274464f2 Mon Sep 17 00:00:00 2001 From: Fabricio Silva Date: Tue, 28 Apr 2026 20:22:22 +0000 Subject: [PATCH] Fix build emulator for MacOS --- service.sh | 6 ++++++ crates/emulator/build.rs | 14 ++++++++++++++ 2 file(s) changed, 20 insertion(s)(+), 0 deletion(s)(-) diff --git a/service.sh b/service.sh --- a/service.sh +++ b/service.sh @@ -14,6 +14,12 @@ WRAPPER_PATH=mupdf_wrapper TARGET_OS=$(uname -s) +if ! [ -e "thirdparty/mupdf/build/release/libmupdf.a" ]; then + cd thirdparty/mupdf || exit 1 + make libs + cd - +fi + if ! [ -e "${WRAPPER_PATH}/${TARGET_OS}" ]; then cd "$WRAPPER_PATH" || exit 1 ./build.sh diff --git a/crates/emulator/build.rs b/crates/emulator/build.rs new file mode 100644 --- /dev/null +++ b/crates/emulator/build.rs @@ -0,0 +1,14 @@ +use std::path::Path; + +fn main() { + if std::env::consts::OS == "macos" { + println!("cargo:rustc-link-search=/opt/homebrew/lib"); + + let manifest_dir = std::env::var("CARGO_MANIFEST_DIR").unwrap(); + let mupdf_path = Path::new(&manifest_dir) + .join("../../thirdparty/mupdf/build/release") + .canonicalize() + .unwrap(); + println!("cargo:rustc-link-search={}", mupdf_path.display()); + } +} -- tangled.sh