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+.
This commit is contained in:
prlw1 2017-06-14 16:23:09 +00:00
parent 3421e3931c
commit 5c827f6f0e
17 changed files with 227 additions and 55 deletions

View file

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.7 2016/09/30 13:09:10 wiz Exp $ # $NetBSD: Makefile,v 1.8 2017/06/14 16:23:09 prlw1 Exp $
DISTNAME= adwaita-icon-theme-3.22.0 DISTNAME= adwaita-icon-theme-3.22.0
CATEGORIES= graphics gnome CATEGORIES= graphics gnome
@ -26,11 +26,7 @@ PKGCONFIG_OVERRIDE+= adwaita-icon-theme.pc.in
# but isn't # but isn't
INSTALLATION_DIRS+= share/icons/Adwaita/96x96/places INSTALLATION_DIRS+= share/icons/Adwaita/96x96/places
FILES_SUBST+= GTK_UPDATE_ICON_CACHE="${LOCALBASE}/bin/gtk-update-icon-cache" ICON_THEMES= yes
FILES_SUBST+= ICON_THEME_DIR="${LOCALBASE}/share/icons/Adwaita"
INSTALL_TEMPLATES+= ../../graphics/adwaita-icon-theme/files/icon-cache.tmpl
DEINSTALL_TEMPLATES+= ../../graphics/adwaita-icon-theme/files/icon-cache.tmpl
PRINT_PLIST_AWK+= /^share\/icons\/gnome\/icon-theme.cache$$/ { next; }
post-install: post-install:
.for s in 16 22 24 32 48 96 256 .for s in 16 22 24 32 48 96 256

View file

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.100 2016/07/09 06:38:21 wiz Exp $ # $NetBSD: Makefile,v 1.101 2017/06/14 16:23:09 prlw1 Exp $
DISTNAME= gnome-icon-theme-3.12.0 DISTNAME= gnome-icon-theme-3.12.0
PKGREVISION= 1 PKGREVISION= 1
@ -27,11 +27,7 @@ PKGCONFIG_OVERRIDE= gnome-icon-theme.pc.in
# the current pkgsrc version. # the current pkgsrc version.
BUILDLINK_API_DEPENDS.icon-naming-utils+= icon-naming-utils>=0.8.90 BUILDLINK_API_DEPENDS.icon-naming-utils+= icon-naming-utils>=0.8.90
FILES_SUBST+= GTK_UPDATE_ICON_CACHE="${LOCALBASE}/bin/gtk-update-icon-cache" ICON_THEMES= yes
FILES_SUBST+= ICON_THEME_DIR="${PREFIX}/share/icons/gnome"
INSTALL_TEMPLATES+= ../../graphics/gnome-icon-theme/files/icon-cache.tmpl
DEINSTALL_TEMPLATES+= ../../graphics/gnome-icon-theme/files/icon-cache.tmpl
PRINT_PLIST_AWK+= /^share\/icons\/gnome\/icon-theme.cache$$/ { next; }
post-install: post-install:
${LOCALBASE}/bin/rsvg-convert ${FILESDIR}/distributor-logo.svg -w 16 -h 16 -o ${DESTDIR}${PREFIX}/share/icons/gnome/16x16/places/start-here.png ${LOCALBASE}/bin/rsvg-convert ${FILESDIR}/distributor-logo.svg -w 16 -h 16 -o ${DESTDIR}${PREFIX}/share/icons/gnome/16x16/places/start-here.png

View file

