commit:     e6f1926d1b73035f496c7bafe11c5c1da9aba041
Author:     Ben Kohler <bkohler <AT> gentoo <DOT> org>
AuthorDate: Wed Sep 27 17:20:17 2023 +0000
Commit:     Ben Kohler <bkohler <AT> gentoo <DOT> org>
CommitDate: Wed Sep 27 17:56:15 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e6f1926d

x11-misc/i3blocks-contrib: fix clang/llvm build

Closes: https://bugs.gentoo.org/832200

Signed-off-by: Ben Kohler <bkohler <AT> gentoo.org>

 ...cks-contrib-2.0.0-fix-build-on-clang-llvm.patch | 25 ++++++++++++++++++++++
 .../i3blocks-contrib/i3blocks-contrib-2.0.0.ebuild |  5 ++++-
 2 files changed, 29 insertions(+), 1 deletion(-)

diff --git 
a/x11-misc/i3blocks-contrib/files/i3blocks-contrib-2.0.0-fix-build-on-clang-llvm.patch
 
b/x11-misc/i3blocks-contrib/files/i3blocks-contrib-2.0.0-fix-build-on-clang-llvm.patch
new file mode 100644
index 000000000000..bf92d791df55
--- /dev/null
+++ 
b/x11-misc/i3blocks-contrib/files/i3blocks-contrib-2.0.0-fix-build-on-clang-llvm.patch
@@ -0,0 +1,25 @@
+From 230f42f5bc5ebc44062820bde1e9e40ae0746c00 Mon Sep 17 00:00:00 2001
+From: Corentin Rondier <[email protected]>
+Date: Sun, 24 Sep 2023 23:22:58 +0200
+Subject: [PATCH] cpu_usage2: fix build failures on clang/llvm
+
+Remove a non-standard suffix on a floating-point literal, causing build 
failures on clang/LLVM
+
+fixes #504
+---
+ cpu_usage2/cpu_usage2.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/cpu_usage2/cpu_usage2.c b/cpu_usage2/cpu_usage2.c
+index 72709037..483c4c81 100644
+--- a/cpu_usage2/cpu_usage2.c
++++ b/cpu_usage2/cpu_usage2.c
+@@ -124,7 +124,7 @@ int main(int argc, char *argv[])
+     sleep(t);
+     total = get_usage(&used);
+ 
+-    display(label, 100.0D * (used - old_used) / (total - old_total),
++    display(label, 100.0 * (used - old_used) / (total - old_total),
+             warning, critical, decimals);
+     fflush(stdout);
+     old_total = total;

diff --git a/x11-misc/i3blocks-contrib/i3blocks-contrib-2.0.0.ebuild 
b/x11-misc/i3blocks-contrib/i3blocks-contrib-2.0.0.ebuild
index 2ee22731467a..8d3664dbaec5 100644
--- a/x11-misc/i3blocks-contrib/i3blocks-contrib-2.0.0.ebuild
+++ b/x11-misc/i3blocks-contrib/i3blocks-contrib-2.0.0.ebuild
@@ -16,7 +16,10 @@ DEPEND=""
 RDEPEND=">=x11-misc/i3blocks-1.5"
 BDEPEND=""
 
-PATCHES=( "${FILESDIR}"/${P}-respect-CFLAGS.patch )
+PATCHES=(
+       "${FILESDIR}"/${P}-respect-CFLAGS.patch
+       "${FILESDIR}"/${P}-fix-build-on-clang-llvm.patch
+)
 
 src_prepare() {
        sed -i -e '/^$(_BLOCKS):/ s/$/ installdirs/' Makefile

Reply via email to