diff --git a/build.rs b/build.rs index 3a2c092..13c3ab9 100644 --- a/build.rs +++ b/build.rs @@ -29,6 +29,22 @@ impl PkgConfigTemplate { ("DESCRIPTION".to_string(), env!("CARGO_PKG_DESCRIPTION").to_string()), ("VERSION".to_string(), env!("CARGO_PKG_VERSION").to_string()), ("HOMEPAGE".to_string(), env!("CARGO_PKG_HOMEPAGE").to_string()), + ("REQUIRES".to_string(), + if cfg!(feature = "crypto-botan") { + "botan-2" + } else if cfg!(feature = "crypto-nettle") { + "nettle" + } else if cfg!(feature = "crypto-openssl") { + "libssl" + } else if cfg!(feature = "crypto-cng") { + "" + } else if cfg!(feature = "crypto-rust") { + "" + } else { + panic!("No cryptographic backend selected. Try: \ + \"cargo build --no-default-features \ + --features crypto-openssl\"") + }.to_string()), ]); Ok(PkgConfigTemplate { diff --git a/rpm-sequoia.pc.in b/rpm-sequoia.pc.in index 64f7b93..28fe3dd 100644 --- a/rpm-sequoia.pc.in +++ b/rpm-sequoia.pc.in @@ -5,6 +5,6 @@ Name: @NAME@ Description: @DESCRIPTION@ URL: @HOMEPAGE@ Version: @VERSION@ -Requires.private: nettle +Requires.private: @REQUIRES@ Cflags: Libs: -L${libdir} -lrpm_sequoia