evcc: 0.131.4 -> 0.131.5
[NixPkgs.git] / pkgs / by-name / ca / catppuccin-gtk / package.nix
blob964e631c9cade96d90a37d85b218f6fb301408db
1 { lib
2 , stdenvNoCC
3 , fetchFromGitHub
4 , gtk3
5 , git
6 , python3
7 , sassc
8 , nix-update-script
9 , accents ? [ "blue" ]
10 , size ? "standard"
11 , tweaks ? [ ]
12 , variant ? "frappe"
14 let
15   validAccents = [ "blue" "flamingo" "green" "lavender" "maroon" "mauve" "peach" "pink" "red" "rosewater" "sapphire" "sky" "teal" "yellow" ];
16   validSizes = [ "standard" "compact" ];
17   validTweaks = [ "black" "rimless" "normal" "float" ];
18   validVariants = [ "latte" "frappe" "macchiato" "mocha" ];
20   pname = "catppuccin-gtk";
21   version = "1.0.3";
24 lib.checkListOfEnum "${pname}: theme accent" validAccents accents
25 lib.checkListOfEnum "${pname}: color variant" validVariants [variant]
26 lib.checkListOfEnum "${pname}: size variant" validSizes [size]
27 lib.checkListOfEnum "${pname}: tweaks" validTweaks tweaks
29 stdenvNoCC.mkDerivation {
30   inherit pname version;
32   src = fetchFromGitHub {
33     owner = "catppuccin";
34     repo = "gtk";
35     rev = "v${version}";
36     fetchSubmodules = true;
37     hash = "sha256-q5/VcFsm3vNEw55zq/vcM11eo456SYE5TQA3g2VQjGc=";
38   };
40   patches = [ ./fix-inconsistent-theme-name.patch ];
42   nativeBuildInputs = [
43     gtk3
44     sassc
45     # git is needed here since "git apply" is being used for patches
46     # see <https://github.com/catppuccin/gtk/blob/4173b70b910bbb3a42ef0e329b3e98d53cef3350/build.py#L465>
47     git
48     (python3.withPackages (ps: [ ps.catppuccin ]))
49   ];
51   dontConfigure = true;
52   dontBuild = true;
54   installPhase = ''
55     runHook preInstall
57     mkdir -p $out/share/themes
59     python3 build.py ${variant} \
60       --accent ${builtins.toString accents} \
61       ${lib.optionalString (size != [ ]) "--size " + size} \
62       ${lib.optionalString (tweaks != [ ]) "--tweaks " + builtins.toString tweaks} \
63       --dest $out/share/themes
65     runHook postInstall
66   '';
68   passthru.updateScript = nix-update-script { };
70   meta = {
71     description = "Soothing pastel theme for GTK";
72     homepage = "https://github.com/catppuccin/gtk";
73     license = lib.licenses.gpl3Plus;
74     platforms = lib.platforms.all;
75     maintainers = with lib.maintainers; [ fufexan dixslyf isabelroses ];
76   };