Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / development / libraries / gtk / hooks / drop-icon-theme-cache.sh
blobf28a856c4f50f1b525deca10902232cc1dcf97d5
1 # shellcheck shell=bash
3 # Packages often run gtk-update-icon-cache to include their icons in themes’ icon cache.
4 # However, since each package is installed to its own prefix, the files will only collide.
5 dropIconThemeCache() {
6 if [[ -z "${dontDropIconThemeCache:-}" ]]; then
7 local icondir="${out:?}/share/icons"
8 if [[ -d "${icondir}" ]]; then
9 # 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.
10 find "${icondir}" -name 'icon-theme.cache' -print0 \
11 | while IFS= read -r -d '' file; do
12 echo "Removing ${file}"
13 rm -f "${file}"
14 done
19 preFixupPhases="${preFixupPhases-} dropIconThemeCache"