Commit 10389ff7e2
10389ff7e23179eb30f44bfc1af076e307653a2a
parent: 53bd451d7c
Unsigned
Darafei Praliaskouski <me@komzpa.net> · 2026-06-23 13:52 UTC
committer: <strk@kbt.io>
fix: propagate WeeChat API cfg to plugin crate
Layout: unified · split
Cargo.lock
+4 −13
| @@ -284,7 +284,7 @@ dependencies = [ |
| 284 | "bitflags 2.10.0", |
284 | "bitflags 2.10.0", |
| 285 | "cexpr", |
285 | "cexpr", |
| 286 | "clang-sys", |
286 | "clang-sys", |
| 287 | "itertools 0.13.0", |
287 | "itertools 0.10.5", |
| 288 | "log", |
288 | "log", |
| 289 | "prettyplease", |
289 | "prettyplease", |
| 290 | "proc-macro2", |
290 | "proc-macro2", |
| @@ -1792,15 +1792,6 @@ dependencies = [ |
| 1792 | "either", |
1792 | "either", |
| 1793 | ] |
1793 | ] |
| 1794 | |
1794 | |
| 1795 | [[package]] |
| |
| 1796 | name = "itertools" |
| |
| 1797 | version = "0.13.0" |
| |
| 1798 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| |
| 1799 | checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" |
| |
| 1800 | dependencies = [ |
| |
| 1801 | "either", |
| |
| 1802 | ] |
| |
| 1803 | |
| |
| 1804 | [[package]] |
1795 | [[package]] |
| 1805 | name = "itertools" |
1796 | name = "itertools" |
| 1806 | version = "0.14.0" |
1797 | version = "0.14.0" |
| @@ -4602,7 +4593,7 @@ dependencies = [ |
| 4602 | [[package]] |
4593 | [[package]] |
| 4603 | name = "weechat" |
4594 | name = "weechat" |
| 4604 | version = "0.4.0" |
4595 | version = "0.4.0" |
| 4605 | source = "git+https://github.com/poljar/rust-weechat#fbe2ed45d42d4c7f34d5d7aeaff98d76b7cd9211" |
4596 | source = "git+https://github.com/poljar/rust-weechat#adb96ffc9f229cbff05ad51b0ff4c9d46597e2f4" |
| 4606 | dependencies = [ |
4597 | dependencies = [ |
| 4607 | "async-task", |
4598 | "async-task", |
| 4608 | "async-trait", |
4599 | "async-trait", |
| @@ -4619,7 +4610,7 @@ dependencies = [ |
| 4619 | [[package]] |
4610 | [[package]] |
| 4620 | name = "weechat-macro" |
4611 | name = "weechat-macro" |
| 4621 | version = "0.4.0" |
4612 | version = "0.4.0" |
| 4622 | source = "git+https://github.com/poljar/rust-weechat#fbe2ed45d42d4c7f34d5d7aeaff98d76b7cd9211" |
4613 | source = "git+https://github.com/poljar/rust-weechat#adb96ffc9f229cbff05ad51b0ff4c9d46597e2f4" |
| 4623 | dependencies = [ |
4614 | dependencies = [ |
| 4624 | "libc", |
4615 | "libc", |
| 4625 | "proc-macro2", |
4616 | "proc-macro2", |
| @@ -4652,7 +4643,7 @@ dependencies = [ |
| 4652 | [[package]] |
4643 | [[package]] |
| 4653 | name = "weechat-sys" |
4644 | name = "weechat-sys" |
| 4654 | version = "0.4.0" |
4645 | version = "0.4.0" |
| 4655 | source = "git+https://github.com/poljar/rust-weechat#fbe2ed45d42d4c7f34d5d7aeaff98d76b7cd9211" |
4646 | source = "git+https://github.com/poljar/rust-weechat#adb96ffc9f229cbff05ad51b0ff4c9d46597e2f4" |
| 4656 | dependencies = [ |
4647 | dependencies = [ |
| 4657 | "bindgen", |
4648 | "bindgen", |
| 4658 | "libc", |
4649 | "libc", |
Cargo.toml
+3
| @@ -34,6 +34,9 @@ image = { version = "*", default-features = false, features = ["jpeg"] } |
| 34 | git = "https://github.com/poljar/rust-weechat" |
34 | git = "https://github.com/poljar/rust-weechat" |
| 35 | features = ["async", "config_macro"] |
35 | features = ["async", "config_macro"] |
| 36 | |
36 | |
| |
37 | [build-dependencies.weechat-sys] |
| |
38 | git = "https://github.com/poljar/rust-weechat" |
| |
39 | |
| 37 | [dependencies.matrix-sdk] |
40 | [dependencies.matrix-sdk] |
| 38 | version = "0.14.0" |
41 | version = "0.14.0" |
| 39 | # git = "https://github.com/matrix-org/matrix-rust-sdk.git" |
42 | # git = "https://github.com/matrix-org/matrix-rust-sdk.git" |
build.rs
added
+30
| @@ -0,0 +1,30 @@ |
| |
1 | #[allow(unused)] |
| |
2 | #[repr(u64)] |
| |
3 | enum WeechatApiVersions { |
| |
4 | V4_1_0 = 20230908, |
| |
5 | V4_2_0 = 20240105, |
| |
6 | } |
| |
7 | |
| |
8 | fn main() { |
| |
9 | println!("cargo::rerun-if-changed=build.rs"); |
| |
10 | println!("cargo::rerun-if-env-changed=WEECHAT_BUNDLED"); |
| |
11 | println!("cargo::rerun-if-env-changed=WEECHAT_PLUGIN_FILE"); |
| |
12 | println!("cargo::rustc-check-cfg=cfg(weechat410)"); |
| |
13 | println!("cargo::rustc-check-cfg=cfg(weechat420)"); |
| |
14 | |
| |
15 | let (version, _) = |
| |
16 | std::str::from_utf8(weechat_sys::WEECHAT_PLUGIN_API_VERSION) |
| |
17 | .expect("Failed to parse WeeChat API version string") |
| |
18 | .split_once('-') |
| |
19 | .expect("Failed to split WeeChat API version string"); |
| |
20 | |
| |
21 | let version: u64 = version |
| |
22 | .parse() |
| |
23 | .expect("Failed to parse WeeChat API version string as u64"); |
| |
24 | |
| |
25 | if version >= WeechatApiVersions::V4_2_0 as u64 { |
| |
26 | println!("cargo::rustc-cfg=weechat420"); |
| |
27 | } else { |
| |
28 | println!("cargo::rustc-cfg=weechat410"); |
| |
29 | } |
| |
30 | } |