Skip to content

Commit 49b40c9

Browse files
committed
feat: removed support for RDFox 6.* and added support for 7.2
1 parent 5badfe5 commit 49b40c9

File tree

3 files changed

+33
-46
lines changed

3 files changed

+33
-46
lines changed

.rustfmt.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ remove_nested_parens = true
4242
reorder_impl_items = true
4343
reorder_imports = true
4444
reorder_modules = true
45-
required_version = "1.7.0"
45+
required_version = "1.8.0"
4646
space_after_colon = true
4747
space_before_colon = false
4848
spaces_around_ranges = false
@@ -58,6 +58,6 @@ unstable_features = true
5858
use_field_init_shorthand = true
5959
use_small_heuristics = "Default"
6060
use_try_shorthand = true
61-
version = "Two"
61+
style_edition = "2021"
6262
where_single_line = true
6363
wrap_comments = true

Cargo.toml

+7-10
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ version = "0.0.3"
55
edition = "2021"
66
links = "RDFox-static"
77
authors = [
8-
"Jacobus Geluk <[email protected]>",
8+
"Jacobus Geluk <[email protected]>",
99
]
1010
repository = "https://github.com/EKGF/rdfox-sys"
1111
keywords = ["rdf", "sparql", "database", "graph-database", "datalog"]
@@ -28,24 +28,21 @@ thiserror = "1.0.56"
2828
[build-dependencies]
2929
curl = "0.4.44"
3030
lazy_static = "1.4.0"
31-
zip = "0.6.2"
32-
bindgen = "0.69.2"
31+
zip = "2.2.0"
32+
bindgen = "0.70.1"
3333

3434
[package.metadata.docs.rs]
3535
rustc-args = ["--cfg", "docsrs"]
3636

3737
[features]
38-
default = ["rdfox-7-0a", "rdfox-dylib"]
38+
default = ["rdfox-7-2", "rdfox-dylib"]
3939
#
4040
# Switch on if you want to link to `libRDFox.dylib` rather than `libRDFox.a`
4141
#
4242
rdfox-dylib = []
43+
rdfox-static = []
4344
#
44-
# Select a version
45+
# Select one version
4546
#
46-
rdfox-6-2 = []
47-
rdfox-6-3a = []
48-
rdfox-6-3b = []
4947
rdfox-7-0a = []
50-
51-
48+
rdfox-7-2 = []

build.rs

+24-34
Original file line numberDiff line numberDiff line change
@@ -126,33 +126,22 @@ lazy_static! {
126126
static ref RDFOX_DOWNLOAD_HOST: &'static str = option_env!("RDFOX_DOWNLOAD_HOST")
127127
.unwrap_or("https://rdfox-distribution.s3.eu-west-2.amazonaws.com/release");
128128
}
129-
#[cfg(feature = "rdfox-6-2")]
130-
lazy_static! {
131-
static ref RDFOX_VERSION_EXPECTED: &'static str =
132-
option_env!("RDFOX_VERSION_EXPECTED").unwrap_or("6.2");
133-
}
134-
#[cfg(feature = "rdfox-6-3a")]
135-
lazy_static! {
136-
static ref RDFOX_VERSION_EXPECTED: &'static str =
137-
option_env!("RDFOX_VERSION_EXPECTED").unwrap_or("6.3a");
138-
}
139-
#[cfg(feature = "rdfox-6-3b")]
140-
lazy_static! {
141-
static ref RDFOX_VERSION_EXPECTED: &'static str =
142-
option_env!("RDFOX_VERSION_EXPECTED").unwrap_or("6.3b");
143-
}
144-
#[cfg(feature = "rdfox-7-0a")]
129+
130+
#[cfg(not(any(feature = "rdfox-7-0a", feature = "rdfox-7-2",)))]
131+
compile_error!("You have to at least specify one of the rdfox-X-Y version number features");
132+
145133
lazy_static! {
146-
static ref RDFOX_VERSION_EXPECTED: &'static str =
147-
option_env!("RDFOX_VERSION_EXPECTED").unwrap_or("7.0a");
134+
static ref RDFOX_VERSION_EXPECTED: &'static str = option_env!("RDFOX_VERSION_EXPECTED")
135+
.unwrap_or(
136+
if cfg!(feature = "rdfox-7-0a") {
137+
"7.0a"
138+
} else if cfg!(feature = "rdfox-7-2") {
139+
"7.2"
140+
} else {
141+
panic!("Unknown RDFOX version")
142+
}
143+
);
148144
}
149-
#[cfg(not(any(
150-
feature = "rdfox-6-2",
151-
feature = "rdfox-6-3a",
152-
feature = "rdfox-6-3b",
153-
feature = "rdfox-7-0a"
154-
)))]
155-
compile_error!("You have to at least specify one of the rdfox-X-Y version number features");
156145

157146
fn rdfox_download_url() -> String {
158147
let host = *RDFOX_DOWNLOAD_HOST;
@@ -309,9 +298,9 @@ fn set_clang_path<S: Into<String>>(path: Option<S>) -> Option<(PathBuf, PathBuf)
309298
if !clang_bin.exists() {
310299
clang_bin = path.join("clang");
311300
}
312-
if clang_bin.exists() {
313-
println!("cargo:warning=using {}", clang_bin.display());
314-
}
301+
// if clang_bin.exists() {
302+
// println!("cargo:warning=using {}", clang_bin.display());
303+
// }
315304
Some((path, clang_bin))
316305
}
317306

@@ -330,12 +319,12 @@ fn set_llvm_config_path<S: Into<String>>(path: Option<S>) -> Option<(PathBuf, Pa
330319
if !llvm_config_bin.exists() {
331320
llvm_config_bin = path.join("llvm-config");
332321
}
333-
if llvm_config_bin.exists() {
334-
println!(
335-
"cargo:warning=using {}",
336-
llvm_config_bin.display()
337-
);
338-
}
322+
// if llvm_config_bin.exists() {
323+
// println!(
324+
// "cargo:warning=using {}",
325+
// llvm_config_bin.display()
326+
// );
327+
// }
339328
Some((path, llvm_config_bin))
340329
}
341330

@@ -400,6 +389,7 @@ fn check_homebrew_prefix() -> Option<PathBuf> {
400389
if let Ok(output) = Command::new("brew").args(["--prefix"]).output() {
401390
let homebrew_prefix =
402391
String::from_utf8(output.stdout).expect("`brew --prefix` output must be UTF-8");
392+
#[allow(irrefutable_let_patterns)]
403393
if let Ok(path) = PathBuf::try_from(homebrew_prefix) {
404394
return Some(path);
405395
}

0 commit comments

Comments
 (0)