From 455d916d0c1750d67b097386947fc52d1bb2f28d Mon Sep 17 00:00:00 2001 From: TomaSajt <62384384+TomaSajt@users.noreply.github.com> Date: Sat, 11 Jul 2026 03:13:39 +0200 Subject: [PATCH 1/2] python3Packages.catppuccin: fix build with matplotlib 3.11+ --- .../python-modules/catppuccin/default.nix | 5 +++ .../catppuccin/matplotlib-3.11.patch | 37 +++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 pkgs/development/python-modules/catppuccin/matplotlib-3.11.patch diff --git a/pkgs/development/python-modules/catppuccin/default.nix b/pkgs/development/python-modules/catppuccin/default.nix index 87a1e7b6f592..8e7a775de2f1 100644 --- a/pkgs/development/python-modules/catppuccin/default.nix +++ b/pkgs/development/python-modules/catppuccin/default.nix @@ -22,6 +22,11 @@ buildPythonPackage (finalAttrs: { hash = "sha256-wumJ8kpr+C2pdw8jYf+IqYTdSB6Iy37yZqPKycYmOSs="; }; + patches = [ + # https://github.com/catppuccin/python/pull/130 + ./matplotlib-3.11.patch + ]; + build-system = [ hatchling ]; optional-dependencies = { diff --git a/pkgs/development/python-modules/catppuccin/matplotlib-3.11.patch b/pkgs/development/python-modules/catppuccin/matplotlib-3.11.patch new file mode 100644 index 000000000000..6d21107c492c --- /dev/null +++ b/pkgs/development/python-modules/catppuccin/matplotlib-3.11.patch @@ -0,0 +1,37 @@ +From 11ab7be947064f11453f1063f63455b343b7253d Mon Sep 17 00:00:00 2001 +From: Raziman T V +Date: Fri, 3 Jul 2026 13:36:29 +0100 +Subject: [PATCH] Fix #129 (caused by matplotlib 3.11 deprecating + mpl.style.core) by direct implementation + +--- + catppuccin/extras/matplotlib.py | 9 +++++---- + 1 file changed, 5 insertions(+), 4 deletions(-) + +diff --git a/catppuccin/extras/matplotlib.py b/catppuccin/extras/matplotlib.py +index 52934d1..f0ffafb 100644 +--- a/catppuccin/extras/matplotlib.py ++++ b/catppuccin/extras/matplotlib.py +@@ -72,6 +72,7 @@ + import matplotlib as mpl + import matplotlib.colors + import matplotlib.style ++from matplotlib import rc_params_from_file + + from catppuccin.palette import PALETTE + +@@ -84,10 +85,10 @@ + + def _register_styles() -> None: + """Register the included stylesheets in the mpl style library.""" +- catppuccin_stylesheets = mpl.style.core.read_style_directory( # type: ignore [attr-defined] +- CATPPUCCIN_STYLE_DIRECTORY +- ) +- mpl.style.core.update_nested_dict(mpl.style.library, catppuccin_stylesheets) # type: ignore [attr-defined] ++ for path in Path(CATPPUCCIN_STYLE_DIRECTORY).glob(f"*.mplstyle"): ++ stylename = path.stem ++ style = rc_params_from_file(path, use_default_template=False) ++ mpl.style.library.setdefault(stylename, {}).update(style) + + + def _register_colormap_list() -> None: From 894acc94f63aae4b9483cf5d9f64c183398e2454 Mon Sep 17 00:00:00 2001 From: TomaSajt <62384384+TomaSajt@users.noreply.github.com> Date: Sat, 11 Jul 2026 11:09:26 +0200 Subject: [PATCH 2/2] catppuccin-gtk: fix build with python314+ --- pkgs/by-name/ca/catppuccin-gtk/package.nix | 5 ++++- .../ca/catppuccin-gtk/python-3.14.patch | 20 +++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 pkgs/by-name/ca/catppuccin-gtk/python-3.14.patch diff --git a/pkgs/by-name/ca/catppuccin-gtk/package.nix b/pkgs/by-name/ca/catppuccin-gtk/package.nix index 256f5d549fe3..f0b16b2eb9b2 100644 --- a/pkgs/by-name/ca/catppuccin-gtk/package.nix +++ b/pkgs/by-name/ca/catppuccin-gtk/package.nix @@ -75,7 +75,10 @@ lib.checkListOfEnum "${pname}: theme accent" validAccents accents lib.checkListO hash = "sha256-q5/VcFsm3vNEw55zq/vcM11eo456SYE5TQA3g2VQjGc="; }; - patches = [ ./fix-inconsistent-theme-name.patch ]; + patches = [ + ./fix-inconsistent-theme-name.patch + ./python-3.14.patch # Fix build with python 3.14+ + ]; nativeBuildInputs = [ gtk3 diff --git a/pkgs/by-name/ca/catppuccin-gtk/python-3.14.patch b/pkgs/by-name/ca/catppuccin-gtk/python-3.14.patch new file mode 100644 index 000000000000..93b4cc868349 --- /dev/null +++ b/pkgs/by-name/ca/catppuccin-gtk/python-3.14.patch @@ -0,0 +1,20 @@ +diff --git a/sources/build/args.py b/sources/build/args.py +index 38a0a12..9221dec 100644 +--- a/sources/build/args.py ++++ b/sources/build/args.py +@@ -84,7 +84,6 @@ def parse_args(): + parser.add_argument( + "--zip", + help="Whether to bundle the theme into a zip", +- type=bool, + default=False, + action=argparse.BooleanOptionalAction, + ) +@@ -92,7 +91,6 @@ def parse_args(): + parser.add_argument( + "--patch", + help="Whether to patch the colloid submodule", +- type=bool, + default=True, + action=argparse.BooleanOptionalAction, + )