From f91c4d43eaad88736dd27c3fe2c69cb6e43a5d92 Mon Sep 17 00:00:00 2001 From: isabel Date: Mon, 10 Jun 2024 14:15:52 +0100 Subject: [PATCH] catppuccin-gtk: 0.7.5 -> 1.0.3 --- .../ca/catppuccin-gtk/package.nix} | 55 ++++++++----------- .../colloid-src-git-reset.patch | 17 ------ pkgs/top-level/all-packages.nix | 2 - 3 files changed, 22 insertions(+), 52 deletions(-) rename pkgs/{data/themes/catppuccin-gtk/default.nix => by-name/ca/catppuccin-gtk/package.nix} (56%) delete mode 100644 pkgs/data/themes/catppuccin-gtk/colloid-src-git-reset.patch diff --git a/pkgs/data/themes/catppuccin-gtk/default.nix b/pkgs/by-name/ca/catppuccin-gtk/package.nix similarity index 56% rename from pkgs/data/themes/catppuccin-gtk/default.nix rename to pkgs/by-name/ca/catppuccin-gtk/package.nix index 49fbade1a88a..5bc1ffbcecab 100644 --- a/pkgs/data/themes/catppuccin-gtk/default.nix +++ b/pkgs/by-name/ca/catppuccin-gtk/package.nix @@ -2,9 +2,8 @@ , stdenvNoCC , fetchFromGitHub , gtk3 +, git , colloid-gtk-theme -, gnome-themes-extra -, gtk-engine-murrine , python3 , sassc , nix-update-script @@ -20,6 +19,7 @@ let validVariants = [ "latte" "frappe" "macchiato" "mocha" ]; pname = "catppuccin-gtk"; + version = "1.0.3"; in lib.checkListOfEnum "${pname}: theme accent" validAccents accents @@ -27,38 +27,29 @@ lib.checkListOfEnum "${pname}: color variant" validVariants [variant] lib.checkListOfEnum "${pname}: size variant" validSizes [size] lib.checkListOfEnum "${pname}: tweaks" validTweaks tweaks -stdenvNoCC.mkDerivation rec { - inherit pname; - version = "0.7.5"; +stdenvNoCC.mkDerivation { + inherit pname version; src = fetchFromGitHub { owner = "catppuccin"; repo = "gtk"; rev = "v${version}"; - hash = "sha256-DIeMdkEjIcPIf/EgE83F5URHY+lR2+hxdc4wSrruFJ8="; + hash = "sha256-8KyZtZqVVz5UKuGdLrUsR2djD3nsJDliHMtvFtUVim8="; }; - nativeBuildInputs = [ gtk3 sassc ]; - - patches = [ - ./colloid-src-git-reset.patch - ]; - - buildInputs = [ - gnome-themes-extra + nativeBuildInputs = [ + gtk3 + sassc + # git is needed here since "git apply" is being used for patches + # see + git (python3.withPackages (ps: [ ps.catppuccin ])) ]; - propagatedUserEnvPkgs = [ gtk-engine-murrine ]; - postUnpack = '' - rm -rf source/colloid - cp -r ${colloid-gtk-theme.src} source/colloid - chmod -R +w source/colloid - ''; - - postPatch = '' - patchShebangs --build colloid/install.sh colloid/build.sh + rm -rf source/sources/colloid + cp -r ${colloid-gtk-theme.src} source/sources/colloid + chmod -R +w source/sources/colloid ''; dontConfigure = true; @@ -67,14 +58,12 @@ stdenvNoCC.mkDerivation rec { installPhase = '' runHook preInstall - cp -r colloid colloid-base mkdir -p $out/share/themes - export HOME=$(mktemp -d) - python3 install.py ${variant} \ - ${lib.optionalString (accents != []) "--accent " + builtins.toString accents} \ - ${lib.optionalString (size != []) "--size " + size} \ - ${lib.optionalString (tweaks != []) "--tweaks " + builtins.toString tweaks} \ + python3 build.py ${variant} \ + --accent ${builtins.toString accents} \ + ${lib.optionalString (size != [ ]) "--size " + size} \ + ${lib.optionalString (tweaks != [ ]) "--tweaks " + builtins.toString tweaks} \ --dest $out/share/themes runHook postInstall @@ -82,11 +71,11 @@ stdenvNoCC.mkDerivation rec { passthru.updateScript = nix-update-script { }; - meta = with lib; { + meta = { description = "Soothing pastel theme for GTK"; homepage = "https://github.com/catppuccin/gtk"; - license = licenses.gpl3Plus; - platforms = platforms.linux; - maintainers = with maintainers; [ fufexan dixslyf ]; + license = lib.licenses.gpl3Plus; + platforms = lib.platforms.all; + maintainers = with lib.maintainers; [ fufexan dixslyf isabelroses ]; }; } diff --git a/pkgs/data/themes/catppuccin-gtk/colloid-src-git-reset.patch b/pkgs/data/themes/catppuccin-gtk/colloid-src-git-reset.patch deleted file mode 100644 index 7ee1f4bd9b6f..000000000000 --- a/pkgs/data/themes/catppuccin-gtk/colloid-src-git-reset.patch +++ /dev/null @@ -1,17 +0,0 @@ -diff --git a/scripts/create_theme.py b/scripts/create_theme.py -index 074dc43..7e7a8eb 100644 ---- a/scripts/create_theme.py -+++ b/scripts/create_theme.py -@@ -34,7 +34,11 @@ def create_theme(types: List[str], accents: List[str], dest: str, link: bool = F - os.chdir(work_dir) - subprocess.call("./build.sh", shell=True) # Rebuild all scss - subprocess.call(install_cmd, shell=True) # Install the theme globally for you -- subprocess.call("git reset --hard HEAD", shell=True) # reset colloid repo to original state -+ # subprocess.call("git reset --hard HEAD", shell=True) # reset colloid repo to original state -+ # recreate git reset -+ os.chdir(repo_dir) -+ shutil.rmtree("colloid") -+ shutil.copytree("colloid-base", "colloid") - - try: - # Rename colloid generated files as per catppuccin diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 169e0f6bc72c..419a34777311 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -417,8 +417,6 @@ with pkgs; catatonit = callPackage ../applications/virtualization/catatonit { }; - catppuccin-gtk = callPackage ../data/themes/catppuccin-gtk { }; - catppuccin-kde = callPackage ../data/themes/catppuccin-kde { }; catppuccin-kvantum = callPackage ../data/themes/catppuccin-kvantum { };