head 1.1; access; symbols pkgsrc-2023Q4:1.1.0.54 pkgsrc-2023Q4-base:1.1 pkgsrc-2023Q3:1.1.0.52 pkgsrc-2023Q3-base:1.1 pkgsrc-2023Q2:1.1.0.50 pkgsrc-2023Q2-base:1.1 pkgsrc-2023Q1:1.1.0.48 pkgsrc-2023Q1-base:1.1 pkgsrc-2022Q4:1.1.0.46 pkgsrc-2022Q4-base:1.1 pkgsrc-2022Q3:1.1.0.44 pkgsrc-2022Q3-base:1.1 pkgsrc-2022Q2:1.1.0.42 pkgsrc-2022Q2-base:1.1 pkgsrc-2022Q1:1.1.0.40 pkgsrc-2022Q1-base:1.1 pkgsrc-2021Q4:1.1.0.38 pkgsrc-2021Q4-base:1.1 pkgsrc-2021Q3:1.1.0.36 pkgsrc-2021Q3-base:1.1 pkgsrc-2021Q2:1.1.0.34 pkgsrc-2021Q2-base:1.1 pkgsrc-2021Q1:1.1.0.32 pkgsrc-2021Q1-base:1.1 pkgsrc-2020Q4:1.1.0.30 pkgsrc-2020Q4-base:1.1 pkgsrc-2020Q3:1.1.0.28 pkgsrc-2020Q3-base:1.1 pkgsrc-2020Q2:1.1.0.24 pkgsrc-2020Q2-base:1.1 pkgsrc-2020Q1:1.1.0.4 pkgsrc-2020Q1-base:1.1 pkgsrc-2019Q4:1.1.0.26 pkgsrc-2019Q4-base:1.1 pkgsrc-2019Q3:1.1.0.22 pkgsrc-2019Q3-base:1.1 pkgsrc-2019Q2:1.1.0.20 pkgsrc-2019Q2-base:1.1 pkgsrc-2019Q1:1.1.0.18 pkgsrc-2019Q1-base:1.1 pkgsrc-2018Q4:1.1.0.16 pkgsrc-2018Q4-base:1.1 pkgsrc-2018Q3:1.1.0.14 pkgsrc-2018Q3-base:1.1 pkgsrc-2018Q2:1.1.0.12 pkgsrc-2018Q2-base:1.1 pkgsrc-2018Q1:1.1.0.10 pkgsrc-2018Q1-base:1.1 pkgsrc-2017Q4:1.1.0.8 pkgsrc-2017Q4-base:1.1 pkgsrc-2017Q3:1.1.0.6 pkgsrc-2017Q3-base:1.1 pkgsrc-2017Q2:1.1.0.2 pkgsrc-2017Q2-base:1.1; locks; strict; comment @# @; 1.1 date 2017.06.14.16.23.09; author prlw1; state Exp; branches; next ; commitid aE370uNFy4tdkmVz; desc @@ 1.1 log @Essentially from OBATA Akio in private mail, June 2015: Introduce Icon Theme cache handling framework Icon Theme cache files are used by GTK+ and maintained with the gtk-update-icon-cache tool. Each Icon Theme package duplicates its own maintainance scripts: only the specified icon theme directory differs. With this framework, if packages have ICON_THEMES=yes, associated icon themes will be detected and their cache files will be maintained automatically. Change cache handling behaviour as follows: * Icon theme caches will be updated if either gtk2+ or gtk3+ gtk-update-icon-cache tool is available. * With installation of gtk2+ package, not only hicolor icon theme but also any other icon theme cache files will be updated. * Prevent removal of icon caches at deinstall, gtk3+ may be installed and using them. * Ditto with gtk3+, gtk2+ may not be installed now, so caches must be maintained by gtk3+. @ text @# $NetBSD$ # # Generate an +ICON_THEMES script that handles the icon theme cache for # the package. # case "${STAGE},$1" in UNPACK,|UNPACK,+ICON_THEMES) ${CAT} > ./+ICON_THEMES << 'EOF' #!@@SH@@ # # +ICON_THEMES - icon theme cache management script # # Usage: ./+ICON_THEMES ADD|REMOVE [metadatadir] # # This script supports two actions, UPDATE and REMOVE, that will update or # remove cache files for icon themes from the package associated with # . # # Lines starting with "# ICON_THEME: " are data read by this script that # name the icon theme and directory containing the "index.theme". # # # ICON_THEME: hicolor # # ICON_THEME: gnome # # For each ICON_THEME entry, if the path is relative, that it is taken to be # relative to ${PKG_PREFIX}/share/icons. # ECHO="@@ECHO@@" GREP="@@GREP@@" INSTALL_INFO="@@INSTALL_INFO@@" MKDIR="@@MKDIR@@" PWD_CMD="@@PWD_CMD@@" RM="@@RM@@" RMDIR="@@RMDIR@@" SED="@@SED@@" SORT="@@SORT@@" TEST="@@TEST@@" GTK2_UPDATE_ICON_CACHE="@@GTK2_UPDATE_ICON_CACHE@@" GTK3_UPDATE_ICON_CACHE="@@GTK3_UPDATE_ICON_CACHE@@" : ${GTK_UPDATE_ICON_CACHE=@@TRUE@@} SELF=$0 ACTION=$1 CURDIR=`${PWD_CMD}` PKG_METADATA_DIR="${2-${CURDIR}}" : ${PKGNAME=${PKG_METADATA_DIR##*/}} : ${PKG_PREFIX=@@PREFIX@@} for _t in ${GTK3_UPDATE_ICON_CACHE} ${GTK2_UPDATE_ICON_CACHE}; do if ${TEST} -x $_t; then GTK_UPDATE_ICON_CACHE=$_t; break; fi done update_icon_cache() { _dir="$1" if ${TEST} ! -f "$_dir/index.theme"; then : else ${GTK_UPDATE_ICON_CACHE} -f -q "$_dir" fi } exitcode=0 case $ACTION in UPDATE) ${SED} -n "/^\# ICON_THEME: /{s/^\# ICON_THEME: //;p;}" ${SELF} | \ ${SORT} -u | while read theme; do case $theme in "") continue ;; [!/]*) theme="${PKG_PREFIX}/share/icons/$theme" ;; esac update_icon_cache $theme done ;; REMOVE) ${SED} -n "/^\# ICON_THEME: /{s/^\# ICON_THEME: //;p;}" ${SELF} | \ ${SORT} -u | while read theme; do case $theme in "") continue ;; [!/]*) theme="${PKG_PREFIX}/share/icons/$theme" ;; esac ${RM} -f "$theme/icon-theme.cache" done ;; esac exit $exitcode EOF ${SED} -n "/^\# ICON_THEME: /p" ${SELF} >> ./+ICON_THEMES ${CHMOD} +x ./+ICON_THEMES ;; esac @