51 lines
2.3 KiB
TOML
51 lines
2.3 KiB
TOML
[package]
|
|
name = "nigig-ocr"
|
|
version = "0.1.0"
|
|
edition = "2021"
|
|
license = "MIT OR Apache-2.0"
|
|
description = "Rust + Makepad port of OCR Tool PRO 1.0 (Moneyplant) — tiny binary via OS-native OCR APIs."
|
|
|
|
# Reuse-first feature layout (see EXECUTION_PLAN.md):
|
|
# - `engine`: pure-Rust types + OcrEngine seam. Reuses nigig-pdf-document::ocr
|
|
# (OcrWord/OcrLayer) and nigig_doc_scanner::scanner_core (preprocess).
|
|
# No UI, no model download — keeps binary small.
|
|
# - `app`: Makepad UI shell (DropView, Image+Overlay, TextView, toolbar).
|
|
# - `default = ["engine", "app"]`: building/running the app itself.
|
|
# - `system-ocr`: allow OS-native providers (Vision on Apple, WinRT on
|
|
# Windows). Off by default so `cargo check` stays host-free; enable per-target.
|
|
[features]
|
|
default = ["engine", "app"]
|
|
engine = []
|
|
# Only what the shell actually uses. nigig-core/uikit/pdf-document were
|
|
# declared but never referenced (OCR-T1 audit) and dragged a network stack
|
|
# into an "offline, tiny" binary. Re-add each when code really uses it.
|
|
app = ["dep:makepad-widgets"]
|
|
# OS-native providers. Must enable the optional bindings, otherwise the
|
|
# Apple provider can never link (OCR-T1 fix).
|
|
system-ocr = ["dep:objc2", "dep:objc2-foundation"]
|
|
|
|
[[bin]]
|
|
name = "nigig-ocr"
|
|
path = "src/main.rs"
|
|
required-features = ["app"]
|
|
|
|
# Headless engine demo (P9): drop→OCR→overlay→export without a display
|
|
# server. Builds on `engine` only so desktop flow runs anywhere.
|
|
[[bin]]
|
|
name = "nigig-ocr-demo"
|
|
path = "src/bin/nigig-ocr-demo.rs"
|
|
|
|
[dependencies]
|
|
makepad-widgets = { workspace = true, optional = true }
|
|
image = { version = "0.25", default-features = false, features = ["png", "jpeg"] }
|
|
|
|
# Apple Vision binding — macOS/iOS only, dynamic system framework (no size cost,
|
|
# same reason the Swift original is 1.1M). Kept behind `system-ocr` + target cfg.
|
|
[target.'cfg(target_vendor = "apple")'.dependencies]
|
|
objc2 = { version = "0.6.1", optional = true }
|
|
objc2-foundation = { version = "0.3.1", default-features = false, features = ["std", "NSString", "NSArray", "NSData", "NSDictionary", "NSEnumerator"], optional = true }
|
|
|
|
# NOTE: no `makepad-test` dev-dep while the pinned fork's `makepad-test`
|
|
# checkout fails to compile (pre-existing, unrelated). UI coverage runs via
|
|
# the headless `UiState` mirror (`src/ui_state.rs`, `tests/parity.rs`,
|
|
# `tests/makepad_ui_plan.rs`); re-add when the fork is healthy.
|