@ -1,4 +1,4 @@
# $NetBSD: buildlink3.mk,v 1.20 2015/11/25 12:50:43 jperkin Exp $ # $NetBSD: buildlink3.mk,v 1.21 2017/06/14 16:23:09 prlw1 Exp $
BUILDLINK_TREE+= gnome-icon-theme BUILDLINK_TREE+= gnome-icon-theme
@ -17,13 +17,7 @@ USE_TOOLS+= perl
.include "../../mk/bsd.fast.prefs.mk" .include "../../mk/bsd.fast.prefs.mk"
.if !defined(GNOME_ICON_THEME_DEPEND_ONLY) .if !defined(GNOME_ICON_THEME_DEPEND_ONLY)
FILES_SUBST+= GTK_UPDATE_ICON_CACHE="${LOCALBASE}/bin/gtk-update-icon-cache" ICON_THEMES= yes
FILES_SUBST+= ICON_THEME_DIR="${BUILDLINK_PREFIX.gnome-icon-theme}/share/icons/gnome"
INSTALL_TEMPLATES+= ../../graphics/gnome-icon-theme/files/icon-cache.tmpl
DEINSTALL_TEMPLATES+= ../../graphics/gnome-icon-theme/files/icon-cache.tmpl
PRINT_PLIST_AWK+= /^share\/icons\/gnome\/icon-theme.cache$$/ { next; }
CHECK_FILES_SKIP+= ${PREFIX}/share/icons/gnome/icon-theme.cache
.if !defined(NOOP_GTK_UPDATE_ICON_CACHE) .if !defined(NOOP_GTK_UPDATE_ICON_CACHE)
NOOP_GTK_UPDATE_ICON_CACHE= NOOP_GTK_UPDATE_ICON_CACHE=

View file

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.22 2015/11/25 12:50:43 jperkin Exp $ # $NetBSD: Makefile,v 1.23 2017/06/14 16:23:09 prlw1 Exp $
DISTNAME= hicolor-icon-theme-0.13 DISTNAME= hicolor-icon-theme-0.13
CATEGORIES= graphics CATEGORIES= graphics
@ -14,10 +14,6 @@ NO_BUILD= YES
USE_LANGUAGES= # none, not even C USE_LANGUAGES= # none, not even C
USE_TOOLS+= gmake USE_TOOLS+= gmake
FILES_SUBST+= GTK_UPDATE_ICON_CACHE="${LOCALBASE}/bin/gtk-update-icon-cache" ICON_THEMES= yes
FILES_SUBST+= ICON_THEME_DIR="${PREFIX}/share/icons/hicolor"
INSTALL_TEMPLATES+= ../../graphics/hicolor-icon-theme/files/icon-cache.tmpl
DEINSTALL_TEMPLATES+= ../../graphics/hicolor-icon-theme/files/icon-cache.tmpl
PRINT_PLIST_AWK+= /^share\/icons\/hicolor\/icon-theme.cache$$/ { next; }
.include "../../mk/bsd.pkg.mk" .include "../../mk/bsd.pkg.mk"

View file

@ -1,4 +1,4 @@
# $NetBSD: buildlink3.mk,v 1.19 2015/11/25 12:50:43 jperkin Exp $ # $NetBSD: buildlink3.mk,v 1.20 2017/06/14 16:23:09 prlw1 Exp $
BUILDLINK_TREE+= hicolor-icon-theme BUILDLINK_TREE+= hicolor-icon-theme
@ -12,16 +12,8 @@ BUILDLINK_PKGSRCDIR.hicolor-icon-theme?=../../graphics/hicolor-icon-theme
.include "../../mk/bsd.fast.prefs.mk" .include "../../mk/bsd.fast.prefs.mk"
.if !defined(HICOLOR_ICON_THEME_DEPEND_ONLY) .if !defined(HICOLOR_ICON_THEME_DEPEND_ONLY)
FILES_SUBST+= GTK_UPDATE_ICON_CACHE="${LOCALBASE}/bin/gtk-update-icon-cache"
FILES_SUBST+= ICON_THEME_DIR="${BUILDLINK_PREFIX.hicolor-icon-theme}/share/icons/hicolor"
INSTALL_TEMPLATES+= ../../graphics/hicolor-icon-theme/files/icon-cache.tmpl
DEINSTALL_TEMPLATES+= ../../graphics/hicolor-icon-theme/files/icon-cache.tmpl
# The icon-theme cache file generated by gtk-update-icon-cache should ICON_THEMES= yes
# never be in any PLIST.
#
PRINT_PLIST_AWK+= /^share\/icons\/hicolor\/icon-theme.cache$$/ { next; }
CHECK_FILES_SKIP+= ${PREFIX}/share/icons/hicolor/icon-theme.cache
.if !defined(NOOP_GTK_UPDATE_ICON_CACHE) .if !defined(NOOP_GTK_UPDATE_ICON_CACHE)
NOOP_GTK_UPDATE_ICON_CACHE= NOOP_GTK_UPDATE_ICON_CACHE=

