[Buildroot] [git commit branch/2018.08.x] ustr: remove source code from target
Peter Korsgaard
peter at korsgaard.com
Wed Oct 24 11:45:02 UTC 2018
commit: https://git.buildroot.net/buildroot/commit/?id=40efc14bffde4e9aff474d8863bcb55758e178f8
branch: https://git.buildroot.net/buildroot/commit/?id=refs/heads/2018.08.x
For some reason, ustr installs its own source code, which means we end
up with 448 KB of source code in /usr/share in the target filesystem:
$ tree output/target/usr/share/
output/target/usr/share/
âââ ustr-1.0.4
âââ malloc-check.h
âââ ustr-b-code.h
âââ ustr-b-dbg-code.c
âââ ustr-b-opt-code.c
âââ ustr-cmp-code.h
âââ ustr-cmp-dbg-code.c
âââ ustr-cmp-internal.h
âââ ustr-cmp-opt-code.c
âââ ustr-cntl-code.h
âââ ustr-fmt-code.h
âââ ustr-fmt-dbg-code.c
âââ ustr-fmt-internal.h
[...]
$ du -sh output/target/usr/share/ustr-1.0.4/
448K output/target/usr/share/ustr-1.0.4/
So let's drop this source code in a post-install target hook.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni at bootlin.com>
Signed-off-by: Peter Korsgaard <peter at korsgaard.com>
(cherry picked from commit c27484b2efe0b1df57549f48f39e4d08e26c8200)
Signed-off-by: Peter Korsgaard <peter at korsgaard.com>
---
package/ustr/ustr.mk | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/package/ustr/ustr.mk b/package/ustr/ustr.mk
index 8346adbcf2..c99ada5276 100644
--- a/package/ustr/ustr.mk
+++ b/package/ustr/ustr.mk
@@ -28,5 +28,12 @@ USTR_MAKE_OPTS = all all-shared
USTR_CONF_OPTS += LDCONFIG=/bin/true
HOST_USTR_CONF_OPTS += LDCONFIG=/bin/true
+# for some reason, ustr finds it useful to install its source code in
+# /usr/share, which is totally useless on the target
+define USTR_REMOVE_SOURCE_CODE
+ $(RM) -rf $(TARGET_DIR)/usr/share/ustr-$(USTR_VERSION)
+endef
+USTR_POST_INSTALL_TARGET_HOOKS += USTR_REMOVE_SOURCE_CODE
+
$(eval $(autotools-package))
$(eval $(host-autotools-package))
More information about the buildroot
mailing list