about summary refs log tree commit diff
diff options
context:
space:
mode:
authoreljamm <fedi.jamoussi@protonmail.ch>2024-07-02 22:50:01 +0100
committereljamm <fedi.jamoussi@protonmail.ch>2024-07-03 09:45:42 +0100
commitf9f41717b54478cf89373dbf361a16e648d0f902 (patch)
treeabc468b787fdaaafc607bd14f9550ac7a106daac
parente9e138083f23a194906645abbad2a5b304f52acb (diff)
catppuccin-gtk: fix inconsistent theme name
-rw-r--r--pkgs/by-name/ca/catppuccin-gtk/fix-inconsistent-theme-name.patch32
-rw-r--r--pkgs/by-name/ca/catppuccin-gtk/package.nix2
2 files changed, 34 insertions, 0 deletions
diff --git a/pkgs/by-name/ca/catppuccin-gtk/fix-inconsistent-theme-name.patch b/pkgs/by-name/ca/catppuccin-gtk/fix-inconsistent-theme-name.patch
new file mode 100644
index 0000000000000..2a64a449d7549
--- /dev/null
+++ b/pkgs/by-name/ca/catppuccin-gtk/fix-inconsistent-theme-name.patch
@@ -0,0 +1,32 @@
+The theme name uses `default` as fallback for tweaks when they aren't
+set, which not only is not a valid tweak name, but can lead to confusion 
+and inconsistencies (See: https://github.com/catppuccin/nix/pull/261).
+---
+ sources/build/context.py | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/sources/build/context.py b/sources/build/context.py
+index 3d43c01..6167f14 100644
+--- a/sources/build/context.py
++++ b/sources/build/context.py
+@@ -45,7 +45,8 @@ class BuildContext:
+         return f"{self.output_root}/{self.build_id()}"
+ 
+     def build_id(self) -> str:
+-        return f"{self.theme_name}-{self.flavor.identifier}-{self.accent.identifier}-{self.size}+{self.tweaks.id() or 'default'}"
++        tweaks = f"+{self.tweaks.id()}" if self.tweaks.id() != "" else ""
++        return f"{self.theme_name}-{self.flavor.identifier}-{self.accent.identifier}-{self.size}" + tweaks
+ 
+     def apply_suffix(self, suffix: Suffix) -> str:
+         if suffix.test(self):
+@@ -59,6 +60,7 @@ class BuildContext:
+             Subsitution(find=f"\\${key}: {default}", replace=f"${key}: {value}"),
+         )
+ 
++
+ IS_DARK = Suffix(true_value="-Dark", test=lambda ctx: ctx.flavor.dark)
+ IS_LIGHT = Suffix(true_value="-Light", test=lambda ctx: not ctx.flavor.dark)
+ IS_WINDOW_NORMAL = Suffix(
+-- 
+2.45.1
+
diff --git a/pkgs/by-name/ca/catppuccin-gtk/package.nix b/pkgs/by-name/ca/catppuccin-gtk/package.nix
index db7a3295903b7..964e631c9cade 100644
--- a/pkgs/by-name/ca/catppuccin-gtk/package.nix
+++ b/pkgs/by-name/ca/catppuccin-gtk/package.nix
@@ -37,6 +37,8 @@ stdenvNoCC.mkDerivation {
     hash = "sha256-q5/VcFsm3vNEw55zq/vcM11eo456SYE5TQA3g2VQjGc=";
   };
 
+  patches = [ ./fix-inconsistent-theme-name.patch ];
+
   nativeBuildInputs = [
     gtk3
     sassc