View file

@ -1,4 +1,4 @@
# $NetBSD: check-files.mk,v 1.34 2017/06/01 02:15:10 jlam Exp $ # $NetBSD: check-files.mk,v 1.35 2017/06/14 16:23:09 prlw1 Exp $
# #
# This file checks that the list of installed files matches the PLIST. # This file checks that the list of installed files matches the PLIST.
# For that purpose it records the file list of LOCALBASE before and # For that purpose it records the file list of LOCALBASE before and
@ -101,6 +101,11 @@ CHECK_FILES_SKIP+= ${PREFIX}/.*/fonts.scale
CHECK_FILES_SKIP+= ${PREFIX}/.*/fonts.cache-1 CHECK_FILES_SKIP+= ${PREFIX}/.*/fonts.cache-1
.endif .endif
# Mutable icon theme cache files
.if !empty(ICON_THEMES:M[Yy][Ee][Ss])
CHECK_FILES_SKIP+= ${PREFIX}/share/icons/.*/icon-theme.cache
.endif
# Mutable charset.alias file # Mutable charset.alias file
CHECK_FILES_SKIP+= ${PREFIX}/lib/charset.alias CHECK_FILES_SKIP+= ${PREFIX}/lib/charset.alias

View file

@ -1,4 +1,4 @@
# $NetBSD: bsd.pkginstall.mk,v 1.70 2017/06/01 13:29:18 jlam Exp $ # $NetBSD: bsd.pkginstall.mk,v 1.71 2017/06/14 16:23:09 prlw1 Exp $
# #
# This Makefile fragment is included by bsd.pkg.mk and implements the # This Makefile fragment is included by bsd.pkg.mk and implements the
# common INSTALL/DEINSTALL scripts framework. To use the pkginstall # common INSTALL/DEINSTALL scripts framework. To use the pkginstall
@ -47,6 +47,7 @@ _PKG_VARS.pkginstall+= \
PKG_SYSCONFDIR_PERMS \ PKG_SYSCONFDIR_PERMS \
PKG_SHELL \ PKG_SHELL \
FONTS_DIRS.ttf FONTS_DIRS.type1 FONTS_DIRS.x11 \ FONTS_DIRS.ttf FONTS_DIRS.type1 FONTS_DIRS.x11 \
ICON_THEMES
_SYS_VARS.pkginstall= \ _SYS_VARS.pkginstall= \
SETUID_ROOT_PERMS \ SETUID_ROOT_PERMS \
SETGID_GAMES_PERMS \ SETGID_GAMES_PERMS \
@ -965,6 +966,61 @@ ${_INSTALL_FONTS_FILE}: ../../mk/pkginstall/fonts
${TOUCH} ${TOUCH_ARGS} ${.TARGET}; \ ${TOUCH} ${TOUCH_ARGS} ${.TARGET}; \
fi fi
# ICON_THEMES indicates whether icon theme cache files should be automatically
# updated with the gtk-update-con-cache tool from a GTK+ package if available.
# It is either YES or NO and defaults to NO.
#
ICON_THEMES?= NO
_INSTALL_ICON_THEMES_FILE= ${_PKGINSTALL_DIR}/icon-themes
_INSTALL_ICON_THEMES_DATAFILE= ${_PKGINSTALL_DIR}/icon-themes-data
_INSTALL_UNPACK_TMPL+= ${_INSTALL_ICON_THEMES_FILE}
_INSTALL_DATA_TMPL+= ${_INSTALL_ICON_THEMES_DATAFILE}
# The icon theme cache is used by GTK+2 and GTK3+ applications.
# List their update-icon-cache tools.
#
.if !empty(ICON_THEMES:M[Yy][Ee][Ss])
FILES_SUBST+= GTK2_UPDATE_ICON_CACHE=${LOCALBASE}/bin/gtk2-update-icon-cache
FILES_SUBST+= GTK3_UPDATE_ICON_CACHE=${LOCALBASE}/bin/gtk-update-icon-cache
.endif
${_INSTALL_ICON_THEMES_DATAFILE}:
${RUN}${MKDIR} ${.TARGET:H}
${RUN}${RM} -f ${.TARGET}
${RUN}${TOUCH} ${TOUCH_ARGS} ${.TARGET}
.if !empty(ICON_THEMES:M[Yy][Ee][Ss])
.PHONY: install-script-data-icon-themes
install-script-data: install-script-data-icon-themes
install-script-data-icon-themes:
${RUN}${_FUNC_STRIP_PREFIX}; \
if ${TEST} -x ${INSTALL_FILE}; then \
${ICON_THEMES_cmd} | \
while read theme; do \
theme=`strip_prefix "$$theme"`; \
${ECHO} "# ICON_THEME: $$theme" \
>> ${INSTALL_FILE}; \
done; \
cd ${PKG_DB_TMPDIR} && ${PKGSRC_SETENV} ${INSTALL_SCRIPTS_ENV} \
${_PKG_DEBUG_SCRIPT} ${INSTALL_FILE} ${PKGNAME} \
UNPACK +ICON_THEMES; \
fi
.endif
${_INSTALL_ICON_THEMES_FILE}: ${_INSTALL_ICON_THEMES_DATAFILE}
${_INSTALL_ICON_THEMES_FILE}: ../../mk/pkginstall/icon-themes
${RUN}${MKDIR} ${.TARGET:H}
${RUN} \
${SED} ${FILES_SUBST_SED} ../../mk/pkginstall/icon-themes > ${.TARGET}
.if empty(ICON_THEMES:M[Yy][Ee][Ss])
${RUN} \
if ${_ZERO_FILESIZE_P} ${_INSTALL_ICON_THEMES_DATAFILE}; then \
${RM} -f ${.TARGET}; \
${TOUCH} ${TOUCH_ARGS} ${.TARGET}; \
fi
.endif
# PKG_CREATE_USERGROUP indicates whether the INSTALL script should # PKG_CREATE_USERGROUP indicates whether the INSTALL script should
# automatically add any needed users/groups to the system using # automatically add any needed users/groups to the system using
# useradd/groupadd. It is either YES or NO and defaults to YES. # useradd/groupadd. It is either YES or NO and defaults to YES.

