-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
756 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[submodule "rust/ejdb-sys/ejdb-upstream"] | ||
path = rust/ejdb-sys/ejdb-upstream | ||
url = https://github.com/Softmotions/ejdb.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
[package] | ||
name = "ejdb" | ||
version = "0.4.1" | ||
authors = ["Vladimir Matveev <[email protected]>"] | ||
description = "Bindings for EJDB, and embedded JSON database" | ||
repository = "https://github.com/netvl/ejdb.rs" | ||
documentation = "https://netvl.github.io/ejdb.rs/" | ||
readme = "Readme.md" | ||
keywords = ["ejdb", "database", "json", "bson", "ffi"] | ||
license = "MIT" | ||
|
||
[badges] | ||
maintenance = { status = "looking-for-maintainer" } | ||
|
||
[exe] | ||
name = "ejdb" | ||
|
||
[dependencies] | ||
ejdb-sys = { path = "ejdb-sys", version = "0.3" } | ||
bson = "0.13" | ||
bitflags = "1.0" | ||
quick-error = "1.2" | ||
libc = "0.2" | ||
itertools = "0.8" | ||
|
||
[dev-dependencies] | ||
tempdir = "0.3" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
[package] | ||
name = "ejdb-sys" | ||
version = "0.3.0" | ||
authors = ["Vladimir Matveev <[email protected]>"] | ||
repository = "https://github.com/netvl/ejdb.rs" | ||
description = "Native bindings for libejdb" | ||
keywords = ["ejdb", "database", "ffi"] | ||
license = "MIT" | ||
links = "ejdb" | ||
build = "build.rs" | ||
|
||
[build-dependencies] | ||
pkg-config = "0.3" | ||
cmake = "0.1" | ||
bindgen = "0.59" | ||
|
||
[dependencies] | ||
libc = "0.2" | ||
|
||
[lib] | ||
doctest = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
extern crate bindgen; | ||
extern crate cmake; | ||
extern crate pkg_config; | ||
|
||
use cmake::Config; | ||
use std::env; | ||
use std::path::PathBuf; | ||
use std::process::Command; | ||
|
||
fn main() { | ||
pkg_config::Config::new().probe("zlib").unwrap(); | ||
|
||
let dst = Config::new("ejdb-upstream") | ||
.cflag("-w") | ||
.profile("Debug") | ||
.define("BUILD_SAMPLES", "OFF") | ||
.define("BUILD_SHARED_LIBS", "OFF") | ||
.build(); | ||
|
||
Command::new("make").status().expect("failed to make!"); | ||
|
||
println!( | ||
"cargo:rustc-link-search=native={}", | ||
dst.join("lib").display() | ||
); | ||
println!( | ||
"cargo:rustc-link-search=native={}", | ||
dst.join("lib64").display() | ||
); | ||
println!("cargo:rustc-link-lib=static=ejdb2-2"); | ||
println!("cargo:rustc-link-lib=static=facilio-1"); | ||
println!("cargo:rustc-link-lib=static=iowow-1"); | ||
|
||
println!("cargo:include={}",dst.join("include/ejdb2").display()); | ||
println!("debug={}",format!("-I{}", dst.join("include").as_path().to_str().unwrap())); | ||
|
||
let bindings = bindgen::Builder::default() | ||
.header(dst.join("include/ejdb2/ejdb2.h").as_path().to_str().unwrap()) | ||
// Hide duplicated types | ||
.clang_arg( format!("-I{}", dst.join("include").as_path().to_str().unwrap()) ) | ||
.blacklist_item("FP_NAN") | ||
.blacklist_item("FP_INFINITE") | ||
.blacklist_item("FP_ZERO") | ||
.blacklist_item("FP_SUBNORMAL") | ||
.blacklist_item("FP_NORMAL") | ||
.generate() | ||
// Unwrap the Result and panic on failure. | ||
.expect("Unable to generate bindings"); | ||
|
||
// Write the bindings to the $OUT_DIR/bindings.rs file. | ||
let out_path = PathBuf::from(env::var("OUT_DIR").unwrap()); | ||
bindings | ||
.write_to_file(out_path.join("bindings.rs")) | ||
.expect("Couldn't write bindings!"); | ||
} |
Submodule ejdb-upstream
added at
171233
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#![allow(non_upper_case_globals)] | ||
#![allow(non_camel_case_types)] | ||
#![allow(non_snake_case)] | ||
|
||
include!(concat!(env!("OUT_DIR"), "/bindings.rs")); |
Oops, something went wrong.