Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/2] libglib2: improve dev file handling
@ 2016-03-10 14:52 Gustavo Zacarias
  2016-03-10 14:52 ` [Buildroot] [PATCH 2/2] connman-gtk: new package Gustavo Zacarias
  2016-03-20 21:14 ` [Buildroot] [PATCH 1/2] libglib2: improve dev file handling Thomas Petazzoni
  0 siblings, 2 replies; 3+ messages in thread
From: Gustavo Zacarias @ 2016-03-10 14:52 UTC (permalink / raw)
  To: buildroot

Remove source schema files from target
(/usr/share/glib-2.0/schemas/*.dtd and *.xml) at target finalization
time.
This is because other packages install schemas as well to avoid
duplicating file removal efforts all around.

Add a schema compiler run on target finalization as well - we previously
didn't do this since not many packages use it, however the upcoming
connman-gtk package does require a valid gschemas.compiled to work
properly.
We also do this at target finalization to avoid each package handling
this on their own.

Purge some extra binaries and files from the target, like the schema
compiler to save additional space since they're unused at run time.

Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
---
 package/libglib2/libglib2.mk | 37 +++++++++++++++++++++++++++++--------
 1 file changed, 29 insertions(+), 8 deletions(-)

diff --git a/package/libglib2/libglib2.mk b/package/libglib2/libglib2.mk
index ea45f4a..09cdd87 100644
--- a/package/libglib2/libglib2.mk
+++ b/package/libglib2/libglib2.mk
@@ -126,22 +126,43 @@ else
 LIBGLIB2_CONF_OPTS += --with-pcre=internal
 endif
 
+# Purge gdb-related files
+ifneq ($(BR2_PACKAGE_GDB),y)
+define LIBGLIB2_REMOVE_GDB_FILES
+	rm -rf $(TARGET_DIR)/usr/share/glib-2.0/gdb
+endef
+endif
+
+# Purge useless binaries from target
 define LIBGLIB2_REMOVE_DEV_FILES
 	rm -rf $(TARGET_DIR)/usr/lib/glib-2.0
-	rm -rf $(TARGET_DIR)/usr/share/glib-2.0/gettext
-	rmdir --ignore-fail-on-non-empty $(TARGET_DIR)/usr/share/glib-2.0
-	rm -f $(addprefix $(TARGET_DIR)/usr/bin/,glib-genmarshal glib-gettextize glib-mkenums gobject-query gtester gtester-report)
+	rm -rf $(addprefix $(TARGET_DIR)/usr/share/glib-2.0/,codegen gettext)
+	rm -f $(addprefix $(TARGET_DIR)/usr/bin/,glib-compile-schemas glib-compile-resources glib-genmarshal glib-gettextize glib-mkenums gobject-query gtester gtester-report)
+	$(LIBGLIB2_REMOVE_GDB_FILES)
 endef
 
 LIBGLIB2_POST_INSTALL_TARGET_HOOKS += LIBGLIB2_REMOVE_DEV_FILES
 
-define LIBGLIB2_REMOVE_GDB_FILES
-	rm -rf $(TARGET_DIR)/usr/share/glib-2.0/gdb
-	rmdir --ignore-fail-on-non-empty $(TARGET_DIR)/usr/share/glib-2.0
+# Remove schema sources/DTDs, we use staging ones to compile them.
+# Do so at target finalization since other packages install additional
+# ones and we want to deal with it in a single place.
+define LIBGLIB2_REMOVE_TARGET_SCHEMAS
+	rm -f $(TARGET_DIR)/usr/share/glib-2.0/schemas/*.xml \
+		$(TARGET_DIR)/usr/share/glib-2.0/schemas/*.dtd
 endef
 
-ifneq ($(BR2_PACKAGE_GDB),y)
-LIBGLIB2_POST_INSTALL_TARGET_HOOKS += LIBGLIB2_REMOVE_GDB_FILES
+# Compile schemas at target finalization since other packages install
+# them as well, and better do it in a central place.
+# It's used at run time so it doesn't matter defering it.
+define LIBGLIB2_COMPILE_SCHEMAS
+	$(HOST_DIR)/usr/bin/glib-compile-schemas \
+		$(STAGING_DIR)/usr/share/glib-2.0/schemas \
+		--targetdir=$(TARGET_DIR)/usr/share/glib-2.0/schemas
+endef
+
+ifeq ($(BR2_PACKAGE_LIBGLIB2),y)
+TARGET_FINALIZE_HOOKS += LIBGLIB2_REMOVE_TARGET_SCHEMAS
+TARGET_FINALIZE_HOOKS += LIBGLIB2_COMPILE_SCHEMAS
 endif
 
 $(eval $(autotools-package))
-- 
2.4.10

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-03-20 21:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-10 14:52 [Buildroot] [PATCH 1/2] libglib2: improve dev file handling Gustavo Zacarias
2016-03-10 14:52 ` [Buildroot] [PATCH 2/2] connman-gtk: new package Gustavo Zacarias
2016-03-20 21:14 ` [Buildroot] [PATCH 1/2] libglib2: improve dev file handling Thomas Petazzoni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox