diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index ef9b39b..0000000 --- a/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "sys/meos-src/source"] - path = sys/meos-src/source - url = https://github.com/MobilityDB/MobilityDB.git diff --git a/Cargo.toml b/Cargo.toml index 4a50dad..d09a79e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,7 +13,7 @@ edition = "2021" [dependencies] paste = "1.0.15" -meos-sys = { path = "sys", version = "0.1.5", features=["bundled_proj"] } +meos-sys = { path = "sys", version = "0.1.5" } chrono = "0.4.38" libc = "0.2.155" bitmask-enum = "2.2.4" @@ -21,7 +21,6 @@ geos = { version = "9.0.0", optional = true } [features] default = ["geos"] -geos = ["dep:geos"] [dev-dependencies] csv = "1.3.0" diff --git a/sys/Cargo.toml b/sys/Cargo.toml index f7fe5d6..7544f26 100644 --- a/sys/Cargo.toml +++ b/sys/Cargo.toml @@ -14,17 +14,16 @@ edition = "2021" links = "meos" [dependencies] -meos-src = { path = "./meos-src", version = "0.1.3", optional = true } [build-dependencies] pkg-config = "0.3.30" cmake = "0.1" -bindgen = { version = "0.70.1", optional = true} +bindgen = { version = "0.70.1", optional = true } [features] default = ["v1_2"] v1_1 = [] v1_2 = [] -buildtime_bindgen = ["dep:bindgen", "meos-src"] +buildtime_bindgen = ["dep:bindgen"] bundled_proj = ["buildtime_bindgen"] \ No newline at end of file diff --git a/sys/README.md b/sys/README.md index b0c3112..0bb0c60 100644 --- a/sys/README.md +++ b/sys/README.md @@ -35,10 +35,6 @@ DYLD_FALLBACK_LIBRARY_PATH=/lib MEOS_LIB_DIR=/lib ME ``` ---- - -You can also enable the `bundled_proj` feature to build MEOS from scratch, (note that you will need to already have installed `json-c`, `proj`, and `geos` in your system, see [here](https://github.com/MobilityDB/MobilityDB/?tab=readme-ov-file#requirements)). - ## Binding generation By default, meos-sys will use the pregenerated bindings for the 1.2 version, the 1.1 ones is also available. Alternatively, you can generate your own bindings from your `libmeos` installation by specifying the `bindgen` feature. diff --git a/sys/build.rs b/sys/build.rs index 530d5af..f74f4c9 100644 --- a/sys/build.rs +++ b/sys/build.rs @@ -16,39 +16,26 @@ fn main() { println!("cargo:rerun-if-changed=build.rs"); println!("cargo:rerun-if-env-changed=MEOS_LIB_DIR"); - // If `bundled_proj` is on, use the git submodule to build MEOS from scratch - let include_path = if cfg!(feature = "bundled_proj") { - let meos_path = std::env::var("DEP_MEOSSRC_SEARCH").unwrap(); + let pk_include_path = detect_meos_via_pkg_config(); - println!("cargo:rustc-link-search=dylib={}", meos_path); + // Try to find the library manually + let include_path = if !pk_include_path.is_some() { + let default_include_path = String::from("/usr/local/lib/"); + let lib_dir_env = env::var_os("MEOS_LIB_DIR") + .map(OsString::into_string) + .transpose() + .ok() + .flatten() + .unwrap_or(default_include_path.clone()); - // Tell cargo to tell rustc to link the system meos shared library. - println!("cargo:rustc-link-lib=meos"); + // Tell cargo to look for shared libraries in the specified directory + println!("cargo:rustc-link-search={lib_dir_env}"); - meos_path - // Else use pkg-config, using a default as a fallback + // Tell cargo to tell rustc to link the system meos shared library. + println!("cargo:rustc-link-lib=dylib=meos"); + default_include_path } else { - let pk_include_path = detect_meos_via_pkg_config(); - - // Try to find the library manually - if !pk_include_path.is_some() { - let default_include_path = String::from("/usr/local/lib/"); - let lib_dir_env = env::var_os("MEOS_LIB_DIR") - .map(OsString::into_string) - .transpose() - .ok() - .flatten() - .unwrap_or(default_include_path.clone()); - - // Tell cargo to look for shared libraries in the specified directory - println!("cargo:rustc-link-search={lib_dir_env}"); - - // Tell cargo to tell rustc to link the system meos shared library. - println!("cargo:rustc-link-lib=dylib=meos"); - default_include_path - } else { - pk_include_path.unwrap().display().to_string() - } + pk_include_path.unwrap().display().to_string() }; #[cfg(feature = "buildtime_bindgen")] diff --git a/sys/meos-src/Cargo.toml b/sys/meos-src/Cargo.toml deleted file mode 100644 index a9cfb5f..0000000 --- a/sys/meos-src/Cargo.toml +++ /dev/null @@ -1,14 +0,0 @@ -[package] -name = "meos-src" -version = "0.1.3" -edition = "2021" -links = "meossrc" -build = "build.rs" -description = "static library build for meos-sys" -repository = "https://github.com/MobilityDB/RustMEOS" -authors = ["David GarcĂ­a Morillo "] -license-file = "../LICENSE" -exclude = ["source/tests"] - -[build-dependencies] -cmake = "0.1" \ No newline at end of file diff --git a/sys/meos-src/build.rs b/sys/meos-src/build.rs deleted file mode 100644 index 85c07c3..0000000 --- a/sys/meos-src/build.rs +++ /dev/null @@ -1,11 +0,0 @@ -fn main() { - println!("cargo:rerun-if-changed=build.rs"); - - let libmeos = cmake::Config::new("source").define("MEOS", "1").build(); - - println!("cargo:lib=meos"); - - let search_path = format!("{}/lib", libmeos.display()); - assert!(std::path::Path::new(&search_path).exists()); - println!("cargo:search={}", search_path); -} diff --git a/sys/meos-src/source b/sys/meos-src/source deleted file mode 160000 index 256556c..0000000 --- a/sys/meos-src/source +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 256556c46812db8e52590735db90f2e5b45dc724 diff --git a/sys/meos-src/src/lib.rs b/sys/meos-src/src/lib.rs deleted file mode 100644 index 8b13789..0000000 --- a/sys/meos-src/src/lib.rs +++ /dev/null @@ -1 +0,0 @@ -