From 1bcc16c327c41d1ac6f4811951cdac2da483104f Mon Sep 17 00:00:00 2001 From: Igor Katson Date: Thu, 30 Sep 2021 09:00:40 +0100 Subject: [PATCH] Another attempt to make it possible to build without openssl. You'll need to cd into crates/rqbit to build with selective features. --- crates/bencode/Cargo.toml | 8 +++++++- crates/dht/Cargo.toml | 2 +- crates/librqbit/Cargo.toml | 4 ++-- crates/librqbit_core/Cargo.toml | 2 +- crates/peer_binary_protocol/Cargo.toml | 2 +- crates/rqbit/Cargo.toml | 8 ++++---- 6 files changed, 16 insertions(+), 10 deletions(-) diff --git a/crates/bencode/Cargo.toml b/crates/bencode/Cargo.toml index 2f8504f..d4b48b4 100644 --- a/crates/bencode/Cargo.toml +++ b/crates/bencode/Cargo.toml @@ -5,9 +5,15 @@ edition = "2018" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +[features] +default = ["sha1-openssl"] +sha1-system = ["sha1w/sha1-system"] +sha1-openssl = ["sha1w/sha1-openssl"] +sha1-rust = ["sha1w/sha1-openssl"] + [dependencies] serde = {version = "1", features=["derive"]} buffers = {path = "../buffers"} clone_to_owned = {path = "../clone_to_owned"} anyhow = "1" -sha1w = {path="../sha1w"} \ No newline at end of file +sha1w = {path="../sha1w", default-features=false} \ No newline at end of file diff --git a/crates/dht/Cargo.toml b/crates/dht/Cargo.toml index 54cd8a4..d7d85f3 100644 --- a/crates/dht/Cargo.toml +++ b/crates/dht/Cargo.toml @@ -11,7 +11,7 @@ tokio-stream = {version = "0.1", features = ["sync"]} serde = {version = "1", features = ["derive"]} serde_json = "1" hex = "0.4" -bencode = {path = "../bencode"} +bencode = {path = "../bencode", default-features=false} anyhow = "1" parking_lot = "0.11" log = "0.4" diff --git a/crates/librqbit/Cargo.toml b/crates/librqbit/Cargo.toml index 8150d6b..b9aa94e 100644 --- a/crates/librqbit/Cargo.toml +++ b/crates/librqbit/Cargo.toml @@ -13,12 +13,12 @@ sha1-rust = ["sha1w/sha1-openssl"] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -bencode = {path = "../bencode"} +bencode = {path = "../bencode", default-features=false} buffers = {path = "../buffers"} librqbit_core = {path = "../librqbit_core"} clone_to_owned = {path = "../clone_to_owned"} peer_binary_protocol = {path = "../peer_binary_protocol"} -sha1w = {path = "../sha1w"} +sha1w = {path = "../sha1w", default-features=false} dht = {path = "../dht"} tokio = {version = "1", features = ["macros", "rt-multi-thread"]} diff --git a/crates/librqbit_core/Cargo.toml b/crates/librqbit_core/Cargo.toml index e0c25b5..5e88757 100644 --- a/crates/librqbit_core/Cargo.toml +++ b/crates/librqbit_core/Cargo.toml @@ -14,5 +14,5 @@ log = "0.4" parking_lot = "0.11" serde = {version = "1", features=["derive"]} buffers = {path="../buffers"} -bencode = {path="../bencode"} +bencode = {path = "../bencode", default-features=false} clone_to_owned = {path="../clone_to_owned"} \ No newline at end of file diff --git a/crates/peer_binary_protocol/Cargo.toml b/crates/peer_binary_protocol/Cargo.toml index 8094ca1..c806427 100644 --- a/crates/peer_binary_protocol/Cargo.toml +++ b/crates/peer_binary_protocol/Cargo.toml @@ -10,7 +10,7 @@ serde = {version = "1", features = ["derive"]} bincode = "1" byteorder = "1" buffers = {path="../buffers"} -bencode = {path="../bencode"} +bencode = {path = "../bencode", default-features=false} clone_to_owned = {path="../clone_to_owned"} librqbit_core = {path="../librqbit_core"} bitvec = "0.22" diff --git a/crates/rqbit/Cargo.toml b/crates/rqbit/Cargo.toml index 48f601f..c1ce23d 100644 --- a/crates/rqbit/Cargo.toml +++ b/crates/rqbit/Cargo.toml @@ -7,12 +7,12 @@ edition = "2018" [features] default = ["sha1-openssl"] -sha1-system = ["librqbit/crypto-hash"] -sha1-openssl = ["librqbit/openssl"] -sha1-rust = ["librqbit/sha1"] +sha1-system = ["librqbit/sha1-system"] +sha1-openssl = ["librqbit/sha1-openssl"] +sha1-rust = ["librqbit/sha1-rust"] [dependencies] -librqbit = {path="../librqbit"} +librqbit = {path="../librqbit", default-features=false} dht = {path="../dht"} tokio = {version = "1", features = ["macros", "rt-multi-thread"]} anyhow = "1"