summaryrefslogtreecommitdiff
path: root/devel
diff options
context:
space:
mode:
authorjmmv <jmmv>2011-01-18 10:03:59 +0000
committerjmmv <jmmv>2011-01-18 10:03:59 +0000
commitea19bc3fbc7bd16ad469b14a7f1775010642448a (patch)
tree14110ae5bde8ff78512b91c5b2b596772c631d2a /devel
parent03e3b8462af053c40c20b7746fd81733d7b3c864 (diff)
downloadpkgsrc-ea19bc3fbc7bd16ad469b14a7f1775010642448a.tar.gz
Add a schemas.mk file to let packages that install GSettings schemas to
rebuild the precompiled database upon install/deinstall. This is mostly a copy/paste of the same logic to deal with gio modules found in modules.mk. No PKGREVISION bump because this does not affect the glib2 package in itself.
Diffstat (limited to 'devel')
-rw-r--r--devel/glib2/files/schemas.tmpl18
-rw-r--r--devel/glib2/schemas.mk23
2 files changed, 41 insertions, 0 deletions
diff --git a/devel/glib2/files/schemas.tmpl b/devel/glib2/files/schemas.tmpl
new file mode 100644
index 00000000000..33313ea4cea
--- /dev/null
+++ b/devel/glib2/files/schemas.tmpl
@@ -0,0 +1,18 @@
+# $NetBSD: schemas.tmpl,v 1.1 2011/01/18 10:03:59 jmmv Exp $
+#
+# Recompile the GSettings schemas.
+#
+
+GLIB_SCHEMAS_DIR="@GLIB_SCHEMAS_DIR@"
+GLIB_COMPILE_SCHEMAS="@GLIB_COMPILE_SCHEMAS@"
+
+case "${STAGE}" in
+POST-INSTALL)
+ XDG_DATA_DIRS= "${GLIB_COMPILE_SCHEMAS}" "${GLIB_SCHEMAS_DIR}"
+ ;;
+POST-DEINSTALL)
+ XDG_DATA_DIRS= "${GLIB_COMPILE_SCHEMAS}" "${GLIB_SCHEMAS_DIR}"
+ ;;
+*)
+ ;;
+esac
diff --git a/devel/glib2/schemas.mk b/devel/glib2/schemas.mk
new file mode 100644
index 00000000000..df121556817
--- /dev/null
+++ b/devel/glib2/schemas.mk
@@ -0,0 +1,23 @@
+# $NetBSD: schemas.mk,v 1.1 2011/01/18 10:03:59 jmmv Exp $
+#
+# This Makefile fragment is intended to be included by packages that install
+# GSettings schemas. It takes care of rebuilding the corresponding databases
+# at (de)installation time.
+#
+
+.if !defined(GLIB_SCHEMAS_MK)
+GLIB_SCHEMAS_MK= # defined
+
+GLIB_COMPILE_SCHEMAS= ${BUILDLINK_PREFIX.glib2}/bin/glib-compile-schemas
+
+FILES_SUBST+= GLIB_SCHEMAS_DIR=${GLIB_SCHEMAS_DIR:Q}
+FILES_SUBST+= GLIB_COMPILE_SCHEMAS=${GLIB_COMPILE_SCHEMAS:Q}
+GLIB_SCHEMAS_DIR=${BUILDLINK_PREFIX.glib2}/share/glib-2.0/schemas
+INSTALL_TEMPLATES+= ../../devel/glib2/files/schemas.tmpl
+DEINSTALL_TEMPLATES+= ../../devel/glib2/files/schemas.tmpl
+
+TOOLS_NOOP+= glib-compile-schemas
+
+.include "../../devel/glib2/buildlink3.mk"
+
+.endif # GLIB_SCHEMAS_MK