You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
rust-onig_sys/0001-Always-use-system-onig...

76 lines
2.1 KiB

From 5aabe30b197ae7d7c158065215855d8bd3274d75 Mon Sep 17 00:00:00 2001
From: Igor Raits <i.gnatenko.brain@gmail.com>
Date: Sat, 16 May 2020 20:01:33 +0200
Subject: [PATCH] Always use system onig
Signed-off-by: Igor Raits <i.gnatenko.brain@gmail.com>
---
build.rs | 6 ++----
src/lib.rs | 12 ------------
2 files changed, 2 insertions(+), 16 deletions(-)
diff --git a/build.rs b/build.rs
index cf1b6f3..d704fce 100644
--- a/build.rs
+++ b/build.rs
@@ -1,4 +1,3 @@
-#[cfg(feature = "generate")]
extern crate bindgen;
extern crate cc;
extern crate pkg_config;
@@ -196,10 +195,6 @@ fn compile() {
cc.compile("onig");
}
-#[cfg(not(feature = "generate"))]
-fn bindgen_headers(_path: &str) {}
-
-#[cfg(feature = "generate")]
fn bindgen_headers(path: &str) {
let arch = env::var("CARGO_CFG_TARGET_ARCH");
let mut bindgen = bindgen::Builder::default()
@@ -219,17 +214,13 @@ fn bindgen_headers(path: &str) {
pub fn main() {
let link_type = link_type_override();
- let require_pkg_config = env_var_bool("RUSTONIG_SYSTEM_LIBONIG").unwrap_or(false);
+ let require_pkg_config = true;
if require_pkg_config || link_type == Some(LinkType::Dynamic) {
let mut conf = Config::new();
// dynamically-generated headers can work with an older version
// pre-generated headers are for the latest
- conf.atleast_version(if cfg!(feature = "generate") {
- "6.8.0"
- } else {
- "6.9.3"
- });
+ conf.atleast_version("6.8.0");
if link_type == Some(LinkType::Static) {
conf.statik(true);
}
diff --git a/src/lib.rs b/src/lib.rs
index 4d855ad..c9b6d20 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -1,19 +1,7 @@
-#[cfg(feature = "generate")]
mod bindgened;
-#[cfg(feature = "generate")]
pub use bindgened::*;
-#[cfg(not(feature = "generate"))]
-#[allow(non_upper_case_globals)]
-#[allow(non_camel_case_types)]
-#[allow(non_snake_case)]
-#[allow(clippy::all)]
-mod ffi;
-
-#[cfg(not(feature = "generate"))]
-pub use self::ffi::*;
-
// backfill types from the old hand-written bindings:
pub type OnigSyntaxBehavior = ::std::os::raw::c_uint;