Skip to main content

Module setup_native

Module setup_native 

Source
Expand description

cargo xtask setup-native — build MuPDF and the C wrapper for native dev.

  1. Downloads MuPDF sources if the required version is not already present.
  2. Builds the mupdf_wrapper C library.
  3. Compiles MuPDF using system libraries.
  4. Creates symlinks in target/mupdf_wrapper/<platform>/ so the Rust build script can find the static libraries.

§Required MuPDF version

The version is pinned to thirdparty::MUPDF_VERSION. If the sources already present on disk match this version the download is skipped.

Structs§

SetupNativeArgs
Arguments for cargo xtask setup-native.

Constants§

NATIVE_BUILT_MARKER 🔒
Marker file written after a successful native MuPDF build.

Functions§

apply_mupdf_webp_patches_if_needed 🔒
build_libwebp_native
Builds libwebp from source for native development.
build_mupdf_native 🔒
Compiles MuPDF using system libraries for the native platform.
build_mupdf_wrapper_native_if_needed 🔒
Builds the mupdf_wrapper C static library for the native platform.
collect_system_cflags 🔒
Collects system library CFLAGS via pkg-config on macOS.
combine_libwebp_static_archives 🔒
Extracts sub-archives from a static libwebp build and repacks them into a single src/.libs/libwebp.a.
ensure_mupdf_sources
Ensures MuPDF sources at the required version are present in thirdparty/mupdf/ and that Cadmus’ WebP patch series is applied.
ensure_mupdf_sources_with_webp_patches 🔒
ensure_native_artifacts
link_mupdf_artifacts 🔒
Creates symlinks in target/mupdf_wrapper/<platform>/ pointing to the compiled MuPDF static libraries.
native_mupdf_ready 🔒
Returns true when native MuPDF libraries are present and marked as built.
native_setup_done
Returns true when the full native setup is complete.
read_mupdf_version 🔒
Reads the MuPDF version string from the version header file.
remove_native_build_marker 🔒
remove_native_wrapper_artifact 🔒
run
Builds MuPDF and the C wrapper for native (non-cross-compiled) development.
symlink_force 🔒
Creates a symlink at link pointing to target, removing any existing file or symlink at link first.
write_native_build_marker 🔒
Writes the native build marker in the MuPDF source directory.