From 496d5b406843f97fba19858b2ecd46f860a61f05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=A9clairevoyant?= <848000+eclairevoyant@users.noreply.github.com> Date: Fri, 23 Jun 2023 09:27:12 -0400 Subject: [PATCH] eww-git: patch to comply with rust-lang/rfcs#2140 --- eww-git/.SRCINFO | 6 +- eww-git/.gitignore | 1 + ...0001-comply-with-rust-lang-rfcs-2140.patch | 57 +++++++++++++++++++ eww-git/PKGBUILD | 11 +++- 4 files changed, 70 insertions(+), 5 deletions(-) create mode 100644 eww-git/0001-comply-with-rust-lang-rfcs-2140.patch diff --git a/eww-git/.SRCINFO b/eww-git/.SRCINFO index 2438b9b4..739b464c 100644 --- a/eww-git/.SRCINFO +++ b/eww-git/.SRCINFO @@ -1,7 +1,7 @@ pkgbase = eww-git pkgdesc = ElKowar's wacky widgets - pkgver = 0.4.0.r28.ge762068 - pkgrel = 2 + pkgver = 0.4.0.r34.g25e50ed + pkgrel = 1 url = https://github.com/elkowar/eww install = eww-git.install arch = x86_64 @@ -13,9 +13,11 @@ pkgbase = eww-git provides = eww conflicts = eww source = git+https://github.com/elkowar/eww.git?signed + source = 0001-comply-with-rust-lang-rfcs-2140.patch validpgpkeys = 94E8F34BCE4F4BA8ED9B29BD50E76B4711E4C3E4 validpgpkeys = 5DE3E0509C47EA3CF04A42D34AEE18F83AFDEB23 b2sums = SKIP + b2sums = fafbf79bd0c74780e53887784102102758e2d3a411c2c95fb77b5cb75b4c9bb53cda92b9b80e463704a38edb5161187f86c5c57dcb32bd768fd56addc2df937b pkgname = eww-x11-git pkgdesc = ElKowar's wacky widgets (X11 backend) diff --git a/eww-git/.gitignore b/eww-git/.gitignore index f79e632e..8ab73c8e 100644 --- a/eww-git/.gitignore +++ b/eww-git/.gitignore @@ -3,3 +3,4 @@ !/.SRCINFO !/PKGBUILD !/eww-git.install +!/0001-comply-with-rust-lang-rfcs-2140.patch diff --git a/eww-git/0001-comply-with-rust-lang-rfcs-2140.patch b/eww-git/0001-comply-with-rust-lang-rfcs-2140.patch new file mode 100644 index 00000000..320ac5a9 --- /dev/null +++ b/eww-git/0001-comply-with-rust-lang-rfcs-2140.patch @@ -0,0 +1,57 @@ +From 2bb7084425994bf70a69ee52f5917dd3fa1185ba Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?=C3=A9clairevoyant?= + <848000+eclairevoyant@users.noreply.github.com> +Date: Fri, 23 Jun 2023 09:21:29 -0400 +Subject: [PATCH] comply with rust-lang/rfcs#2140 + +--- + crates/eww/src/error_handling_ctx.rs | 2 +- + crates/eww/src/main.rs | 4 ++-- + crates/eww/src/widgets/widget_definitions.rs | 2 +- + 3 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/crates/eww/src/error_handling_ctx.rs b/crates/eww/src/error_handling_ctx.rs +index 3273200..8a57e35 100644 +--- a/crates/eww/src/error_handling_ctx.rs ++++ b/crates/eww/src/error_handling_ctx.rs +@@ -53,7 +53,7 @@ pub fn anyhow_err_to_diagnostic(err: &anyhow::Error) -> Option + } + + pub fn stringify_diagnostic(mut diagnostic: codespan_reporting::diagnostic::Diagnostic) -> anyhow::Result { +- diagnostic.labels.drain_filter(|label| Span(label.range.start, label.range.end, label.file_id).is_dummy()); ++ diagnostic.labels.extract_if(|label| Span(label.range.start, label.range.end, label.file_id).is_dummy()); + + let mut config = term::Config::default(); + let mut chars = Chars::box_drawing(); +diff --git a/crates/eww/src/main.rs b/crates/eww/src/main.rs +index 1e61c3b..9211d03 100644 +--- a/crates/eww/src/main.rs ++++ b/crates/eww/src/main.rs +@@ -1,9 +1,9 @@ + #![feature(trace_macros)] +-#![feature(drain_filter)] ++#![feature(extract_if)] + #![feature(box_patterns)] + #![feature(slice_concat_trait)] + #![feature(try_blocks)] +-#![feature(hash_drain_filter)] ++#![feature(hash_extract_if)] + #![allow(rustdoc::private_intra_doc_links)] + + extern crate gtk; +diff --git a/crates/eww/src/widgets/widget_definitions.rs b/crates/eww/src/widgets/widget_definitions.rs +index 2cdc907..a142940 100644 +--- a/crates/eww/src/widgets/widget_definitions.rs ++++ b/crates/eww/src/widgets/widget_definitions.rs +@@ -127,7 +127,7 @@ static DEPRECATED_ATTRS: Lazy> = + /// @desc these properties apply to _all_ widgets, and can be used anywhere! + pub(super) fn resolve_widget_attrs(bargs: &mut BuilderArgs, gtk_widget: >k::Widget) -> Result<()> { + let deprecated: HashSet<_> = DEPRECATED_ATTRS.to_owned(); +- let contained_deprecated: Vec<_> = bargs.unhandled_attrs.drain_filter(|a, _| deprecated.contains(&a.0 as &str)).collect(); ++ let contained_deprecated: Vec<_> = bargs.unhandled_attrs.extract_if(|a, _| deprecated.contains(&a.0 as &str)).collect(); + if !contained_deprecated.is_empty() { + let diag = error_handling_ctx::stringify_diagnostic(gen_diagnostic! { + kind = Severity::Error, +-- +2.41.0 + diff --git a/eww-git/PKGBUILD b/eww-git/PKGBUILD index ff3ef2b1..c41a3e7f 100644 --- a/eww-git/PKGBUILD +++ b/eww-git/PKGBUILD @@ -4,7 +4,7 @@ _pkgname=eww pkgbase="$_pkgname-git" pkgname=($_pkgname-{x11,wayland}-git) -pkgver=0.4.0.r32.gb31e397 +pkgver=0.4.0.r34.g25e50ed pkgrel=1 pkgdesc="ElKowar's wacky widgets" arch=(x86_64) @@ -15,8 +15,10 @@ makedepends=(cargo-nightly git) provides=("$_pkgname") conflicts=("$_pkgname") install=$pkgbase.install -source=("git+$url.git?signed") -b2sums=('SKIP') +source=("git+$url.git?signed" + 0001-comply-with-rust-lang-rfcs-2140.patch) +b2sums=('SKIP' + 'fafbf79bd0c74780e53887784102102758e2d3a411c2c95fb77b5cb75b4c9bb53cda92b9b80e463704a38edb5161187f86c5c57dcb32bd768fd56addc2df937b') validpgpkeys=( '94E8F34BCE4F4BA8ED9B29BD50E76B4711E4C3E4' # Leon Kowarschick <5300871+elkowar@users.noreply.github.com> '5DE3E0509C47EA3CF04A42D34AEE18F83AFDEB23' # GitHub (web-flow commit signing) @@ -24,6 +26,9 @@ validpgpkeys=( prepare() { cd $_pkgname + + patch -Np1 -i "$srcdir/0001-comply-with-rust-lang-rfcs-2140.patch" + export RUSTUP_TOOLCHAIN=nightly cargo fetch --locked --target "$CARCH-unknown-linux-gnu" }