View file

@ -1,4 +1,4 @@
# $NetBSD: deinstall,v 1.4 2016/04/12 15:52:29 jaapb Exp $ # $NetBSD: deinstall,v 1.5 2017/06/14 16:23:09 prlw1 Exp $
case ${STAGE} in case ${STAGE} in
DEINSTALL) DEINSTALL)
@ -14,6 +14,11 @@ DEINSTALL)
${TEST} ! -x ./+INFO_FILES || ${TEST} ! -x ./+INFO_FILES ||
./+INFO_FILES REMOVE ${PKG_METADATA_DIR} ./+INFO_FILES REMOVE ${PKG_METADATA_DIR}
# #
# Remove any icon theme caches.
#
${TEST} ! -x ./+ICON_THEMES ||
./+ICON_THEMES REMOVE ${PKG_METADATA_DIR}
#
# Remove shells from /etc/shells. # Remove shells from /etc/shells.
# #
${TEST} ! -x ./+SHELL || ${TEST} ! -x ./+SHELL ||
@ -35,6 +40,11 @@ POST-DEINSTALL)
${TEST} ! -x ./+FONTS || ${TEST} ! -x ./+FONTS ||
./+FONTS ${PKG_METADATA_DIR} ./+FONTS ${PKG_METADATA_DIR}
# #
# Update any icon theme caches.
#
${TEST} ! -x ./+ICON_THEMES ||
./+ICON_THEMES UPDATE ${PKG_METADATA_DIR}
#
# Rebuild the system run-time library search path database. # Rebuild the system run-time library search path database.
# #
${TEST} ! -x ./+SHLIBS || ${TEST} ! -x ./+SHLIBS ||

