From a84b22a6d5975e2c27dce7474f7b286c4023b7eb Mon Sep 17 00:00:00 2001 From: Fabricio Silva Date: Tue, 28 Apr 2026 21:22:22 +0100 Subject: [PATCH] Fix build emulator for MacOS --- crates/emulator/build.rs | 14 ++++++++++++++ service.sh | 6 ++++++ 2 files changed, 20 insertions(+) create mode 100644 crates/emulator/build.rs diff --git a/crates/emulator/build.rs b/crates/emulator/build.rs new file mode 100644 index 0000000..511bc11 --- /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()); + } +} diff --git a/service.sh b/service.sh index 2745203..7c84dc8 100755 --- a/service.sh +++ b/service.sh @@ -14,6 +14,12 @@ fi 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 -- 2.51.2