Skip to content

zonyitoo/libsodium-ffi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

81 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

libsodium-ffi

Build Status Build status

Rust native binding to libsodium

# Cargo.toml
[dependencies]
libsodium-ffi = "0.2"

Usage

Environement variables

  • SODIUM_LIB_DIR=/path/to/libsodium for telling cargo where to find libsodium (Work with SODIUM_INCLUDE_DIR)

  • SODIUM_INCLUDE_DIR=/path/to/libsodium/include for telling bindgen where to find libsodium's headers (Work with SODIUM_LIB_DIR)

  • SODIUM_STATIC=yes for telling cargo to static-link libsodium

  • SODIUM_BUILD_STATIC=yes force build from source instead of trying to find libsodium in system-wide

Examples

## Specify paths by hand
# This is the path to the directory of `/usr/local/lib/libsodium.a`
export SODIUM_LIB_DIR=/usr/local/lib
# This is the path to the directory of `/usr/local/include/sodium.h`
export SODIUM_INCLUDE_DIR=/usr/local/include

## Uses system-wide libsodium
# Statically link system-wide libsodium
export SODIUM_STATIC=yes

## Build libsodium from source
export SODIUM_BUILD_STATIC=yes

Thanks

  • build.rs is partially borrowed from rust_sodium project.

About

libsodium native binding in Rust

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published