103
mk/pkginstall/icon-themes Normal file
View file

@ -0,0 +1,103 @@
# $NetBSD: icon-themes,v 1.1 2017/06/14 16:23:09 prlw1 Exp $
#
# 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
# <metadatadir>.
#
# 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

View file

@ -1,4 +1,4 @@
# $NetBSD: install,v 1.4 2016/04/12 15:52:29 jaapb Exp $ # $NetBSD: install,v 1.5 2017/06/14 16:23:09 prlw1 Exp $
case ${STAGE} in case ${STAGE} in
PRE-INSTALL) PRE-INSTALL)
@ -47,6 +47,12 @@ POST-INSTALL)
${TEST} ! -x ./+FONTS || ${TEST} ! -x ./+FONTS ||
./+FONTS ${PKG_METADATA_DIR} ./+FONTS ${PKG_METADATA_DIR}
#
# Update any icon theme caches.
#
${TEST} ! -x ./+ICON_THEMES ||
./+ICON_THEMES UPDATE ${PKG_METADATA_DIR}
# Check for any missing bits after we're finished installing. # Check for any missing bits after we're finished installing.
# #
${TEST} ! -x ./+DIRS || ${TEST} ! -x ./+DIRS ||

View file

@ -1,4 +1,4 @@
# $NetBSD: plist.mk,v 1.49 2015/07/04 16:18:38 joerg Exp $ # $NetBSD: plist.mk,v 1.50 2017/06/14 16:23:09 prlw1 Exp $
# #
# This Makefile fragment handles the creation of PLISTs for use by # This Makefile fragment handles the creation of PLISTs for use by
# pkg_create(8). # pkg_create(8).
@ -283,6 +283,12 @@ INFO_FILES_cmd= \
${AWK} '($$0 !~ "-[0-9]*(\\.gz)?$$") { print }' ${AWK} '($$0 !~ "-[0-9]*(\\.gz)?$$") { print }'
.endif .endif
ICON_THEMES_cmd= \
${CAT} ${PLIST} | \
${PKGSRC_SETENV} ${_PLIST_AWK_ENV} ${AWK} -F / \
'$$0 ~ "^share/icons/[^/]+/.*$$" { print $$3 }' | \
${SORT} -u
###################################################################### ######################################################################
### plist-clean (PRIVATE) ### plist-clean (PRIVATE)
###################################################################### ######################################################################

View file

