3
0
Fork 0
forked from mirrors/nixpkgs

Merge pull request #182725 from kilianar/whitesur-icon-theme-2022-05-11

This commit is contained in:
Sandro 2022-07-25 14:54:13 +02:00 committed by GitHub
commit a6da594e8a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,42 +1,54 @@
{ lib, stdenvNoCC, fetchFromGitHub, gtk3, hicolor-icon-theme }:
{ lib
, stdenvNoCC
, fetchFromGitHub
, gtk3
, hicolor-icon-theme
, jdupes
, boldPanelIcons ? false
, blackPanelIcons ? false
, themeVariants ? []
}:
let
pname = "Whitesur-icon-theme";
in
lib.checkListOfEnum "${pname}: theme variants" [ "default" "purple" "pink" "red" "orange" "yellow" "green" "grey" "nord" "all" ] themeVariants
stdenvNoCC.mkDerivation rec {
pname = "Whitesur-icon-theme";
version = "2022-03-18";
inherit pname;
version = "2022-05-11";
src = fetchFromGitHub {
owner = "vinceliuice";
repo = pname;
rev = version;
sha256 = "iHLxZqcDLUo62J67MwZ72CSvsHHiI9/Jk31KwkgIPr4=";
sha256 = "sha256-7Bbkjbh6nZdYot0tJMWFuW1Jnl9U4KOLN/n+z92UWh4=";
};
nativeBuildInputs = [ gtk3 ];
nativeBuildInputs = [ gtk3 jdupes ];
buildInputs = [ hicolor-icon-theme ];
# These fixup steps are slow and unnecessary
dontPatchELF = true;
dontRewriteSymlinks = true;
dontDropIconThemeCache = true;
postPatch = ''
patchShebangs install.sh
'';
installPhase = ''
runHook preInstall
mkdir -p $out/share/icons/WhiteSur{,-dark}/status
echo "$out/share/icons/WhiteSur/status $out/share/icons/WhiteSur-dark/status" | xargs -n 1 cp -r src/status/{16,22,24,32,symbolic}
echo "$out/share/icons/WhiteSur $out/share/icons/WhiteSur-dark" | xargs -n 1 cp -r ./{COPYING,AUTHORS} src/index.theme src/{actions,animations,apps,categories,devices,emblems,mimes,places} links/{actions,apps,categories,devices,emblems,mimes,places,status}
./install.sh --dest $out/share/icons \
--name WhiteSur \
--theme ${builtins.toString themeVariants} \
${lib.optionalString boldPanelIcons "--bold"} \
${lib.optionalString blackPanelIcons "--black"}
# Change icon color for dark theme
sed -i "s/#363636/#dedede/g" $out/share/icons/WhiteSur-dark/{actions,devices,places,status}/{16,22,24}/*
sed -i "s/#363636/#dedede/g" $out/share/icons/WhiteSur-dark/actions/32/*
sed -i "s/#363636/#dedede/g" $out/share/icons/WhiteSur-dark/{actions,apps,categories,emblems,devices,mimes,places,status}/symbolic/*
for f in actions animations apps categories devices emblems mimes places status; do
ln -sf $out/share/icons/WhiteSur/$f $out/share/icons/WhiteSur/$f@2x
ln -sf $out/share/icons/WhiteSur-dark/$f $out/share/icons/WhiteSur-dark/$f@2x
done
for theme in $out/share/icons/*; do
gtk-update-icon-cache $theme
done
jdupes --link-soft --recurse $out/share
runHook postInstall
'';