pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc



Module Name:    pkgsrc
Committed By:   prlw1
Date:           Wed Jun 14 16:23:10 UTC 2017

Modified Files:
        pkgsrc/graphics/adwaita-icon-theme: Makefile
        pkgsrc/graphics/gnome-icon-theme: Makefile buildlink3.mk
        pkgsrc/graphics/hicolor-icon-theme: Makefile buildlink3.mk
        pkgsrc/mk/check: check-files.mk
        pkgsrc/mk/pkginstall: bsd.pkginstall.mk deinstall install
        pkgsrc/mk/plist: plist.mk print-plist.mk
        pkgsrc/pkgtools/pkglint4/files: makevars.map pkglint.pl
        pkgsrc/x11/gtk2: Makefile
        pkgsrc/x11/gtk2/files: icon-cache.tmpl
        pkgsrc/x11/gtk3: Makefile
Added Files:
        pkgsrc/mk/pkginstall: icon-themes

Log Message:
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+.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 pkgsrc/graphics/adwaita-icon-theme/Makefile
cvs rdiff -u -r1.100 -r1.101 pkgsrc/graphics/gnome-icon-theme/Makefile
cvs rdiff -u -r1.20 -r1.21 pkgsrc/graphics/gnome-icon-theme/buildlink3.mk
cvs rdiff -u -r1.22 -r1.23 pkgsrc/graphics/hicolor-icon-theme/Makefile
cvs rdiff -u -r1.19 -r1.20 pkgsrc/graphics/hicolor-icon-theme/buildlink3.mk
cvs rdiff -u -r1.34 -r1.35 pkgsrc/mk/check/check-files.mk
cvs rdiff -u -r1.70 -r1.71 pkgsrc/mk/pkginstall/bsd.pkginstall.mk
cvs rdiff -u -r1.4 -r1.5 pkgsrc/mk/pkginstall/deinstall \
    pkgsrc/mk/pkginstall/install
cvs rdiff -u -r0 -r1.1 pkgsrc/mk/pkginstall/icon-themes
cvs rdiff -u -r1.49 -r1.50 pkgsrc/mk/plist/plist.mk
cvs rdiff -u -r1.32 -r1.33 pkgsrc/mk/plist/print-plist.mk
cvs rdiff -u -r1.4 -r1.5 pkgsrc/pkgtools/pkglint4/files/makevars.map \
    pkgsrc/pkgtools/pkglint4/files/pkglint.pl
cvs rdiff -u -r1.285 -r1.286 pkgsrc/x11/gtk2/Makefile
cvs rdiff -u -r1.1 -r1.2 pkgsrc/x11/gtk2/files/icon-cache.tmpl
cvs rdiff -u -r1.92 -r1.93 pkgsrc/x11/gtk3/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/graphics/adwaita-icon-theme/Makefile
diff -u pkgsrc/graphics/adwaita-icon-theme/Makefile:1.7 pkgsrc/graphics/adwaita-icon-theme/Makefile:1.8
--- pkgsrc/graphics/adwaita-icon-theme/Makefile:1.7     Fri Sep 30 13:09:10 2016
+++ pkgsrc/graphics/adwaita-icon-theme/Makefile Wed Jun 14 16:23:09 2017
@@ -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
 CATEGORIES=            graphics gnome
@@ -26,11 +26,7 @@ PKGCONFIG_OVERRIDE+= adwaita-icon-theme.
 # but isn't
 INSTALLATION_DIRS+=    share/icons/Adwaita/96x96/places
 
-FILES_SUBST+=          GTK_UPDATE_ICON_CACHE="${LOCALBASE}/bin/gtk-update-icon-cache"
-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; }
+ICON_THEMES=           yes
 
 post-install:
 .for s in 16 22 24 32 48 96 256

Index: pkgsrc/graphics/gnome-icon-theme/Makefile
diff -u pkgsrc/graphics/gnome-icon-theme/Makefile:1.100 pkgsrc/graphics/gnome-icon-theme/Makefile:1.101
--- pkgsrc/graphics/gnome-icon-theme/Makefile:1.100     Sat Jul  9 06:38:21 2016
+++ pkgsrc/graphics/gnome-icon-theme/Makefile   Wed Jun 14 16:23:09 2017
@@ -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
 PKGREVISION=           1
@@ -27,11 +27,7 @@ PKGCONFIG_OVERRIDE=  gnome-icon-theme.pc.
 # the current pkgsrc version.
 BUILDLINK_API_DEPENDS.icon-naming-utils+=      icon-naming-utils>=0.8.90
 
