Skip to content

Commit

Permalink
eww-git: patch to comply with rust-lang/rfcs#2140
Browse files Browse the repository at this point in the history
  • Loading branch information
eclairevoyant committed Jun 23, 2023
1 parent 49cabff commit 496d5b4
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 5 deletions.
6 changes: 4 additions & 2 deletions eww-git/.SRCINFO
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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)
Expand Down
1 change: 1 addition & 0 deletions eww-git/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
!/.SRCINFO
!/PKGBUILD
!/eww-git.install
!/0001-comply-with-rust-lang-rfcs-2140.patch
57 changes: 57 additions & 0 deletions eww-git/0001-comply-with-rust-lang-rfcs-2140.patch
Original file line number Diff line number Diff line change
@@ -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<Diagnostic<usize>
}

pub fn stringify_diagnostic(mut diagnostic: codespan_reporting::diagnostic::Diagnostic<usize>) -> anyhow::Result<String> {
- 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<HashSet<&str>> =
/// @desc these properties apply to _all_ widgets, and can be used anywhere!
pub(super) fn resolve_widget_attrs(bargs: &mut BuilderArgs, gtk_widget: &gtk::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

11 changes: 8 additions & 3 deletions eww-git/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -15,15 +15,20 @@ 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) <noreply@github.com>
)

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"
}
Expand Down

0 comments on commit 496d5b4

Please sign in to comment.