Skip to contentSkip to conversation

ustr: remove source code from target

PATCH New Thomas Petazzoni 2 participants 3 messages Oct 11, 2018 – Oct 24, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ustr: remove source code from target

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.

---
 package/ustr/ustr.mk | 7 +++++++
 1 file changed, 7 insertions(+)
package/ustr/ustr.mk +7 -0
index 8346adbcf2..c99ada5276 100644
@@ -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))
Signature · 1 line
2.14.4
#1 lore raw

PATCH 1/1 ustr: remove source code from target

Quoted 22 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thomas" == Thomas Petazzoni <[email protected]> writes:

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
    [...]
Quoted 6 lines
$ 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.

Committed, thanks.

Signature · 1 line
Bye, Peter Korsgaard
#2 lore raw

PATCH 1/1 ustr: remove source code from target

In reply to Thomas Petazzoni
Quoted 22 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thomas" == Thomas Petazzoni <[email protected]> writes:

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
    [...]
Quoted 6 lines
$ 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.

Committed to 2018.02.x and 2018.08.x, thanks.

Signature · 1 line
Bye, Peter Korsgaard