mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-22 13:43:22 +00:00
b7f4bda282
If these aren't defined, the stdenv defaults are used in the `*Phase` case, or no extra phases are done, in the `*Phases` case.
20 lines
833 B
Bash
20 lines
833 B
Bash
# 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
|
||
}
|
||
|
||
preFixupPhases="${preFixupPhases-} dropIconThemeCache"
|