Skip to content

Commit

Permalink
Remove clang-sys dependency (#238)
Browse files Browse the repository at this point in the history
* Cargo.toml: removed `clang` dependency

* added regex for the escaping [generate bindings]

* revert: cargo 1.77 has new `build.rs``
syntax! we don't need it

* remove extra `Rcomplex__bindgen_ty_1` item
[generate bindings]

* removed print statement [skip ci]

---------

Co-authored-by: CGMossa <[email protected]>
  • Loading branch information
CGMossa and CGMossa authored May 10, 2024
1 parent 1fa9052 commit 542d266
Show file tree
Hide file tree
Showing 15 changed files with 256 additions and 87 deletions.
8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@ repository = "https://github.com/extendr/libR-sys"
[dependencies]

[build-dependencies]
bindgen = { version = "0.69.1", optional = true, features = ["experimental"] }
clang = { version = "2", optional = true, features = ["clang_3_7"] }
bindgen = { version = "0.69.4", optional = true, features = ["experimental"] }
regex = { version = "*", optional = true, default-features = false }

[features]
default = ["runtime"]
# By default, we use pre-computed bindings that ship with the library. This may fail!
# Turn on the 'use-bindgen' feature to generate bindings on the fly for your platform.
use-bindgen = ["bindgen", "clang"]
use-bindgen = ["bindgen", "regex"]

runtime = ["clang/runtime", "bindgen/runtime"]
runtime = ["bindgen/runtime"]
# Enables generation of layout-tests in bindgen
layout_tests = ["use-bindgen"]

Expand Down
19 changes: 18 additions & 1 deletion bindings/bindings-linux-aarch64-R4.3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

/* libR-sys version: 0.7.0 */
/* bindgen clang version: Ubuntu clang version 15.0.7 */
/* clang-rs version: Ubuntu clang version 15.0.7 */
/* r version: 4.3.3 */

#[repr(C)]
Expand Down Expand Up @@ -459,6 +458,24 @@ pub struct R_inpstream_st {
pub nat2nat_obj: *mut ::std::os::raw::c_void,
pub nat2utf8_obj: *mut ::std::os::raw::c_void,
}
pub const SORTED_DECR_NA_1ST: _bindgen_ty_2 = _bindgen_ty_2::SORTED_DECR_NA_1ST;
pub const SORTED_DECR: _bindgen_ty_2 = _bindgen_ty_2::SORTED_DECR;
pub const UNKNOWN_SORTEDNESS: _bindgen_ty_2 = _bindgen_ty_2::UNKNOWN_SORTEDNESS;
pub const SORTED_INCR: _bindgen_ty_2 = _bindgen_ty_2::SORTED_INCR;
pub const SORTED_INCR_NA_1ST: _bindgen_ty_2 = _bindgen_ty_2::SORTED_INCR_NA_1ST;
pub const KNOWN_UNSORTED: _bindgen_ty_2 = _bindgen_ty_2::KNOWN_UNSORTED;
#[repr(i32)]
#[doc = "ALTREP sorting support"]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub enum _bindgen_ty_2 {
SORTED_DECR_NA_1ST = -2,
SORTED_DECR = -1,
#[doc = "INT_MIN is NA_INTEGER!"]
UNKNOWN_SORTEDNESS = -2147483648,
SORTED_INCR = 1,
SORTED_INCR_NA_1ST = 2,
KNOWN_UNSORTED = 0,
}
#[doc = "try to allow some type checking"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
Expand Down
19 changes: 18 additions & 1 deletion bindings/bindings-linux-aarch64-R4.4.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

/* libR-sys version: 0.7.0 */
/* bindgen clang version: Ubuntu clang version 15.0.7 */
/* clang-rs version: Ubuntu clang version 15.0.7 */
/* r version: 4.4.0 */

#[repr(C)]
Expand Down Expand Up @@ -460,6 +459,24 @@ pub struct R_inpstream_st {
pub nat2nat_obj: *mut ::std::os::raw::c_void,
pub nat2utf8_obj: *mut ::std::os::raw::c_void,
}
pub const SORTED_DECR_NA_1ST: _bindgen_ty_2 = _bindgen_ty_2::SORTED_DECR_NA_1ST;
pub const SORTED_DECR: _bindgen_ty_2 = _bindgen_ty_2::SORTED_DECR;
pub const UNKNOWN_SORTEDNESS: _bindgen_ty_2 = _bindgen_ty_2::UNKNOWN_SORTEDNESS;
pub const SORTED_INCR: _bindgen_ty_2 = _bindgen_ty_2::SORTED_INCR;
pub const SORTED_INCR_NA_1ST: _bindgen_ty_2 = _bindgen_ty_2::SORTED_INCR_NA_1ST;
pub const KNOWN_UNSORTED: _bindgen_ty_2 = _bindgen_ty_2::KNOWN_UNSORTED;
#[repr(i32)]
#[doc = "ALTREP sorting support"]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub enum _bindgen_ty_2 {
SORTED_DECR_NA_1ST = -2,
SORTED_DECR = -1,
#[doc = "INT_MIN is NA_INTEGER!"]
UNKNOWN_SORTEDNESS = -2147483648,
SORTED_INCR = 1,
SORTED_INCR_NA_1ST = 2,
KNOWN_UNSORTED = 0,
}
#[doc = "try to allow some type checking"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
Expand Down
23 changes: 20 additions & 3 deletions bindings/bindings-linux-aarch64-R4.5-devel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

/* libR-sys version: 0.7.0 */
/* bindgen clang version: Ubuntu clang version 15.0.7 */
/* clang-rs version: Ubuntu clang version 15.0.7 */
/* r version: 4.5.0-devel */

#[repr(C)]
Expand Down Expand Up @@ -137,8 +136,8 @@ pub const R_MINOR: &[u8; 4] = b"5.0\0";
pub const R_STATUS: &[u8; 29] = b"Under development (unstable)\0";
pub const R_YEAR: &[u8; 5] = b"2024\0";
pub const R_MONTH: &[u8; 3] = b"05\0";
pub const R_DAY: &[u8; 3] = b"07\0";
pub const R_SVN_REVISION: u32 = 86527;
pub const R_DAY: &[u8; 3] = b"08\0";
pub const R_SVN_REVISION: u32 = 86528;
pub const R_GE_definitions: u32 = 13;
pub const R_GE_deviceClip: u32 = 14;
pub const R_GE_group: u32 = 15;
Expand Down Expand Up @@ -460,6 +459,24 @@ pub struct R_inpstream_st {
pub nat2nat_obj: *mut ::std::os::raw::c_void,
pub nat2utf8_obj: *mut ::std::os::raw::c_void,
}
pub const SORTED_DECR_NA_1ST: _bindgen_ty_2 = _bindgen_ty_2::SORTED_DECR_NA_1ST;
pub const SORTED_DECR: _bindgen_ty_2 = _bindgen_ty_2::SORTED_DECR;
pub const UNKNOWN_SORTEDNESS: _bindgen_ty_2 = _bindgen_ty_2::UNKNOWN_SORTEDNESS;
pub const SORTED_INCR: _bindgen_ty_2 = _bindgen_ty_2::SORTED_INCR;
pub const SORTED_INCR_NA_1ST: _bindgen_ty_2 = _bindgen_ty_2::SORTED_INCR_NA_1ST;
pub const KNOWN_UNSORTED: _bindgen_ty_2 = _bindgen_ty_2::KNOWN_UNSORTED;
#[repr(i32)]
#[doc = "ALTREP sorting support"]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub enum _bindgen_ty_2 {
SORTED_DECR_NA_1ST = -2,
SORTED_DECR = -1,
#[doc = "INT_MIN is NA_INTEGER!"]
UNKNOWN_SORTEDNESS = -2147483648,
SORTED_INCR = 1,
SORTED_INCR_NA_1ST = 2,
KNOWN_UNSORTED = 0,
}
#[doc = "try to allow some type checking"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
Expand Down
19 changes: 18 additions & 1 deletion bindings/bindings-linux-x86_64-R4.3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

/* libR-sys version: 0.7.0 */
/* bindgen clang version: Ubuntu clang version 15.0.7 */
/* clang-rs version: Ubuntu clang version 15.0.7 */
/* r version: 4.3.3 */

#[repr(C)]
Expand Down Expand Up @@ -459,6 +458,24 @@ pub struct R_inpstream_st {
pub nat2nat_obj: *mut ::std::os::raw::c_void,
pub nat2utf8_obj: *mut ::std::os::raw::c_void,
}
pub const SORTED_DECR_NA_1ST: _bindgen_ty_2 = _bindgen_ty_2::SORTED_DECR_NA_1ST;
pub const SORTED_DECR: _bindgen_ty_2 = _bindgen_ty_2::SORTED_DECR;
pub const UNKNOWN_SORTEDNESS: _bindgen_ty_2 = _bindgen_ty_2::UNKNOWN_SORTEDNESS;
pub const SORTED_INCR: _bindgen_ty_2 = _bindgen_ty_2::SORTED_INCR;
pub const SORTED_INCR_NA_1ST: _bindgen_ty_2 = _bindgen_ty_2::SORTED_INCR_NA_1ST;
pub const KNOWN_UNSORTED: _bindgen_ty_2 = _bindgen_ty_2::KNOWN_UNSORTED;
#[repr(i32)]
#[doc = "ALTREP sorting support"]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub enum _bindgen_ty_2 {
SORTED_DECR_NA_1ST = -2,
SORTED_DECR = -1,
#[doc = "INT_MIN is NA_INTEGER!"]
UNKNOWN_SORTEDNESS = -2147483648,
SORTED_INCR = 1,
SORTED_INCR_NA_1ST = 2,
KNOWN_UNSORTED = 0,
}
#[doc = "try to allow some type checking"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
Expand Down
19 changes: 18 additions & 1 deletion bindings/bindings-linux-x86_64-R4.4.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

/* libR-sys version: 0.7.0 */
/* bindgen clang version: Ubuntu clang version 15.0.7 */
/* clang-rs version: Ubuntu clang version 15.0.7 */
/* r version: 4.4.0 */

#[repr(C)]
Expand Down Expand Up @@ -460,6 +459,24 @@ pub struct R_inpstream_st {
pub nat2nat_obj: *mut ::std::os::raw::c_void,
pub nat2utf8_obj: *mut ::std::os::raw::c_void,
}
pub const SORTED_DECR_NA_1ST: _bindgen_ty_2 = _bindgen_ty_2::SORTED_DECR_NA_1ST;
pub const SORTED_DECR: _bindgen_ty_2 = _bindgen_ty_2::SORTED_DECR;
pub const UNKNOWN_SORTEDNESS: _bindgen_ty_2 = _bindgen_ty_2::UNKNOWN_SORTEDNESS;
pub const SORTED_INCR: _bindgen_ty_2 = _bindgen_ty_2::SORTED_INCR;
pub const SORTED_INCR_NA_1ST: _bindgen_ty_2 = _bindgen_ty_2::SORTED_INCR_NA_1ST;
pub const KNOWN_UNSORTED: _bindgen_ty_2 = _bindgen_ty_2::KNOWN_UNSORTED;
#[repr(i32)]
#[doc = "ALTREP sorting support"]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub enum _bindgen_ty_2 {
SORTED_DECR_NA_1ST = -2,
SORTED_DECR = -1,
#[doc = "INT_MIN is NA_INTEGER!"]
UNKNOWN_SORTEDNESS = -2147483648,
SORTED_INCR = 1,
SORTED_INCR_NA_1ST = 2,
KNOWN_UNSORTED = 0,
}
#[doc = "try to allow some type checking"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
Expand Down
19 changes: 18 additions & 1 deletion bindings/bindings-linux-x86_64-R4.5-devel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

/* libR-sys version: 0.7.0 */
/* bindgen clang version: Ubuntu clang version 15.0.7 */
/* clang-rs version: Ubuntu clang version 15.0.7 */
/* r version: 4.5.0-devel */

#[repr(C)]
Expand Down Expand Up @@ -460,6 +459,24 @@ pub struct R_inpstream_st {
pub nat2nat_obj: *mut ::std::os::raw::c_void,
pub nat2utf8_obj: *mut ::std::os::raw::c_void,
}
pub const SORTED_DECR_NA_1ST: _bindgen_ty_2 = _bindgen_ty_2::SORTED_DECR_NA_1ST;
pub const SORTED_DECR: _bindgen_ty_2 = _bindgen_ty_2::SORTED_DECR;
pub const UNKNOWN_SORTEDNESS: _bindgen_ty_2 = _bindgen_ty_2::UNKNOWN_SORTEDNESS;
pub const SORTED_INCR: _bindgen_ty_2 = _bindgen_ty_2::SORTED_INCR;
pub const SORTED_INCR_NA_1ST: _bindgen_ty_2 = _bindgen_ty_2::SORTED_INCR_NA_1ST;
pub const KNOWN_UNSORTED: _bindgen_ty_2 = _bindgen_ty_2::KNOWN_UNSORTED;
#[repr(i32)]
#[doc = "ALTREP sorting support"]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub enum _bindgen_ty_2 {
SORTED_DECR_NA_1ST = -2,
SORTED_DECR = -1,
#[doc = "INT_MIN is NA_INTEGER!"]
UNKNOWN_SORTEDNESS = -2147483648,
SORTED_INCR = 1,
SORTED_INCR_NA_1ST = 2,
KNOWN_UNSORTED = 0,
}
#[doc = "try to allow some type checking"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
Expand Down
20 changes: 18 additions & 2 deletions bindings/bindings-macos-aarch64-R4.3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

/* libR-sys version: 0.7.0 */
/* bindgen clang version: Homebrew clang version 17.0.6 */
/* clang-rs version: Homebrew clang version 17.0.6 */
/* r version: 4.3.3 */

#[repr(C)]
Expand Down Expand Up @@ -85,7 +84,6 @@ where
}
}
}
pub const INT_MIN: i32 = -2147483648;
pub const SINGLESXP: u32 = 302;
pub const R_LEN_T_MAX: u32 = 2147483647;
pub const HAVE_F77_UNDERSCORE: u32 = 1;
Expand Down Expand Up @@ -469,6 +467,24 @@ pub struct R_inpstream_st {
pub nat2nat_obj: *mut ::std::os::raw::c_void,
pub nat2utf8_obj: *mut ::std::os::raw::c_void,
}
pub const SORTED_DECR_NA_1ST: _bindgen_ty_1 = _bindgen_ty_1::SORTED_DECR_NA_1ST;
pub const SORTED_DECR: _bindgen_ty_1 = _bindgen_ty_1::SORTED_DECR;
pub const UNKNOWN_SORTEDNESS: _bindgen_ty_1 = _bindgen_ty_1::UNKNOWN_SORTEDNESS;
pub const SORTED_INCR: _bindgen_ty_1 = _bindgen_ty_1::SORTED_INCR;
pub const SORTED_INCR_NA_1ST: _bindgen_ty_1 = _bindgen_ty_1::SORTED_INCR_NA_1ST;
pub const KNOWN_UNSORTED: _bindgen_ty_1 = _bindgen_ty_1::KNOWN_UNSORTED;
#[repr(i32)]
#[doc = "ALTREP sorting support"]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub enum _bindgen_ty_1 {
SORTED_DECR_NA_1ST = -2,
SORTED_DECR = -1,
#[doc = "INT_MIN is NA_INTEGER!"]
UNKNOWN_SORTEDNESS = -2147483648,
SORTED_INCR = 1,
SORTED_INCR_NA_1ST = 2,
KNOWN_UNSORTED = 0,
}
#[doc = "try to allow some type checking"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
Expand Down
20 changes: 18 additions & 2 deletions bindings/bindings-macos-aarch64-R4.4.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

/* libR-sys version: 0.7.0 */
/* bindgen clang version: Homebrew clang version 17.0.6 */
/* clang-rs version: Homebrew clang version 17.0.6 */
/* r version: 4.4.0 */

#[repr(C)]
Expand Down Expand Up @@ -85,7 +84,6 @@ where
}
}
}
pub const INT_MIN: i32 = -2147483648;
pub const SINGLESXP: u32 = 302;
pub const R_LEN_T_MAX: u32 = 2147483647;
pub const HAVE_F77_UNDERSCORE: u32 = 1;
Expand Down Expand Up @@ -470,6 +468,24 @@ pub struct R_inpstream_st {
pub nat2nat_obj: *mut ::std::os::raw::c_void,
pub nat2utf8_obj: *mut ::std::os::raw::c_void,
}
pub const SORTED_DECR_NA_1ST: _bindgen_ty_1 = _bindgen_ty_1::SORTED_DECR_NA_1ST;
pub const SORTED_DECR: _bindgen_ty_1 = _bindgen_ty_1::SORTED_DECR;
pub const UNKNOWN_SORTEDNESS: _bindgen_ty_1 = _bindgen_ty_1::UNKNOWN_SORTEDNESS;
pub const SORTED_INCR: _bindgen_ty_1 = _bindgen_ty_1::SORTED_INCR;
pub const SORTED_INCR_NA_1ST: _bindgen_ty_1 = _bindgen_ty_1::SORTED_INCR_NA_1ST;
pub const KNOWN_UNSORTED: _bindgen_ty_1 = _bindgen_ty_1::KNOWN_UNSORTED;
#[repr(i32)]
#[doc = "ALTREP sorting support"]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub enum _bindgen_ty_1 {
SORTED_DECR_NA_1ST = -2,
SORTED_DECR = -1,
#[doc = "INT_MIN is NA_INTEGER!"]
UNKNOWN_SORTEDNESS = -2147483648,
SORTED_INCR = 1,
SORTED_INCR_NA_1ST = 2,
KNOWN_UNSORTED = 0,
}
#[doc = "try to allow some type checking"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
Expand Down
20 changes: 18 additions & 2 deletions bindings/bindings-macos-aarch64-R4.5-devel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

/* libR-sys version: 0.7.0 */
/* bindgen clang version: Homebrew clang version 17.0.6 */
/* clang-rs version: Homebrew clang version 17.0.6 */
/* r version: 4.5.0-devel */

#[repr(C)]
Expand Down Expand Up @@ -85,7 +84,6 @@ where
}
}
}
pub const INT_MIN: i32 = -2147483648;
pub const SINGLESXP: u32 = 302;
pub const R_LEN_T_MAX: u32 = 2147483647;
pub const HAVE_F77_UNDERSCORE: u32 = 1;
Expand Down Expand Up @@ -470,6 +468,24 @@ pub struct R_inpstream_st {
pub nat2nat_obj: *mut ::std::os::raw::c_void,
pub nat2utf8_obj: *mut ::std::os::raw::c_void,
}
pub const SORTED_DECR_NA_1ST: _bindgen_ty_1 = _bindgen_ty_1::SORTED_DECR_NA_1ST;
pub const SORTED_DECR: _bindgen_ty_1 = _bindgen_ty_1::SORTED_DECR;
pub const UNKNOWN_SORTEDNESS: _bindgen_ty_1 = _bindgen_ty_1::UNKNOWN_SORTEDNESS;
pub const SORTED_INCR: _bindgen_ty_1 = _bindgen_ty_1::SORTED_INCR;
pub const SORTED_INCR_NA_1ST: _bindgen_ty_1 = _bindgen_ty_1::SORTED_INCR_NA_1ST;
pub const KNOWN_UNSORTED: _bindgen_ty_1 = _bindgen_ty_1::KNOWN_UNSORTED;
#[repr(i32)]
#[doc = "ALTREP sorting support"]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub enum _bindgen_ty_1 {
SORTED_DECR_NA_1ST = -2,
SORTED_DECR = -1,
#[doc = "INT_MIN is NA_INTEGER!"]
UNKNOWN_SORTEDNESS = -2147483648,
SORTED_INCR = 1,
SORTED_INCR_NA_1ST = 2,
KNOWN_UNSORTED = 0,
}
#[doc = "try to allow some type checking"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
Expand Down
20 changes: 18 additions & 2 deletions bindings/bindings-macos-x86_64-R4.4.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

/* libR-sys version: 0.7.0 */
/* bindgen clang version: Homebrew clang version 17.0.6 */
/* clang-rs version: Homebrew clang version 17.0.6 */
/* r version: 4.4.0 */

#[repr(C)]
Expand Down Expand Up @@ -85,7 +84,6 @@ where
}
}
}
pub const INT_MIN: i32 = -2147483648;
pub const SINGLESXP: u32 = 302;
pub const R_LEN_T_MAX: u32 = 2147483647;
pub const HAVE_F77_UNDERSCORE: u32 = 1;
Expand Down Expand Up @@ -470,6 +468,24 @@ pub struct R_inpstream_st {
pub nat2nat_obj: *mut ::std::os::raw::c_void,
pub nat2utf8_obj: *mut ::std::os::raw::c_void,
}
pub const SORTED_DECR_NA_1ST: _bindgen_ty_1 = _bindgen_ty_1::SORTED_DECR_NA_1ST;
pub const SORTED_DECR: _bindgen_ty_1 = _bindgen_ty_1::SORTED_DECR;
pub const UNKNOWN_SORTEDNESS: _bindgen_ty_1 = _bindgen_ty_1::UNKNOWN_SORTEDNESS;
pub const SORTED_INCR: _bindgen_ty_1 = _bindgen_ty_1::SORTED_INCR;
pub const SORTED_INCR_NA_1ST: _bindgen_ty_1 = _bindgen_ty_1::SORTED_INCR_NA_1ST;
pub const KNOWN_UNSORTED: _bindgen_ty_1 = _bindgen_ty_1::KNOWN_UNSORTED;
#[repr(i32)]
#[doc = "ALTREP sorting support"]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub enum _bindgen_ty_1 {
SORTED_DECR_NA_1ST = -2,
SORTED_DECR = -1,
#[doc = "INT_MIN is NA_INTEGER!"]
UNKNOWN_SORTEDNESS = -2147483648,
SORTED_INCR = 1,
SORTED_INCR_NA_1ST = 2,
KNOWN_UNSORTED = 0,
}
#[doc = "try to allow some type checking"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
Expand Down
Loading

0 comments on commit 542d266

Please sign in to comment.