Merge pull request #184860 from fufexan/master

This commit is contained in:
Sandro 2022-08-11 23:49:47 +02:00 committed by GitHub
commit 7fb6d4f303
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 34 deletions

View File

@ -6,22 +6,22 @@
, gtk-engine-murrine
, sassc
, which
, tweaks ? [ ] # can be "nord" "black" "rimless". cannot mix "nord" and "black"
, size ? "standard" # can be "standard" "compact"
, tweaks ? [ ]
, size ? "standard"
}:
let
validSizes = [ "standard" "compact" ];
validTweaks = [ "nord" "black" "rimless" ];
validTweaks = [ "nord" "dracula" "black" "rimless" "normal" ];
unknownTweaks = lib.subtractLists validTweaks tweaks;
illegalMix = !(lib.elem "nord" tweaks) && !(lib.elem "black" tweaks);
illegalMix = !(lib.elem "nord" tweaks) && !(lib.elem "dracula" tweaks);
assertIllegal = lib.assertMsg illegalMix ''
Tweaks "nord" and "black" cannot be mixed. Tweaks: ${toString tweaks}
Tweaks "nord" and "dracula" cannot be mixed. Tweaks: ${toString tweaks}
'';
assertSize = lib.assertMsg (lib.elem size validSizes) ''
You entered wrong size: ${size}
You entered a wrong size: ${size}
Valid sizes are: ${toString validSizes}
'';
@ -37,13 +37,13 @@ assert assertUnknown;
stdenvNoCC.mkDerivation rec {
pname = "catppuccin-gtk";
version = "unstable-2022-02-24";
version = "unstable-2022-08-01";
src = fetchFromGitHub {
repo = "gtk";
owner = "catppuccin";
rev = "359c584f607c021fcc657ce77b81c181ebaff6de";
sha256 = "sha256-AVhFw1XTnkU0hoM+UyjT7ZevLkePybBATJUMLqRytpk=";
rev = "87a79fd2bf07accc694455df30a32a82b1b31f4f";
sha256 = "sha256-dKHTQva0BYkO6VPNfY/pzRn/V1ghX+tYqbnM9hTAMeE=";
};
nativeBuildInputs = [ gtk3 sassc which ];
@ -52,25 +52,17 @@ stdenvNoCC.mkDerivation rec {
propagatedUserEnvPkgs = [ gtk-engine-murrine ];
patches = [
# Allows installing with `-t all`. Works around missing grey assets.
# https://github.com/catppuccin/gtk/issues/17
./grey-fix.patch
];
postPatch = ''
patchShebangs --build scripts/*
substituteInPlace Makefile \
--replace '$(shell git rev-parse --show-toplevel)' "$PWD"
substituteInPlace 'scripts/install.sh' \
--replace '$(git rev-parse --show-toplevel)' "$PWD"
patchShebangs --build clean-old-theme.sh install.sh
'';
installPhase = ''
runHook preInstall
export HOME=$(mktemp -d)
mkdir -p $out/share/themes
bash scripts/install.sh -d $out/share/themes -t all \
bash install.sh -d $out/share/themes -t all \
${lib.optionalString (size != "") "-s ${size}"} \
${lib.optionalString (tweaks != []) "--tweaks " + builtins.toString tweaks}
@ -78,7 +70,7 @@ stdenvNoCC.mkDerivation rec {
'';
meta = with lib; {
description = "Soothing pastel theme for GTK3";
description = "Soothing pastel theme for GTK";
homepage = "https://github.com/catppuccin/gtk";
license = licenses.gpl3Plus;
platforms = platforms.linux;

View File

@ -1,12 +0,0 @@
diff --git a/scripts/install.sh b/scripts/install.sh
index d2a2b86..bd05c93 100755
--- a/scripts/install.sh
+++ b/scripts/install.sh
@@ -20,7 +20,7 @@ fi
SASSC_OPT="-M -t expanded"
THEME_NAME=Catppuccin
-THEME_VARIANTS=('' '-purple' '-pink' '-red' '-orange' '-yellow' '-green' '-teal' '-grey')
+THEME_VARIANTS=('' '-purple' '-pink' '-red' '-orange' '-yellow' '-green' '-teal')
COLOR_VARIANTS=('' '-light' '-dark')
SIZE_VARIANTS=('' '-compact')