leptonica-sys

Crates.ioleptonica-sys
lib.rsleptonica-sys
version0.4.9
sourcesrc
created_at2019-06-29 17:39:23.533823
updated_at2024-11-26 08:52:42.028686
descriptionFFI bindings for Leptonica
homepage
repositoryhttps://github.com/ccouzens/leptonica-sys
max_upload_size
id144565
size23,018
Chris Couzens (ccouzens)

documentation

README

leptonica-sys

Rust FFI bindings to Leptonica.

Types and functions generated from the functions listed in allheaders.h.

Help wanted

Windows and Mac maintainers wanted.

Building

This links to the C library Leptonica.

On Fedora 30 the build dependencies can be installed by running:

sudo dnf install leptonica-devel clang

On Termux 2019 (Android, Android on Chromebooks) the additional dependencies can be installed by running:

pkg install libclang leptonica-dev

Building on Windows

On Windows, this library uses Microsoft's vcpkg to provide leptonica.

Please install vcpkg and set up user wide integration or vcpkg crate won't be able to find the library. By default vcpkg installs 32 bit libraries. If you need 64 bit libraries then set following environment variable

SET VCPKG_DEFAULT_TRIPLET=x64-windows

To install leptonica

REM from the vcpkg directory
.\vcpkg install leptonica

vcpkg allows building either dynamically or statically linked application

if you prefer dynamic linking

SET VCPKGRS_DYNAMIC=true

for statically linked libraries

SET RUSTFLAGS=-Ctarget-feature=+crt-static

If you prefer to compile tesseract yourself (Because, for example, you could not get vcpkg to build using clang-cl.exe), you can set these environment variables: LEPTONICA_INCLUDE_PATH, LEPTONICA_LINK_PATHS and LEPTONICA_LINK_LIBS.

For example:

set LEPTONICA_INCLUDE_PATH=D:\leptonica\build\include
set LEPTONICA_LINK_PATHS=D:\leptonica\build\lib
set LEPTONICA_LINK_LIBS=leptonica-1.83.0
Commit count: 47

cargo fmt