12 releases
0.3.4 | Oct 4, 2024 |
---|---|
0.3.3+1.19.2 | May 13, 2024 |
0.3.2+1.19.2 | Jan 16, 2022 |
0.3.1+1.19.2 | Dec 23, 2021 |
0.2.4+1.18.2 | Jul 8, 2020 |
#603 in Database interfaces
32,145 downloads per month
Used in 9 crates
(via sasl2-sys)
13MB
288K
SLoC
Contains (autotools obfuscated code, 520KB) krb5/src/configure, (obscure autoconf code, 50KB) krb5/src/configure.ac
rust-krb5-src
Rust build system integration for libkrb5, MIT's Kerberos implementation.
Installation
# Cargo.toml
[dependencies]
krb5-src = "0.3.4"
lib.rs
:
Build system integration for libkrb5, MIT's Kerberos implementation.
This crate builds a vendored copy of libkrb5 using Cargo's support for custom build scripts. It is not intended for direct consumption, but as a dependency for other crates that need libkrb5 available, like sasl2-sys.
krb5-src is currently bundling libkrb5 v1.19.2.
To use this crate, declare a dependency
or dev-dependency
on krb5-src
.
Then, in the build script for your crate, the environment variable
DEP_KRB5_SRC_ROOT
will point to the directory in which the bundled copy of
libkrb5 has been installed. You can build and link another C library against
this copy of libkrb5, or generate Rust bindings and link Rust code against
this copy of libkrb5.
Note that you are responsible for instructing Cargo to link in the components of libkrb5 that you depend upon. Here is an example build script fragment.
println!(
"cargo:rustc-link-search=native={}",
PathBuf::from(env::var("DEP_KRB5_SRC_ROOT").unwrap()).join("lib").display(),
);
println!("cargo:rustc-link-lib=static=gssapi_krb5");
println!("cargo:rustc-link-lib=static=krb5");
println!("cargo:rustc-link-lib=static=k5crypto");
println!("cargo:rustc-link-lib=static=com_err");
println!("cargo:rustc-link-lib=static=krb5support");
Cargo features
krb5-src can be configured with the following Cargo features:
-
binaries
builds the binaries that come with libkrb5 (kinit, kdestroy, et al.) and installs them intoDEP_KRB5_SRC_ROOT/bin
. -
nls
enables native language support (i.e., localization). This feature corresponds to the--enable-nls
configure flag.On some platforms, when this feature is enabled, the application must additionally link against libintl.
-
openssl-vendored
enables thevendored
feature of theopenssl-sys
crate.
Note that none of these features have any effect when compiling on Windows.
Platform support
krb5-src is tested on recent versions of Ubuntu, macOS, and Windows. Patches that improve support for other platforms are welcome.