-FILES_SUBST+=          GTK_UPDATE_ICON_CACHE="${LOCALBASE}/bin/gtk-update-icon-cache"
-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; }
+ICON_THEMES=   yes
 
 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

Index: pkgsrc/graphics/gnome-icon-theme/buildlink3.mk
diff -u pkgsrc/graphics/gnome-icon-theme/buildlink3.mk:1.20 pkgsrc/graphics/gnome-icon-theme/buildlink3.mk:1.21
--- pkgsrc/graphics/gnome-icon-theme/buildlink3.mk:1.20 Wed Nov 25 12:50:43 2015
+++ pkgsrc/graphics/gnome-icon-theme/buildlink3.mk      Wed Jun 14 16:23:09 2017
@@ -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
 
@@ -17,13 +17,7 @@ USE_TOOLS+=  perl
 .include "../../mk/bsd.fast.prefs.mk"
 
 .if !defined(GNOME_ICON_THEME_DEPEND_ONLY)
-FILES_SUBST+=          GTK_UPDATE_ICON_CACHE="${LOCALBASE}/bin/gtk-update-icon-cache"
-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
+ICON_THEMES=   yes
 
 .if !defined(NOOP_GTK_UPDATE_ICON_CACHE)
 NOOP_GTK_UPDATE_ICON_CACHE=

Index: pkgsrc/graphics/hicolor-icon-theme/Makefile
diff -u pkgsrc/graphics/hicolor-icon-theme/Makefile:1.22 pkgsrc/graphics/hicolor-icon-theme/Makefile:1.23
--- pkgsrc/graphics/hicolor-icon-theme/Makefile:1.22    Wed Nov 25 12:50:43 2015
+++ pkgsrc/graphics/hicolor-icon-theme/Makefile Wed Jun 14 16:23:09 2017
@@ -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
 CATEGORIES=    graphics
@@ -14,10 +14,6 @@ NO_BUILD=    YES
 USE_LANGUAGES= # none, not even C
 USE_TOOLS+=    gmake
 
-FILES_SUBST+=          GTK_UPDATE_ICON_CACHE="${LOCALBASE}/bin/gtk-update-icon-cache"
-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; }
+ICON_THEMES=   yes
 
 .include "../../mk/bsd.pkg.mk"

Index: pkgsrc/graphics/hicolor-icon-theme/buildlink3.mk
diff -u pkgsrc/graphics/hicolor-icon-theme/buildlink3.mk:1.19 pkgsrc/graphics/hicolor-icon-theme/buildlink3.mk:1.20
--- pkgsrc/graphics/hicolor-icon-theme/buildlink3.mk:1.19       Wed Nov 25 12:50:43 2015
+++ pkgsrc/graphics/hicolor-icon-theme/buildlink3.mk    Wed Jun 14 16:23:09 2017
@@ -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
 
@@ -12,16 +12,8 @@ BUILDLINK_PKGSRCDIR.hicolor-icon-theme?=
 .include "../../mk/bsd.fast.prefs.mk"
 
 .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
-# 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
+
+ICON_THEMES=   yes
 
 .if !defined(NOOP_GTK_UPDATE_ICON_CACHE)
 NOOP_GTK_UPDATE_ICON_CACHE=

Index: pkgsrc/mk/check/check-files.mk
diff -u pkgsrc/mk/check/check-files.mk:1.34 pkgsrc/mk/check/check-files.mk:1.35
--- pkgsrc/mk/check/check-files.mk:1.34 Thu Jun  1 02:15:10 2017
+++ pkgsrc/mk/check/check-files.mk      Wed Jun 14 16:23:09 2017
@@ -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.
 # For that purpose it records the file list of LOCALBASE before and
@@ -101,6 +101,11 @@ CHECK_FILES_SKIP+= ${PREFIX}/.*/fonts.sc
 CHECK_FILES_SKIP+=     ${PREFIX}/.*/fonts.cache-1
 .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
 CHECK_FILES_SKIP+=     ${PREFIX}/lib/charset.alias
 

Index: pkgsrc/mk/pkginstall/bsd.pkginstall.mk
diff -u pkgsrc/mk/pkginstall/bsd.pkginstall.mk:1.70 pkgsrc/mk/pkginstall/bsd.pkginstall.mk:1.71
--- pkgsrc/mk/pkginstall/bsd.pkginstall.mk:1.70 Thu Jun  1 13:29:18 2017
+++ pkgsrc/mk/pkginstall/bsd.pkginstall.mk      Wed Jun 14 16:23:09 2017
@@ -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
 # common INSTALL/DEINSTALL scripts framework.  To use the pkginstall
