guix_mirror_bot pushed a commit to branch master
in repository guix.
commit 099f060c887295a47ce6dcbb99256f2a9c7da0fe
Author: stampede <[email protected]>
AuthorDate: Thu Oct 29 14:56:29 2026 +0300
gnu: Add noctalia-material-color-utilities-cpp
* gnu/packages/graphics.scm (noctalia-material-color-utilities-cpp): New
variable.
* gnu/packags/patches/noctalia-material-color-utilities-cpp-patch.patch:
New file.
* gnu/local.mk (dist_patch_DATA): Register it.
---
gnu/local.mk | 2 +
gnu/packages/graphics.scm | 31 ++++++++++++
...ctalia-material-color-utilities-cpp-patch.patch | 59 ++++++++++++++++++++++
3 files changed, 92 insertions(+)
diff --git a/gnu/local.mk b/gnu/local.mk
index 91eaee6574e..94420cf5b98 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -78,6 +78,7 @@
# Copyright © 2025 bdunahu <[email protected]>
# Copyright © 2026 Simen Endsjø <[email protected]>
# Copyright © 2026 Goran Vukoman <[email protected]>
+# Copyright © 2026 Stampede <[email protected]>
#
# This file is part of GNU Guix.
#
@@ -2058,6 +2059,7 @@ dist_patch_DATA =
\
%D%/packages/patches/ngit-cli-tests-libgit2-version.patch \
%D%/packages/patches/nlopt_CMake-Assume-working-c-compiler-597.patch \
%D%/packages/patches/nnpack-system-libraries.patch \
+ %D%/packages/patches/noctalia-material-color-utilities-cpp-patch.patch
\
%D%/packages/patches/noctalia-shell-system-libraries.patch \
%D%/packages/patches/node-latest-i686.patch \
%D%/packages/patches/nsis-env-passthru.patch \
diff --git a/gnu/packages/graphics.scm b/gnu/packages/graphics.scm
index 7114a6ecc02..8efb1d3ad99 100644
--- a/gnu/packages/graphics.scm
+++ b/gnu/packages/graphics.scm
@@ -48,6 +48,7 @@
;;; Copyright © 2026 Nguyễn Gia Phong <[email protected]>
;;; Copyright © 2026 Rodion Goritskov <[email protected]>
;;; Copyright © 2026 Sergio Pastor Pérez <[email protected]>
+;;; Copyright © 2026 Stampede <[email protected]>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -3725,6 +3726,36 @@ supports blending, contrast calculation, HCT colors,
tonal palettes,
quantization, scoring, temperature calculations, and Material color schemes.")
(license license:asl2.0))))
+(define-public noctalia-material-color-utilities-cpp
+ ;; Upstream Noctalia developers say that the cpp part of
+ ;; material color utilites is unmaintained for 2 years
+ ;; and this is a patched version to make colors look right
+ ;; in Noctalia
+ (let ((commit "1a34bd2d696a5dd669beca679546ad72209d0937")
+ (revision "0"))
+ (package
+ (inherit material-color-utilities-cpp)
+ (name "noctalia-material-color-utilities-cpp")
+ (version (git-version "0" revision commit))
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url (string-append "https://github.com/material-foundation/"
+ "material-color-utilities"))
+ (commit commit)))
+ (file-name (git-file-name name version))
+ (patches
+ (search-patches "material-color-utilities-cpp-build.patch"
+ "noctalia-material-color-utilities-cpp-patch.patch"))
+ (sha256
+ (base32 "0cjlr0s5bh752zajcsf64rd4wn01nzcndfn4yw32z5mlak47b19a"))))
+ (synopsis "Noctalia's patched material color utilities")
+ (description
+ "This is a patched material color utilities cpp package for use in
+Noctalia-shell. It modifies quantization and temperature calculations compared
+to the original package."))))
+
(define-public meshoptimizer
(package
(name "meshoptimizer")
diff --git
a/gnu/packages/patches/noctalia-material-color-utilities-cpp-patch.patch
b/gnu/packages/patches/noctalia-material-color-utilities-cpp-patch.patch
new file mode 100644
index 00000000000..c9e196b5b7d
--- /dev/null
+++ b/gnu/packages/patches/noctalia-material-color-utilities-cpp-patch.patch
@@ -0,0 +1,59 @@
+This is a patch to fix some of the color generation. It is provided
+by the upstream Noctalia developers.
+
+--- a/cpp/quantize/wsmeans.cc
++++ b/cpp/quantize/wsmeans.cc
+@@ -27,7 +27,6 @@
+ #include <unordered_set>
+ #include <vector>
+
+-#include "absl/container/flat_hash_map.h"
+ #include "cpp/quantize/lab.h"
+
+ constexpr int kMaxIterations = 100;
+@@ -64,7 +63,7 @@
+ }
+
+ uint32_t pixel_count = input_pixels.size();
+- absl::flat_hash_map<Argb, int> pixel_to_count;
++ std::unordered_map<Argb, int> pixel_to_count;
+ std::vector<uint32_t> pixels;
+ pixels.reserve(pixel_count);
+ std::vector<Lab> points;
+@@ -75,7 +74,7 @@
+ // std::unordered_map 10.2 ms
+ // absl::btree_map 9.0 ms
+ // absl::flat_hash_map 8.0 ms
+- absl::flat_hash_map<Argb, int>::iterator it = pixel_to_count.find(pixel);
++ std::unordered_map<Argb, int>::iterator it = pixel_to_count.find(pixel);
+ if (it != pixel_to_count.end()) {
+ it->second++;
+
+
+--- a/cpp/utils/utils.cc
++++ b/cpp/utils/utils.cc
+@@ -22,9 +22,9 @@
+ #include <cmath>
+ #include <cstdint>
+ #include <cstdio>
++#include <sstream>
++#include <iomanip>
+ #include <string>
+-
+-#include "absl/strings/str_cat.h"
+
+ namespace material_color_utilities {
+
+@@ -140,7 +140,11 @@
+ // Converts a color in ARGB format to a hexadecimal string in lowercase.
+ //
+ // For instance: hex_from_argb(0xff012345) == "ff012345"
+-std::string HexFromArgb(Argb argb) { return absl::StrCat(absl::Hex(argb)); }
++std::string HexFromArgb(Argb argb) {
++ std::ostringstream os;
++ os << std::hex << argb;
++ return os.str();
++}
+
+ Argb IntFromLstar(const double lstar) {
+ double y = YFromLstar(lstar);