Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport release-24.05] catppuccin-gtk: 0.7.5 -> 1.0.3, use vendored colloid-gtk-theme #321867

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
, stdenvNoCC
, fetchFromGitHub
, gtk3
, colloid-gtk-theme
, gnome-themes-extra
, gtk-engine-murrine
, git
, python3
, sassc
, nix-update-script
Expand All @@ -20,73 +18,58 @@ let
validVariants = [ "latte" "frappe" "macchiato" "mocha" ];

pname = "catppuccin-gtk";
version = "1.0.3";
in

lib.checkListOfEnum "${pname}: theme accent" validAccents accents
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=";
fetchSubmodules = true;
hash = "sha256-q5/VcFsm3vNEw55zq/vcM11eo456SYE5TQA3g2VQjGc=";
};

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 <https://github.com/catppuccin/gtk/blob/4173b70b910bbb3a42ef0e329b3e98d53cef3350/build.py#L465>
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
'';

dontConfigure = true;
dontBuild = true;

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
'';

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 ];
};
}
17 changes: 0 additions & 17 deletions pkgs/data/themes/catppuccin-gtk/colloid-src-git-reset.patch

This file was deleted.

2 changes: 0 additions & 2 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -421,8 +421,6 @@ with pkgs;

catppuccin-catwalk = callPackage ../development/tools/misc/catppuccin-catwalk { };

catppuccin-gtk = callPackage ../data/themes/catppuccin-gtk { };

catppuccin-kde = callPackage ../data/themes/catppuccin-kde { };

catppuccin-kvantum = callPackage ../data/themes/catppuccin-kvantum { };
Expand Down