Merge pull request #205364 from fufexan/catppuccin

catppuccin-gtk: 0.2.7 -> 0.4.1
This commit is contained in:
Sandro 2023-01-19 15:47:11 +01:00 committed by GitHub
commit e2c72e8a57
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 64 additions and 31 deletions

View file

@ -2,67 +2,71 @@
, stdenvNoCC
, fetchFromGitHub
, gtk3
, colloid-gtk-theme
, gnome-themes-extra
, gtk-engine-murrine
, python3
, sassc
, tweaks ? [ ]
, accents ? [ "blue" ]
, size ? "standard"
, tweaks ? [ ]
, variant ? "frappe"
}:
let
validAccents = [ "blue" "flamingo" "green" "lavender" "maroon" "mauve" "peach" "pink" "red" "rosewater" "sapphire" "sky" "teal" "yellow" ];
validSizes = [ "standard" "compact" ];
validTweaks = [ "nord" "dracula" "black" "rimless" "normal" ];
validTweaks = [ "black" "rimless" "normal" ];
validVariants = [ "latte" "frappe" "macchiato" "mocha" ];
unknownTweaks = lib.subtractLists validTweaks tweaks;
illegalMix = (lib.elem "nord" tweaks) && (lib.elem "dracula" tweaks);
assertIllegal = lib.assertMsg (!illegalMix) ''
Tweaks "nord" and "dracula" cannot be mixed. Tweaks: ${toString tweaks}
'';
assertSize = lib.assertMsg (lib.elem size validSizes) ''
You entered a wrong size: ${size}
Valid sizes are: ${toString validSizes}
'';
assertUnknown = lib.assertMsg (unknownTweaks == [ ]) ''
You entered wrong tweaks: ${toString unknownTweaks}
Valid tweaks are: ${toString validTweaks}
'';
pname = "catppuccin-gtk";
in
assert assertIllegal;
assert assertSize;
assert assertUnknown;
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 {
pname = "catppuccin-gtk";
version = "0.2.7";
inherit pname;
version = "0.4.1";
src = fetchFromGitHub {
repo = "gtk";
owner = "catppuccin";
rev = "v-${version}";
sha256 = "sha256-oTAfURHMWqlKHk4CNz5cn6vO/7GmQJM2rXXGDz2e+0w=";
repo = "gtk";
rev = "v${version}";
sha256 = "sha256-dzRXt9/OdPyiy3mu9pmPYeu69OXCnR+zEqbD1C5BKqM=";
};
nativeBuildInputs = [ gtk3 sassc ];
buildInputs = [ gnome-themes-extra ];
buildInputs = [
gnome-themes-extra
(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 clean-old-theme.sh install.sh
patchShebangs --build colloid/clean-old-theme.sh colloid/install.sh
'';
installPhase = ''
runHook preInstall
mkdir -p $out/share/themes
export HOME=$(mktemp -d)
bash install.sh -d $out/share/themes -t all \
${lib.optionalString (size != "") "-s ${size}"} \
${lib.optionalString (tweaks != []) "--tweaks " + builtins.toString tweaks}
python3 install.py ${variant} \
${lib.optionalString (accents != []) "--accent " + builtins.toString accents} \
${lib.optionalString (size != []) "--size " + size} \
${lib.optionalString (tweaks != []) "--tweaks " + builtins.toString tweaks} \
--dest $out/share/themes
runHook postInstall
'';

View file

@ -0,0 +1,27 @@
{ lib
, buildPythonPackage
, fetchPypi
, python
, pygments
}:
buildPythonPackage rec {
pname = "catppuccin";
version = "1.1.1";
src = fetchPypi {
inherit pname version;
hash = "sha256-mHNuV3yIuFL2cixDOr+//+/b9iD2fN82cfLzZkegxKc=";
};
propagatedBuildInputs = [ pygments ];
pythonImportsCheck = [ "catppuccin" ];
meta = with lib; {
description = "Soothing pastel theme for Python";
homepage = "https://github.com/catppuccin/python";
maintainers = with maintainers; [ fufexan ];
license = licenses.mit;
};
}

View file

@ -1571,6 +1571,8 @@ self: super: with self; {
catboost = callPackage ../development/python-modules/catboost { };
catppuccin = callPackage ../development/python-modules/catppuccin { };
cattrs = callPackage ../development/python-modules/cattrs { };
cbeams = callPackage ../misc/cbeams { };