nixpkgs/pkgs/by-name/gt/gtk3/hooks/drop-icon-theme-cache.sh
quantenzitrone 23d433a5dc
gtk{2,3,4}: move to pkgs/by-name
this shouldn't create any rebuilds

I unfortunately had to duplicate the setup hooks, however i think it
is ok because they don't change a lot.
2026-01-21 00:52:53 +01:00

19 lines
824 B
Bash
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# shellcheck shell=bash
# Packages often run gtk-update-icon-cache to include their icons in themes icon cache.
# However, since each package is installed to its own prefix, the files will only collide.
dropIconThemeCache() {
if [[ -z "${dontDropIconThemeCache:-}" ]]; then
local icondir="${out:?}/share/icons"
if [[ -d "${icondir}" ]]; then
# App icons are supposed to go to hicolor theme, since it is a fallback theme as per [icon-theme-spec], but some might still choose to install stylized icons to other themes.
find "${icondir}" -name 'icon-theme.cache' -print0 \
| while IFS= read -r -d '' file; do
echo "Removing ${file}"
rm -f "${file}"
done
fi
fi
}
appendToVar preFixupPhases dropIconThemeCache