@@ -47,6 +47,7 @@ _PKG_VARS.pkginstall+= \
        PKG_SYSCONFDIR_PERMS \
        PKG_SHELL \
        FONTS_DIRS.ttf FONTS_DIRS.type1 FONTS_DIRS.x11 \
+       ICON_THEMES
 _SYS_VARS.pkginstall= \
        SETUID_ROOT_PERMS \
        SETGID_GAMES_PERMS \
@@ -965,6 +966,61 @@ ${_INSTALL_FONTS_FILE}: ../../mk/pkginst
                ${TOUCH} ${TOUCH_ARGS} ${.TARGET};                      \
        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
 #      automatically add any needed users/groups to the system using
 #      useradd/groupadd.  It is either YES or NO and defaults to YES.

Index: pkgsrc/mk/pkginstall/deinstall
diff -u pkgsrc/mk/pkginstall/deinstall:1.4 pkgsrc/mk/pkginstall/deinstall:1.5
--- pkgsrc/mk/pkginstall/deinstall:1.4  Tue Apr 12 15:52:29 2016
+++ pkgsrc/mk/pkginstall/deinstall      Wed Jun 14 16:23:09 2017
@@ -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
 DEINSTALL)
@@ -14,6 +14,11 @@ DEINSTALL)
        ${TEST} ! -x ./+INFO_FILES ||
                ./+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.
        #
        ${TEST} ! -x ./+SHELL ||
@@ -35,6 +40,11 @@ POST-DEINSTALL)
        ${TEST} ! -x ./+FONTS ||
                ./+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.
        #
        ${TEST} ! -x ./+SHLIBS ||
Index: pkgsrc/mk/pkginstall/install
diff -u pkgsrc/mk/pkginstall/install:1.4 pkgsrc/mk/pkginstall/install:1.5
--- pkgsrc/mk/pkginstall/install:1.4    Tue Apr 12 15:52:29 2016
+++ pkgsrc/mk/pkginstall/install        Wed Jun 14 16:23:09 2017
@@ -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
 PRE-INSTALL)
@@ -47,6 +47,12 @@ POST-INSTALL)
        ${TEST} ! -x ./+FONTS ||
                ./+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.
        #
        ${TEST} ! -x ./+DIRS ||

Index: pkgsrc/mk/plist/plist.mk
diff -u pkgsrc/mk/plist/plist.mk:1.49 pkgsrc/mk/plist/plist.mk:1.50
--- pkgsrc/mk/plist/plist.mk:1.49       Sat Jul  4 16:18:38 2015
+++ pkgsrc/mk/plist/plist.mk    Wed Jun 14 16:23:09 2017
@@ -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
 # pkg_create(8).
@@ -283,6 +283,12 @@ INFO_FILES_cmd=                                                            \
        ${AWK} '($$0 !~ "-[0-9]*(\\.gz)?$$") { print }'
 .endif
 
+ICON_THEMES_cmd=                                                       \
+       ${CAT} ${PLIST} |                                               \
+       ${PKGSRC_SETENV} ${_PLIST_AWK_ENV} ${AWK} -F /                  \
+       '$$0 ~ "^share/icons/[^/]+/.*$$" { print $$3 }' |               \
+       ${SORT} -u
+
 ######################################################################
 ### plist-clean (PRIVATE)
 ######################################################################

