commit:     9bdd96cd8735da9843cff48228f47b94fe113f5c
Author:     Luciano Degni (Pungolo) <degni.public <AT> gmail <DOT> com>
AuthorDate: Fri Oct 21 09:26:18 2022 +0000
Commit:     Luciano Degni <degni.public <AT> gmail <DOT> com>
CommitDate: Fri Oct 21 09:26:18 2022 +0000
URL:        https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=9bdd96cd

fixed 0.4.0 version and fixed no defaults features bug

Signed-off-by: Luciano Degni (Pungolo) <degni.public <AT> gmail.com>

 ...Fix-no-default-features-build-failing-905.patch | 86 ++++++++++++++++++++++
 x11-wm/leftwm/leftwm-0.4.0.ebuild                  | 26 ++++++-
 2 files changed, 108 insertions(+), 4 deletions(-)

diff --git 
a/x11-wm/leftwm/files/0.4.0/0001-Fix-no-default-features-build-failing-905.patch
 
b/x11-wm/leftwm/files/0.4.0/0001-Fix-no-default-features-build-failing-905.patch
new file mode 100644
index 000000000..81a521b6c
--- /dev/null
+++ 
b/x11-wm/leftwm/files/0.4.0/0001-Fix-no-default-features-build-failing-905.patch
@@ -0,0 +1,86 @@
+From 345d0711b051a52dd901acdad9051ab13b8989b4 Mon Sep 17 00:00:00 2001
+From: VuiMuich <jm.s...@gmx.net>
+Date: Wed, 19 Oct 2022 20:57:46 +0200
+Subject: [PATCH] Fix `--no-default-features` build failing (#905)
+
+* fix no-default-features build failing
+
+* add feature flag to `fn is_valid_scratchpad_name`
+---
+ leftwm/src/bin/lefthk-worker.rs | 30 ++++++++++++++++--------------
+ leftwm/src/config/keybind.rs    |  1 +
+ leftwm/src/utils/log/mod.rs     |  1 +
+ 3 files changed, 18 insertions(+), 14 deletions(-)
+
+diff --git a/leftwm/src/bin/lefthk-worker.rs b/leftwm/src/bin/lefthk-worker.rs
+index 22c2d2d..4783695 100644
+--- a/leftwm/src/bin/lefthk-worker.rs
++++ b/leftwm/src/bin/lefthk-worker.rs
+@@ -3,24 +3,26 @@ use lefthk_core::{config::Config, worker::Worker};
+ #[cfg(feature = "lefthk")]
+ use xdg::BaseDirectories;
+ 
+-#[cfg(feature = "lefthk")]
+ fn main() {
+-    leftwm::utils::log::setup_logging();
++    #[cfg(feature = "lefthk")]
++    {
++        leftwm::utils::log::setup_logging();
+ 
+-    tracing::info!("lefthk-worker booted!");
++        tracing::info!("lefthk-worker booted!");
+ 
+-    let exit_status = std::panic::catch_unwind(|| {
+-        let rt = tokio::runtime::Runtime::new().expect("ERROR: couldn't init 
Tokio runtime");
+-        let _rt_guard = rt.enter();
+-        let config = leftwm::load();
+-        let path = BaseDirectories::with_prefix("leftwm-lefthk")
+-            .expect("ERROR: could not find base directory");
++        let exit_status = std::panic::catch_unwind(|| {
++            let rt = tokio::runtime::Runtime::new().expect("ERROR: couldn't 
init Tokio runtime");
++            let _rt_guard = rt.enter();
++            let config = leftwm::load();
++            let path = BaseDirectories::with_prefix("leftwm-lefthk")
++                .expect("ERROR: could not find base directory");
+ 
+-        rt.block_on(Worker::new(config.mapped_bindings(), path).event_loop());
+-    });
++            rt.block_on(Worker::new(config.mapped_bindings(), 
path).event_loop());
++        });
+ 
+-    match exit_status {
+-        Ok(_) => tracing::info!("Completed"),
+-        Err(err) => tracing::error!("Completed with error: {:?}", err),
++        match exit_status {
++            Ok(_) => tracing::info!("Completed"),
++            Err(err) => tracing::error!("Completed with error: {:?}", err),
++        }
+     }
+ }
+diff --git a/leftwm/src/config/keybind.rs b/leftwm/src/config/keybind.rs
+index 479aed7..c7886e9 100644
+--- a/leftwm/src/config/keybind.rs
++++ b/leftwm/src/config/keybind.rs
+@@ -173,6 +173,7 @@ impl Modifier {
+     }
+ }
+ 
++#[cfg(feature = "lefthk")]
+ fn is_valid_scratchpad_name(config: &Config, scratchpad_name: &str) -> bool {
+     config
+         .scratchpad
+diff --git a/leftwm/src/utils/log/mod.rs b/leftwm/src/utils/log/mod.rs
+index db8c178..e49042f 100644
+--- a/leftwm/src/utils/log/mod.rs
++++ b/leftwm/src/utils/log/mod.rs
+@@ -17,6 +17,7 @@ pub fn setup_logging() {
+         .expect("Couldn't setup global subscriber (logger)");
+ }
+ 
++#[allow(clippy::let_and_return)]
+ fn get_subscribers() -> impl Subscriber {
+     let env_filter = EnvFilter::builder()
+         .with_default_directive(LevelFilter::DEBUG.into())
+-- 
+2.35.1
+

diff --git a/x11-wm/leftwm/leftwm-0.4.0.ebuild 
b/x11-wm/leftwm/leftwm-0.4.0.ebuild
index 7b980ea26..868b0a204 100644
--- a/x11-wm/leftwm/leftwm-0.4.0.ebuild
+++ b/x11-wm/leftwm/leftwm-0.4.0.ebuild
@@ -167,22 +167,28 @@ LICENSE="
 "
 SLOT="0"
 KEYWORDS="~amd64"
-IUSE="systemd"
+IUSE="systemd lefthk syslog"
 
 DEPEND="
        x11-libs/libXinerama:0=
        x11-apps/xrandr:0=
        x11-base/xorg-server:0=
-       >=dev-lang/rust-1.52.0
+       >=dev-lang/rust-1.56.0
 "
 RDEPEND="${DEPEND}"
 
+PATCHES=(
+       "${FILESDIR}/${PV}/0001-Fix-no-default-features-build-failing-905.patch"
+)
+
 QA_FLAGS_IGNORED="usr/bin/.*"
 
 src_compile() {
        cd leftwm || die
-       use systemd && features="--features=journald"
-       cargo_src_compile ${features}
+       use systemd && features="--features=journald-log"
+       use lefthk && features="--features=lefthk"
+       use syslog && features="--features=sys-log"
+       cargo_src_compile --no-default-features ${features}
 }
 
 src_install() {
@@ -190,10 +196,22 @@ src_install() {
        make_desktop_entry leftwm.desktop /usr/share/xsessions/
        cd target/release || die
        dobin leftwm{,-worker,-state,-check,-command}
+       if use lefthk; then
+               dobin lefthk-worker
+       fi
+}
+
+src_test() {
+       cargo_src_test
 }
 
 pkg_postinst() {
        xdg_desktop_database_update
+       elog "Config file format moved to .ron"
+       elog "You need update your config file"
+       elog "Try leftwm-check --migrate-toml-to-ron"
+       elog "Or visit"
+       elog "https://github.com/leftwm/leftwm/wiki";
 }
 
 pkg_postrm() {

Reply via email to