Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,20 @@ version = "12.9.0"
edition = "2021"
description = "Rust bindings for Icebug graph analytics"
license = "MIT"
repository = "https://github.com/Ladybug-Memory/icebug-rust"
homepage = "https://github.com/Ladybug-Memory/icebug"
documentation = "https://docs.rs/icebug"
keywords = ["graph", "analytics", "arrow", "bindings", "networkit"]
categories = ["api-bindings", "algorithms", "science"]
include = [
"/Cargo.toml",
"/README.md",
"/build.rs",
"/include",
"/scripts/download-icebug.sh",
"/src",
"/tests",
]
links = "networkit"

[dependencies]
Expand Down
11 changes: 10 additions & 1 deletion build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ fn main() {
let manifest_dir = PathBuf::from(env::var("CARGO_MANIFEST_DIR").unwrap());
let icebug_dir = env::var_os("ICEBUG_DIR")
.map(PathBuf::from)
.unwrap_or_else(|| manifest_dir.join("vendor"));
.unwrap_or_else(|| default_icebug_dir(&manifest_dir));

println!("cargo:rerun-if-env-changed=ICEBUG_DIR");
println!("cargo:rerun-if-env-changed=ICEBUG_VERSION");
Expand Down Expand Up @@ -100,6 +100,7 @@ fn ensure_icebug_vendor(manifest_dir: &PathBuf, icebug_dir: &PathBuf) {
let script = manifest_dir.join("scripts/download-icebug.sh");
let status = Command::new("bash")
.arg(script)
.env("ICEBUG_VENDOR_DIR", icebug_dir)
.current_dir(manifest_dir)
.status()
.expect("failed to run scripts/download-icebug.sh");
Expand All @@ -108,3 +109,11 @@ fn ensure_icebug_vendor(manifest_dir: &PathBuf, icebug_dir: &PathBuf) {
panic!("scripts/download-icebug.sh failed with status {status}");
}
}

fn default_icebug_dir(manifest_dir: &PathBuf) -> PathBuf {
if manifest_dir.join(".cargo_vcs_info.json").exists() {
PathBuf::from(env::var_os("OUT_DIR").unwrap()).join("icebug")
} else {
manifest_dir.join("vendor")
}
}
2 changes: 1 addition & 1 deletion scripts/download-icebug.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
set -euo pipefail

REPO="Ladybug-Memory/icebug"
VENDOR_DIR="$(cd "$(dirname "$0")/.." && pwd)/vendor"
VENDOR_DIR="${ICEBUG_VENDOR_DIR:-$(cd "$(dirname "$0")/.." && pwd)/vendor}"
DEFAULT_TAG="12.9"

if [[ "${1:-}" != "" ]]; then
Expand Down
Loading