package/protobuf: remove target version of 'protoc'
authorThomas De Schampheleire <thomas.de_schampheleire@nokia.com>
Thu, 11 Feb 2021 10:40:01 +0000 (11:40 +0100)
committerPeter Korsgaard <peter@korsgaard.com>
Thu, 11 Feb 2021 22:14:11 +0000 (23:14 +0100)
The tool 'protoc' and its associated library libprotoc.so are only
needed during development, to convert a protocol buffer definition in the
associated code for a specific code language.

Buildroot does not officially support creating a development environment on
target, so remove these files to reduce disk usage by more than 1.5 MB
(stripped, uncompressed).

Signed-off-by: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
package/protobuf/protobuf.mk

index 661b7a6b816c3e484d6dbe4156f62266f142c21a..df708819cbf7b57bbd006bc1dcbffffeaa5f3940 100644 (file)
@@ -36,5 +36,12 @@ ifeq ($(BR2_PACKAGE_ZLIB),y)
 PROTOBUF_DEPENDENCIES += zlib
 endif
 
+define PROTOBUF_REMOVE_UNNECESSARY_TARGET_FILES
+       rm -rf $(TARGET_DIR)/usr/bin/protoc
+       rm -rf $(TARGET_DIR)/usr/lib/libprotoc.so*
+endef
+
+PROTOBUF_POST_INSTALL_TARGET_HOOKS += PROTOBUF_REMOVE_UNNECESSARY_TARGET_FILES
+
 $(eval $(autotools-package))
 $(eval $(host-autotools-package))