All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] package/mono: allow to select which folders to install to target
@ 2022-10-18 23:46 Giulio Benetti
  2022-10-19 16:16 ` Angelo Compagnucci
  2022-10-31 12:25 ` Thomas Petazzoni via buildroot
  0 siblings, 2 replies; 12+ messages in thread
From: Giulio Benetti @ 2022-10-18 23:46 UTC (permalink / raw)
  To: buildroot; +Cc: Angelo Compagnucci, Giulio Benetti

At the moment all APIs folders are copied to target increasing the size of
rootfs of ~190MB. Allow to select which API folders we want to copy to
target to shrink rootfs down.

Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
---
 package/mono/Config.in | 16 ++++++++++++++++
 package/mono/mono.mk   | 12 ++++++++++++
 2 files changed, 28 insertions(+)

diff --git a/package/mono/Config.in b/package/mono/Config.in
index 76178bcf9b..8690ee68ef 100644
--- a/package/mono/Config.in
+++ b/package/mono/Config.in
@@ -23,6 +23,22 @@ config BR2_PACKAGE_MONO
 
 	  http://download.mono-project.com/sources/mono/
 
+config BR2_PACKAGE_MONO_SPECIFY_FOLDERS_TO_INSTALL
+	bool "Specify folders to install to target"
+	help
+	  Allow to specify which Mono folder to install to target
+
+if BR2_PACKAGE_MONO_SPECIFY_FOLDERS_TO_INSTALL
+
+config BR2_PACKAGE_MONO_FOLDERS_TO_INSTALL
+	string "Mono folders to install to target"
+	help
+	  Paths to Mono folders to install to target /usr/lib/mono/.
+	  Only these folders will be copied to the target and not all
+	  the built ones. You can provide a list of folders separated by
+	  by spaces.
+
+endif
 comment "mono needs a toolchain w/ C++, NPTL, dynamic library"
 	depends on BR2_PACKAGE_MONO_ARCH_SUPPORTS
 	depends on !BR2_INSTALL_LIBSTDCPP || \
diff --git a/package/mono/mono.mk b/package/mono/mono.mk
index 219effc5d3..8036d23205 100644
--- a/package/mono/mono.mk
+++ b/package/mono/mono.mk
@@ -30,10 +30,22 @@ MONO_CONF_OPTS = $(MONO_COMMON_CONF_OPTS) --disable-mcs-build
 
 # The libraries have been built by the host-mono build. Since they are
 # architecture-independent, we simply copy them to the target.
+ifeq ($(BR2_PACKAGE_MONO_SPECIFY_FOLDERS_TO_INSTALL),y)
+# Copy only selected folders
+define MONO_INSTALL_LIBS
+	mkdir -p $(TARGET_DIR)/usr/lib/mono
+	(for dir in $(call qstrip,$(BR2_PACKAGE_MONO_FOLDERS_TO_INSTALL)); do \
+		rsync -av --exclude=*.so --exclude=*.mdb \
+		$(HOST_DIR)/lib/mono/$${dir} $(TARGET_DIR)/usr/lib/mono; \
+	done)
+endef
+else
+# Copy all folders
 define MONO_INSTALL_LIBS
 	rsync -av --exclude=*.so --exclude=*.mdb \
 		$(HOST_DIR)/lib/mono $(TARGET_DIR)/usr/lib/
 endef
+endif
 
 MONO_POST_INSTALL_TARGET_HOOKS += MONO_INSTALL_LIBS
 
-- 
2.34.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

end of thread, other threads:[~2022-11-01 20:31 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-18 23:46 [Buildroot] [PATCH] package/mono: allow to select which folders to install to target Giulio Benetti
2022-10-19 16:16 ` Angelo Compagnucci
2022-10-31 12:25 ` Thomas Petazzoni via buildroot
2022-10-31 12:54   ` Yann E. MORIN
2022-11-01  2:27     ` Giulio Benetti
2022-11-01  8:32       ` Yann E. MORIN
2022-11-01  9:19         ` Angelo Compagnucci
2022-11-01 17:42           ` Yann E. MORIN
2022-11-01 20:30             ` Angelo Compagnucci
2022-11-01 18:17           ` Giulio Benetti
2022-11-01 16:44         ` Giulio Benetti
2022-11-01  2:19   ` Giulio Benetti

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.