gtk: reorganize

This directory was mess of patches and hooks.
Have a patches dir and a setup-hooks dir.
This commit is contained in:
worldofpeace
2019-10-13 18:17:48 -04:00
parent f03b26c134
commit 082b0b2619
11 changed files with 10 additions and 10 deletions
@@ -0,0 +1,19 @@
# 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"
@@ -0,0 +1,12 @@
# shellcheck shell=bash
fixupOutputHooks+=(_gtk2CleanComments)
# Clean comments that link to generator of the file
_gtk2CleanComments() {
local f="${prefix:?}/lib/gtk-2.0/2.10.0/immodules.cache"
if [ -f "$f" ]; then
sed 's|Created by .*bin/gtk-query-|Created by bin/gtk-query-|' -i "$f"
fi
}
@@ -0,0 +1,11 @@
# shellcheck shell=bash
fixupOutputHooks+=(_gtk3CleanComments)
# Clean comments that link to generator of the file
_gtk3CleanComments() {
local f="${prefix:?}/lib/gtk-3.0/3.0.0/immodules.cache"
if [ -f "$f" ]; then
sed 's|Created by .*bin/gtk-query-|Created by bin/gtk-query-|' -i "$f"
fi
}