libglib2: improve dev file removal
PATCH v2 1/1 libglib2: improve dev file removal
* Remove /usr/share/glib-2.0 rmdir from DEV_FILES hook, if we are not using gdb the GDB_FILES hook will hit and remove it anway, and if we are indeed using gdb we need it.
* Remove glib-compile-resources and glib-compile-schemas binaries, these aren't used for runtime purposes.
* Remove /usr/share/glib-2.0/codegen and /usr/share/glib-2.0/schemas, as with the binaries these aren't used for runtime purposes either.
Size savings delta +800 KB.
--- package/libglib2/libglib2.mk | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
package/libglib2/libglib2.mk +2 -3
@@ -128,9 +128,8 @@ endif 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 schemas) + rm -f $(addprefix $(TARGET_DIR)/usr/bin/,glib-compile-resources glib-compile-schemas glib-genmarshal glib-gettextize glib-mkenums gobject-query gtester gtester-report) endef LIBGLIB2_POST_INSTALL_TARGET_HOOKS += LIBGLIB2_REMOVE_DEV_FILES
Signature · 1 line
2.4.10
PATCH v2 1/1 libglib2: improve dev file removal
Hello,
Quoted 23 lines · Gustavo Zacarias
* Remove
/usr/share/glib-2.0rmdir fromDEV_FILEShook, if we are not using gdb theGDB_FILEShook will hit and remove it anway, and if we are indeed using gdb we need it.* Remove glib-compile-resources and glib-compile-schemas binaries, these aren't used for runtime purposes.
* Remove
/usr/share/glib-2.0/codegenand/usr/share/glib-2.0/schemas, as with the binaries these aren't used for runtime purposes either.Size savings delta +800 KB.
Signed-off-by Gustavo Zacarias <[email protected]>--- package/libglib2/libglib2.mk | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)package/libglib2/libglib2.mk +0
-0@@ -128,9 +128,8 @@ endif
package/libglib2/libglib2.mk endif · line 135
Quoted 10 lines
package/libglib2/libglib2.mk +2
-3define 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 schemas) + rm -f $(addprefix $(TARGET_DIR)/usr/bin/,glib-compile-resources glib-compile-schemas glib-genmarshal glib-gettextize glib-mkenums gobject-query gtester gtester-report) endef LIBGLIB2_POST_INSTALL_TARGET_HOOKS += LIBGLIB2_REMOVE_DEV_FILES
Seems better, at least I understand. There is one minor point I don't entirely like is that you make an assumption on the ordering of the install target hooks calls.
Therefore, I think I would have preferred:
ifneq ($(BR2_PACKAGE_GDB),y)
define LIBGLIB2_REMOVE_GDB_FILES
rm -rf $(TARGET_DIR)/usr/share/glib-2.0/gdb
endef
endif
define LIBGLIB2_REMOVE_DEV_FILES
rm -rf $(TARGET_DIR)/usr/lib/glib-2.0 rm -rf $(addprefix $(TARGET_DIR)/usr/share/glib-2.0/,codegen gettext schemas) $(LIBGLIB2_REMOVE_GDB_FILES) rmdir --ignore-fail-on-non-empty $(TARGET_DIR)/usr/share/glib-2.0 ...
endef
But it's really a minor point, and somewhat pedantic, I admit, so I'm also fine with your patch as-is.
Best regards,
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
PATCH v2 1/1 libglib2: improve dev file removal
Quoted 18 lines · Thomas Petazzoni
Seems better, at least I understand. There is one minor point I don't entirely like is that you make an assumption on the ordering of the install target hooks calls.
Therefore, I think I would have preferred:
ifneq ($(BR2_PACKAGE_GDB),y)
defineLIBGLIB2_REMOVE_GDB_FILESrm -rf $(TARGET_DIR)/usr/share/glib-2.0/gdbendef
endifdefine
LIBGLIB2_REMOVE_DEV_FILESrm -rf $(TARGET_DIR)/usr/lib/glib-2.0 rm -rf $(addprefix $(TARGET_DIR)/usr/share/glib-2.0/,codegen gettext schemas) $(LIBGLIB2_REMOVE_GDB_FILES) rmdir --ignore-fail-on-non-empty $(TARGET_DIR)/usr/share/glib-2.0 ...
Quoted 8 lines
endef
But it's really a minor point, and somewhat pedantic, I admit, so I'm also fine with your patch as-is.
Best regards,
Thomas
Hi.
This requires some refinement which i stumbled upon when testing gsettings, the schema sources itself (xml files) aren't required, however some programs (not yet submitted) require the compiled result, which is normally /usr/share/glib-2.0/schemas/gschemas.compiled But, we don't handle that at all, so it won't work either way. I'll add the post-processing hook for this to work properly and resend both the cleanup plus the compile, which will likely be via host glib-compile-schemas from staging schemas (which will require some packages to enable staging install).
Regards.