@ -1,4 +1,4 @@
# $NetBSD: print-plist.mk,v 1.32 2016/07/25 21:57:23 wiz Exp $ # $NetBSD: print-plist.mk,v 1.33 2017/06/14 16:23:09 prlw1 Exp $
### ###
### Automatic PLIST generation ### Automatic PLIST generation
@ -43,6 +43,9 @@ _PRINT_PLIST_AWK_IGNORE+= || ($$0 ~ /^.*\/fonts\.scale/)
(defined(FONTS_DIRS.x11) && !empty(FONTS_DIRS.x11:M*)) (defined(FONTS_DIRS.x11) && !empty(FONTS_DIRS.x11:M*))
_PRINT_PLIST_AWK_IGNORE+= || ($$0 ~ /^.*\/fonts\.cache-1/) _PRINT_PLIST_AWK_IGNORE+= || ($$0 ~ /^.*\/fonts\.cache-1/)
.endif .endif
.if defined(ICON_THEMES)
_PRINT_PLIST_AWK_IGNORE+= || ($$0 ~ /^share\/icons\/*\/icon-theme\.cache$$/)
.endif
# List the content of $PREFIX and emit "@pkgdir " statements for # List the content of $PREFIX and emit "@pkgdir " statements for
# empty directories. # empty directories.

View file

@ -1,4 +1,4 @@
# $NetBSD: makevars.map,v 1.4 2017/05/24 19:51:12 adam Exp $ # $NetBSD: makevars.map,v 1.5 2017/06/14 16:23:09 prlw1 Exp $
# #
# This file contains the guessed type of some variables, according to # This file contains the guessed type of some variables, according to
@ -384,6 +384,7 @@ GNU_CONFIGURE_PREFIX Pathname [m:s]
HAS_CONFIGURE Yes [m:s,c:s] HAS_CONFIGURE Yes [m:s,c:s]
HEADER_TEMPLATES List of Pathname [$package_list] HEADER_TEMPLATES List of Pathname [$package_list]
HOMEPAGE URL [$package] HOMEPAGE URL [$package]
ICON_THEMES Yes
IGNORE_PKG.* Yes [*:sp] IGNORE_PKG.* Yes [*:sp]
INCOMPAT_CURSES InternalList of PlatformTriple [m:as] INCOMPAT_CURSES InternalList of PlatformTriple [m:as]
INCOMPAT_ICONV InternalList of PlatformTriple INCOMPAT_ICONV InternalList of PlatformTriple

View file

@ -1,5 +1,5 @@
#! @PERL@ #! @PERL@
# $NetBSD: pkglint.pl,v 1.4 2016/02/02 08:02:29 rillig Exp $ # $NetBSD: pkglint.pl,v 1.5 2017/06/14 16:23:09 prlw1 Exp $
# #
# pkglint - static analyzer and checker for pkgsrc packages # pkglint - static analyzer and checker for pkgsrc packages
@ -5284,7 +5284,12 @@ sub checkfile_PLIST($) {
"Otherwise, this warning is harmless."); "Otherwise, this warning is harmless.");
} }
} elsif (substr($text, 0, 6) eq "share/" && $pkgpath ne "graphics/hicolor-icon-theme" && $text =~ m"^share/icons/hicolor(?:$|/)") { } elsif ($text =~ m"^share/icons/[^/]+/.+$") {
if (defined($pkgctx_vardef) && !exists($pkgctx_vardef->{"ICON_THEMES"})) {
$line->log_warning("Packages that install icon theme files should set ICON_THEMES.");
}
} elsif ($pkgpath ne "graphics/hicolor-icon-theme" && $text =~ m"^share/icons/hicolor(?:$|/)") {
my $f = "../../graphics/hicolor-icon-theme/buildlink3.mk"; my $f = "../../graphics/hicolor-icon-theme/buildlink3.mk";
if (defined($pkgctx_included) && !exists($pkgctx_included->{$f})) { if (defined($pkgctx_included) && !exists($pkgctx_included->{$f})) {
$line->log_error("Please .include \"$f\" in the Makefile"); $line->log_error("Please .include \"$f\" in the Makefile");

View file

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.285 2017/05/19 13:29:05 prlw1 Exp $ # $NetBSD: Makefile,v 1.286 2017/06/14 16:23:09 prlw1 Exp $
DISTNAME= gtk+-2.24.31 DISTNAME= gtk+-2.24.31
PKGNAME= ${DISTNAME:S/gtk/gtk2/} PKGNAME= ${DISTNAME:S/gtk/gtk2/}
@ -90,9 +90,8 @@ post-install:
${RM} -f ${DESTDIR}${GTK_IMMODULES_DB} ${RM} -f ${DESTDIR}${GTK_IMMODULES_DB}
FILES_SUBST+= GTK_UPDATE_ICON_CACHE="${PREFIX}/bin/gtk2-update-icon-cache" FILES_SUBST+= GTK_UPDATE_ICON_CACHE="${PREFIX}/bin/gtk2-update-icon-cache"
FILES_SUBST+= ICON_THEME_DIR="${LOCALBASE}/share/icons/hicolor" FILES_SUBST+= ICON_THEME_DIR="${LOCALBASE}/share/icons"
INSTALL_TEMPLATES+= ../../x11/gtk2/files/icon-cache.tmpl INSTALL_TEMPLATES+= ../../x11/gtk2/files/icon-cache.tmpl
PRINT_PLIST_AWK+= /^share\/icons\/hicolor\/icon-theme.cache$$/ { next; }
_BUILDING_GTK2= yes _BUILDING_GTK2= yes
.include "modules.mk" .include "modules.mk"

View file

@ -1,19 +1,19 @@
# $NetBSD: icon-cache.tmpl,v 1.1 2007/01/26 00:55:01 markd Exp $ # $NetBSD: icon-cache.tmpl,v 1.2 2017/06/14 16:23:09 prlw1 Exp $
# #
# Rebuild the icon cache. # Rebuild the icon cache.
# #
GTK_UPDATE_ICON_CACHE="@GTK_UPDATE_ICON_CACHE@" GTK_UPDATE_ICON_CACHE="@GTK_UPDATE_ICON_CACHE@"
ICON_THEME_DIR="@ICON_THEME_DIR@" ICON_THEME_DIR="@ICON_THEME_DIR@"
LS="@LS@"
case ${STAGE} in case ${STAGE} in
POST-INSTALL) POST-INSTALL)
${TEST} -d ${ICON_THEME_DIR} && \ ${TEST} -d ${ICON_THEME_DIR} && \
${GTK_UPDATE_ICON_CACHE} -f -t ${ICON_THEME_DIR} >/dev/null 2>&1 || \ ${LS} ${ICON_THEME_DIR} | while read theme; do
${TRUE} ${TEST} -f ${ICON_THEME_DIR}/${theme}/index.theme && \
;; ${GTK_UPDATE_ICON_CACHE} -q -f -t ${ICON_THEME_DIR}/${theme}
DEINSTALL) done
${RM} -f ${ICON_THEME_DIR}/icon-theme.cache
;; ;;
*) *)
;; ;;

View file

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.92 2017/05/19 13:29:05 prlw1 Exp $ # $NetBSD: Makefile,v 1.93 2017/06/14 16:23:09 prlw1 Exp $
DISTNAME= gtk+-3.22.9 DISTNAME= gtk+-3.22.9
PKGNAME= ${DISTNAME:S/gtk/gtk3/} PKGNAME= ${DISTNAME:S/gtk/gtk3/}
@ -70,6 +70,10 @@ CPPFLAGS+= -DPREFIX="\"${PREFIX}\""
post-install: post-install:
${RM} -f ${DESTDIR}${GTK3_IMMODULES_DB} ${RM} -f ${DESTDIR}${GTK3_IMMODULES_DB}
FILES_SUBST+= GTK_UPDATE_ICON_CACHE="${PREFIX}/bin/gtk-update-icon-cache"
FILES_SUBST+= ICON_THEME_DIR="${LOCALBASE}/share/icons"
INSTALL_TEMPLATES+= ../../x11/gtk2/files/icon-cache.tmpl
_BUILDING_GTK3= yes _BUILDING_GTK3= yes
.include "modules.mk" .include "modules.mk"