Index: pkgsrc/mk/plist/print-plist.mk
diff -u pkgsrc/mk/plist/print-plist.mk:1.32 pkgsrc/mk/plist/print-plist.mk:1.33
--- pkgsrc/mk/plist/print-plist.mk:1.32 Mon Jul 25 21:57:23 2016
+++ pkgsrc/mk/plist/print-plist.mk      Wed Jun 14 16:23:09 2017
@@ -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
@@ -43,6 +43,9 @@ _PRINT_PLIST_AWK_IGNORE+=     || ($$0 ~ /^.*
     (defined(FONTS_DIRS.x11) && !empty(FONTS_DIRS.x11:M*))
 _PRINT_PLIST_AWK_IGNORE+=      || ($$0 ~ /^.*\/fonts\.cache-1/)
 .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
 # empty directories.

Index: pkgsrc/pkgtools/pkglint4/files/makevars.map
diff -u pkgsrc/pkgtools/pkglint4/files/makevars.map:1.4 pkgsrc/pkgtools/pkglint4/files/makevars.map:1.5
--- pkgsrc/pkgtools/pkglint4/files/makevars.map:1.4     Wed May 24 19:51:12 2017
+++ pkgsrc/pkgtools/pkglint4/files/makevars.map Wed Jun 14 16:23:09 2017
@@ -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
@@ -384,6 +384,7 @@ GNU_CONFIGURE_PREFIX        Pathname [m:s]
 HAS_CONFIGURE          Yes [m:s,c:s]
 HEADER_TEMPLATES       List of Pathname [$package_list]
 HOMEPAGE               URL [$package]
+ICON_THEMES            Yes
 IGNORE_PKG.*           Yes [*:sp]
 INCOMPAT_CURSES                InternalList of PlatformTriple [m:as]
 INCOMPAT_ICONV         InternalList of PlatformTriple
Index: pkgsrc/pkgtools/pkglint4/files/pkglint.pl
diff -u pkgsrc/pkgtools/pkglint4/files/pkglint.pl:1.4 pkgsrc/pkgtools/pkglint4/files/pkglint.pl:1.5
--- pkgsrc/pkgtools/pkglint4/files/pkglint.pl:1.4       Tue Feb  2 08:02:29 2016
+++ pkgsrc/pkgtools/pkglint4/files/pkglint.pl   Wed Jun 14 16:23:09 2017
@@ -1,5 +1,5 @@
 #! @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
@@ -5284,7 +5284,12 @@ sub checkfile_PLIST($) {
 "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";
                                if (defined($pkgctx_included) && !exists($pkgctx_included->{$f})) {
                                        $line->log_error("Please .include \"$f\" in the Makefile");

Index: pkgsrc/x11/gtk2/Makefile
diff -u pkgsrc/x11/gtk2/Makefile:1.285 pkgsrc/x11/gtk2/Makefile:1.286
--- pkgsrc/x11/gtk2/Makefile:1.285      Fri May 19 13:29:05 2017
+++ pkgsrc/x11/gtk2/Makefile    Wed Jun 14 16:23:09 2017
@@ -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
 PKGNAME=       ${DISTNAME:S/gtk/gtk2/}
@@ -90,9 +90,8 @@ post-install:
        ${RM} -f ${DESTDIR}${GTK_IMMODULES_DB}
 
 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
-PRINT_PLIST_AWK+=      /^share\/icons\/hicolor\/icon-theme.cache$$/ { next; }
 
 _BUILDING_GTK2=        yes
 .include "modules.mk"

Index: pkgsrc/x11/gtk2/files/icon-cache.tmpl
diff -u pkgsrc/x11/gtk2/files/icon-cache.tmpl:1.1 pkgsrc/x11/gtk2/files/icon-cache.tmpl:1.2
--- pkgsrc/x11/gtk2/files/icon-cache.tmpl:1.1   Fri Jan 26 00:55:01 2007
+++ pkgsrc/x11/gtk2/files/icon-cache.tmpl       Wed Jun 14 16:23:09 2017
@@ -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.
 #
 
 GTK_UPDATE_ICON_CACHE="@GTK_UPDATE_ICON_CACHE@"
 ICON_THEME_DIR="@ICON_THEME_DIR@"
+LS="@LS@"
 
 case ${STAGE} in
 POST-INSTALL)
        ${TEST} -d ${ICON_THEME_DIR} && \
-       ${GTK_UPDATE_ICON_CACHE} -f -t ${ICON_THEME_DIR} >/dev/null 2>&1 || \
-               ${TRUE}
-       ;;
-DEINSTALL)
-       ${RM} -f ${ICON_THEME_DIR}/icon-theme.cache
+       ${LS} ${ICON_THEME_DIR} | while read theme; do
+               ${TEST} -f ${ICON_THEME_DIR}/${theme}/index.theme && \
+               ${GTK_UPDATE_ICON_CACHE} -q -f -t ${ICON_THEME_DIR}/${theme}
+       done
        ;;
 *)
        ;;

Index: pkgsrc/x11/gtk3/Makefile
diff -u pkgsrc/x11/gtk3/Makefile:1.92 pkgsrc/x11/gtk3/Makefile:1.93
--- pkgsrc/x11/gtk3/Makefile:1.92       Fri May 19 13:29:05 2017
+++ pkgsrc/x11/gtk3/Makefile    Wed Jun 14 16:23:09 2017
@@ -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
 PKGNAME=       ${DISTNAME:S/gtk/gtk3/}
@@ -70,6 +70,10 @@ CPPFLAGS+=           -DPREFIX="\"${PREFIX}\""
 post-install:
        ${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
 .include "modules.mk"
 

Added files:

Index: pkgsrc/mk/pkginstall/icon-themes
diff -u /dev/null pkgsrc/mk/pkginstall/icon-themes:1.1
--- /dev/null   Wed Jun 14 16:23:10 2017
+++ pkgsrc/mk/pkginstall/icon-themes    Wed Jun 14 16:23:09 2017
@@ -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
+



Home | Main Index | Thread Index | Old Index