pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

shells/powerlevel10k: Fix build with GCC 14 in bundled gitstatus



Module Name:	pkgsrc-wip
Committed By:	ci4ic4 <ci4ic4%gmail.com@localhost>
Pushed By:	ci4ic4
Date:		Wed May 20 22:43:09 2026 +0100
Changeset:	386378a9bcb0da6a41b4a6537c9a00359635f39c

Modified Files:
	powerlevel10k/distinfo
Added Files:
	powerlevel10k/patches/patch-gitstatus_src_index.cc
	powerlevel10k/patches/patch-gitstatus_src_tag_db.cc

Log Message:
shells/powerlevel10k: Fix build with GCC 14 in bundled gitstatus

Add patches for gitstatus src/index.cc and src/tag_db.cc to resolve
GCC 14 build failures. Update distinfo with patch checksums.

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=386378a9bcb0da6a41b4a6537c9a00359635f39c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 powerlevel10k/distinfo                              |  2 ++
 powerlevel10k/patches/patch-gitstatus_src_index.cc  | 20 ++++++++++++++++++++
 powerlevel10k/patches/patch-gitstatus_src_tag_db.cc | 18 ++++++++++++++++++
 3 files changed, 40 insertions(+)

diffs:
diff --git a/powerlevel10k/distinfo b/powerlevel10k/distinfo
index 6a9adca6f4..473f291cdc 100644
--- a/powerlevel10k/distinfo
+++ b/powerlevel10k/distinfo
@@ -6,3 +6,5 @@ Size (libgit2-tag-2ecf33948a4df9ef45a66c68b8ef24a5e60eaac6.tar.gz) = 1518446 byt
 BLAKE2s (powerlevel10k-1.20.0.tar.gz) = 1f0127857467f421316df63e92f30f5cad2712e0eeb526cc126763c884ef4959
 SHA512 (powerlevel10k-1.20.0.tar.gz) = edfcd461e01ba3a88c52e52275f0fdeefce412df717f950cb786d46f98371853ce48542f987ed3020223fd18098da9e7d146653f370bd31baaad0221b9fa924b
 Size (powerlevel10k-1.20.0.tar.gz) = 385278 bytes
+SHA1 (patch-gitstatus_src_index.cc) = aab4ceb0165fd5f82297d1bff27c78f0cffbb115
+SHA1 (patch-gitstatus_src_tag_db.cc) = 8895e40b25e0daefb802681367e5946a33955494
diff --git a/powerlevel10k/patches/patch-gitstatus_src_index.cc b/powerlevel10k/patches/patch-gitstatus_src_index.cc
new file mode 100644
index 0000000000..be150eaa91
--- /dev/null
+++ b/powerlevel10k/patches/patch-gitstatus_src_index.cc
@@ -0,0 +1,20 @@
+$NetBSD$
+
+Fix build with GCC 14: entry[-1] accesses the d_type byte stored before the
+path string (by design per dir.h). Suppress false-positive array-bounds
+warning with a GCC diagnostic pragma.
+
+--- gitstatus/src/index.cc.orig	2026-05-16 17:06:03.393586436 +0100
++++ gitstatus/src/index.cc	2026-05-16 17:06:36.603689498 +0100
+@@ -292,7 +292,10 @@
+ 
+       if (!matched) {
+         StringView basename(entry);
+-        if (entry[-1] == DT_DIR) entry[basename.len++] = '/';
++  #pragma GCC diagnostic push
++#pragma GCC diagnostic ignored "-Warray-bounds"
++      if (entry[-1] == DT_DIR) entry[basename.len++] = '/';
++#pragma GCC diagnostic pop
+         AddUnmached(basename);
+       }
+     }
diff --git a/powerlevel10k/patches/patch-gitstatus_src_tag_db.cc b/powerlevel10k/patches/patch-gitstatus_src_tag_db.cc
new file mode 100644
index 0000000000..2e3300ed16
--- /dev/null
+++ b/powerlevel10k/patches/patch-gitstatus_src_tag_db.cc
@@ -0,0 +1,18 @@
+$NetBSD$
+
+Fix build with GCC 14: std::unique_lock constructor is [[nodiscard]] so a
+temporary unique_lock in a comma expression causes -Werror=unused-result.
+Split into a named lock variable.
+
+--- gitstatus/src/tag_db.cc.orig	2026-05-16 17:06:03.121364290 +0100
++++ gitstatus/src/tag_db.cc	2026-05-16 17:06:17.624705848 +0100
+@@ -130,7 +130,8 @@
+     if (res < tag && TagHasTarget(ref.c_str(), &oid)) res = tag;
+   }
+ 
+-  if ((std::unique_lock<std::mutex>(mutex_), id2name_dirty_)) {
++  std::unique_lock<std::mutex> lock(mutex_);
++  if (id2name_dirty_) {
+     for (auto it = name2id_.rbegin(); it != name2id_.rend(); ++it) {
+       if (!memcmp((*it)->id.id, oid.id, GIT_OID_RAWSZ) && !IsLooseTag((*it)->name)) {
+         if (res < (*it)->name) res = (*it)->name;


Home | Main Index | Thread Index | Old Index