-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use compile time detection of what features are available
Previously features were gated on the botan3 feature (which is removed here). This didn't work well in practice as it made it difficult to add support for features added in Botan3 after the 3.0 release. Add declarations in botan-sys for functions added to ffi.h since 3.0.0, gated on the detected library version. Also add interfaces for some of the new functionality to the high level Rust crate.
- Loading branch information
Showing
34 changed files
with
707 additions
and
237 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[package] | ||
name = "botan-src" | ||
version = "0.30701.1" | ||
version = "0.30701.2" | ||
authors = ["Rodolphe Breard <[email protected]>", "Jack Lloyd <[email protected]>"] | ||
description = "Sources of Botan cryptography library" | ||
license = "MIT" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
fn main() { | ||
let (lib_dir, include_dir) = botan_src::build(); | ||
println!("Library directory: {lib_dir}"); | ||
println!("Include directory: {include_dir}"); | ||
println!("Include directory: {}", include_dir.display()); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
[package] | ||
name = "botan-sys" | ||
version = "0.11.1" | ||
version = "0.12.0" | ||
authors = ["Jack Lloyd <[email protected]>"] | ||
links = "botan-3" | ||
build = "build.rs" | ||
links = "botan" | ||
build = "build/main.rs" | ||
description = "FFI wrapper for Botan cryptography library" | ||
license = "MIT" | ||
homepage = "https://botan.randombit.net/" | ||
|
@@ -16,11 +16,11 @@ rust-version = "1.64" | |
|
||
[features] | ||
default = [] | ||
vendored = ["botan-src", "botan3"] | ||
botan3 = [] | ||
vendored = ["botan-src"] | ||
static = [] | ||
pkg-config = ["dep:pkg-config"] | ||
|
||
[build-dependencies] | ||
botan-src = { version = "0.30701.1", optional = true, path = "../botan-src" } | ||
botan-src = { version = "0.30701.2", optional = true, path = "../botan-src" } | ||
pkg-config = { version = "0.3.30", optional = true } | ||
cc = "1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,24 @@ | ||
# botan-sys | ||
|
||
This crate contains the FFI declarations for calling the C API included in the | ||
[Botan](https://botan.randombit.net/) cryptography library. | ||
[Botan](https://botan.randombit.net/) cryptography library as well as the rules | ||
for linking to it. | ||
|
||
A high level Rust interface built on these declarations is included in the | ||
[botan](https://crates.io/crates/botan) crate. | ||
|
||
## Features | ||
|
||
* `vendored`: Build against the `botan-src` crate | ||
* `static`: Statically link the library. This is always used if `vendored` is set | ||
* `pkg-config`: Use `pkg-config` instead of probing to find the library | ||
|
||
## Environment Variables | ||
|
||
The following environment variables are used to guide features | ||
|
||
* `BOTAN_INCLUDE_DIR` the base path to where the relevant library includes are | ||
found. For example if the headers are in `/opt/foo/botan-3/botan`, this | ||
variable should be set to `/opt/foo`. If not set, tries a few common | ||
locations. This variable is ignored if the `pkg-config` or `vendored` | ||
features are used. |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.