From 5c1ad6b9247a0c8e04add9331ffd8aec6a5e4ddf Mon Sep 17 00:00:00 2001 From: Tobias Geerinckx-Rice Date: Wed, 3 Nov 2021 18:44:02 +0100 Subject: gnu: libblockdev: Update to 2.26. * gnu/packages/disk.scm (libblockdev): Update to 2.26. [source]: Remove patch. * gnu/packages/patches/libblockdev-glib-compat.patch: Delete file. * gnu/local.mk (dist_patch_DATA): Remove it. --- gnu/packages/patches/libblockdev-glib-compat.patch | 61 ---------------------- 1 file changed, 61 deletions(-) delete mode 100644 gnu/packages/patches/libblockdev-glib-compat.patch (limited to 'gnu/packages/patches') diff --git a/gnu/packages/patches/libblockdev-glib-compat.patch b/gnu/packages/patches/libblockdev-glib-compat.patch deleted file mode 100644 index bb25d5d963..0000000000 --- a/gnu/packages/patches/libblockdev-glib-compat.patch +++ /dev/null @@ -1,61 +0,0 @@ -Don't use g_memdup() which is removed in newer versions of GLib. - -See . - -Taken from upstream: -https://github.com/storaged-project/libblockdev/commit/5528baef6ccc835a06c45f9db34a2c9c3f2dd940 - -diff --git a/src/lib/plugin_apis/vdo.api b/src/lib/plugin_apis/vdo.api ---- a/src/lib/plugin_apis/vdo.api -+++ b/src/lib/plugin_apis/vdo.api -@@ -170,7 +170,22 @@ void bd_vdo_stats_free (BDVDOStats *stats) { - * Deprecated: 2.24: Use LVM-VDO integration instead. - */ - BDVDOStats* bd_vdo_stats_copy (BDVDOStats *stats) { -- return g_memdup (stats, sizeof (BDVDOStats)); -+ if (stats == NULL) -+ return NULL; -+ -+ BDVDOStats *new_stats = g_new0 (BDVDOStats, 1); -+ -+ new_stats->block_size = stats->block_size; -+ new_stats->logical_block_size = stats->logical_block_size; -+ new_stats->physical_blocks = stats->physical_blocks; -+ new_stats->data_blocks_used = stats->data_blocks_used; -+ new_stats->overhead_blocks_used = stats->overhead_blocks_used; -+ new_stats->logical_blocks_used = stats->logical_blocks_used; -+ new_stats->used_percent = stats->used_percent; -+ new_stats->saving_percent = stats->saving_percent; -+ new_stats->write_amplification_ratio = stats->write_amplification_ratio; -+ -+ return new_stats; - } - - GType bd_vdo_stats_get_type () { -diff --git a/src/plugins/vdo.c b/src/plugins/vdo.c ---- a/src/plugins/vdo.c -+++ b/src/plugins/vdo.c -@@ -81,7 +81,22 @@ void bd_vdo_stats_free (BDVDOStats *stats) { - } - - BDVDOStats* bd_vdo_stats_copy (BDVDOStats *stats) { -- return g_memdup (stats, sizeof (BDVDOStats)); -+ if (stats == NULL) -+ return NULL; -+ -+ BDVDOStats *new_stats = g_new0 (BDVDOStats, 1); -+ -+ new_stats->block_size = stats->block_size; -+ new_stats->logical_block_size = stats->logical_block_size; -+ new_stats->physical_blocks = stats->physical_blocks; -+ new_stats->data_blocks_used = stats->data_blocks_used; -+ new_stats->overhead_blocks_used = stats->overhead_blocks_used; -+ new_stats->logical_blocks_used = stats->logical_blocks_used; -+ new_stats->used_percent = stats->used_percent; -+ new_stats->saving_percent = stats->saving_percent; -+ new_stats->write_amplification_ratio = stats->write_amplification_ratio; -+ -+ return new_stats; - } - - -- cgit v1.2.3 From 575fcd3045ff1649e5319b6701ff9e28e97793e0 Mon Sep 17 00:00:00 2001 From: phodina Date: Wed, 13 Oct 2021 22:11:54 +0000 Subject: gnu: Add i3status-rust. * gnu/packages/rust-apps.scm (i3status-rust): New variable. * gnu/packages/patches/i3status-rust-enable-unstable-features.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. Signed-off-by: Efraim Flashner --- .../i3status-rust-enable-unstable-features.patch | 20 ++++++ gnu/packages/rust-apps.scm | 77 ++++++++++++++++++++++ 2 files changed, 97 insertions(+) create mode 100644 gnu/packages/patches/i3status-rust-enable-unstable-features.patch (limited to 'gnu/packages/patches') diff --git a/gnu/packages/patches/i3status-rust-enable-unstable-features.patch b/gnu/packages/patches/i3status-rust-enable-unstable-features.patch new file mode 100644 index 0000000000..535b45d865 --- /dev/null +++ b/gnu/packages/patches/i3status-rust-enable-unstable-features.patch @@ -0,0 +1,20 @@ +From 3006390c0058f06c255d9850327163aebcdc3b40 Mon Sep 17 00:00:00 2001 +From: Petr Hodina +Date: Mon, 11 Oct 2021 22:35:39 +0200 +Subject: [PATCH] Enable unstable features. + + +diff --git a/src/main.rs b/src/main.rs +index d9e964b..820e22e 100644 +--- a/src/main.rs ++++ b/src/main.rs +@@ -1,3 +1,6 @@ ++#![feature(bool_to_option)] ++#![feature(clamp)] ++ + #[macro_use] + mod de; + #[macro_use] +-- +2.33.0 + diff --git a/gnu/packages/rust-apps.scm b/gnu/packages/rust-apps.scm index 27cd57de8b..be60f3f376 100644 --- a/gnu/packages/rust-apps.scm +++ b/gnu/packages/rust-apps.scm @@ -12,6 +12,7 @@ ;;; Copyright © 2021 Zheng Junjie <873216071@qq.com> ;;; Copyright © 2021 Alexandru-Sergiu Marton ;;; Copyright © 2021 Maxim Cournoyer +;;; Copyright © 2021 Petr Hodina ;;; ;;; This file is part of GNU Guix. ;;; @@ -34,6 +35,8 @@ #:use-module (guix download) #:use-module (guix git-download) #:use-module (guix packages) + #:use-module (guix utils) + #:use-module (gnu packages) #:use-module (gnu packages admin) #:use-module (gnu packages compression) #:use-module (gnu packages crates-io) @@ -41,12 +44,14 @@ #:use-module (gnu packages curl) #:use-module (gnu packages documentation) #:use-module (gnu packages fontutils) + #:use-module (gnu packages glib) #:use-module (gnu packages gtk) #:use-module (gnu packages jemalloc) #:use-module (gnu packages linux) #:use-module (gnu packages ssh) #:use-module (gnu packages pcre) #:use-module (gnu packages pkg-config) + #:use-module (gnu packages pulseaudio) #:use-module (gnu packages python-xyz) #:use-module (gnu packages rust) #:use-module (gnu packages tls) @@ -440,6 +445,78 @@ characters, ASCII whitespace characters, other ASCII characters and non-ASCII.") "This package provides a command-line benchmarking tool.") (license (list license:expat license:asl2.0)))) +(define-public i3status-rust + (package + (name "i3status-rust") + (version "0.20.1") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/greshake/i3status-rust") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (patches (search-patches "i3status-rust-enable-unstable-features.patch")) + (sha256 + (base32 "00gzm3g297s9bfp13vnb623p7dfac3g6cdhz2b3lc6l0kmnnqs1s")))) + (build-system cargo-build-system) + (native-inputs + `(("pkg-config" ,pkg-config))) + (inputs + `(("curl" ,curl) + ("dbus" ,dbus) + ("pulseaudio" ,pulseaudio) + ("openssl" ,openssl) + ("zlib" ,zlib))) + (arguments + `(#:features '("pulseaudio" "libpulse-binding") + #:install-source? #f + #:cargo-inputs + (("rust-chrono" ,rust-chrono-0.4) + ("rust-chrono-tz" ,rust-chrono-tz-0.5) + ("rust-crossbeam-channel" ,rust-crossbeam-channel-0.5) + ("rust-curl" ,rust-curl-0.4) + ("rust-dbus" ,rust-dbus-0.9) + ("rust-dbus-tree" ,rust-dbus-tree-0.9) + ("rust-lazy-static" ,rust-lazy-static-1) + ("rust-nix" ,rust-nix-0.20) + ("rust-nl80211" ,rust-nl80211-0.0.2) + ("rust-serde" ,rust-serde-1) + ("rust-serde-derive" ,rust-serde-derive-1) + ("rust-serde-json" ,rust-serde-json-1) + ("rust-signal-hook" ,rust-signal-hook-0.3) + ("rust-swayipc" ,rust-swayipc-2) + ("rust-toml" ,rust-toml-0.5) + ("rust-cpuprofiler" ,rust-cpuprofiler-0.0) + ("rust-inotify" ,rust-inotify-0.9) + ("rust-libpulse-binding" ,rust-libpulse-binding-2) + ("rust-maildir" ,rust-maildir-0.5) + ("rust-notmuch" ,rust-notmuch-0.6) + ("rust-progress" ,rust-progress-0.2)) + #:cargo-development-inputs + (("rust-assert-fs" ,rust-assert-fs-1)) + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'fix-resources-path + (lambda* (#:key outputs #:allow-other-keys) + (let ((resources (string-append %output "/share"))) + (substitute* "src/util.rs" + (("/usr/share/i3status-rust") resources))))) + (add-after 'install 'install-resources + (lambda* (#:key outputs #:allow-other-keys) + (copy-recursively "files" (string-append %output "/share")))) + (add-after 'unpack 'enable-unstable-features + (lambda _ + (setenv "RUSTC_BOOTSTRAP" "1") + #t))))) + (home-page "https://github.com/greshake/i3status-rust") + (synopsis "i3status, written in pure Rust") + (description "@code{i3status-rs} is a feature-rich and resource-friendly +replacement for i3status, written in pure Rust. It provides a way to display +@code{blocks} of system information (time, battery status, volume, etc) on the i3 +bar. It is also compatible with sway.") + (license license:gpl3))) + (define-public ripgrep (package (name "ripgrep") -- cgit v1.2.3