Skip to contentSkip to conversation

Mono new package

PATCH Superseded Angelo Compagnucci 1 participant 3 messages Oct 20, 2014

v5 of 6 Superseded Latest is v6 →

lore
Share & tools
lore
#0 lore raw

v5 cover Mono new package

This patch adds mono and monolite packages.

Chengelog:

* Defaulting BR2_PACKAGE_MONO_45 now depends on select
* Minor formatting issues

[Thomas:

- Merge mono-managed and mono-native as a single package. The mono-managed stuff is done by the host variant of the mono package, while the mono-native stuff is done as the target variant of the mono package.

- Introduce a BR2_PACKAGE_MONO_ARCH_SUPPORTS blind Config.in option to make sure the IPv6 related comment is not displayed when the architecture being used anyway doesn't support Mono.

- Add a patch to Mono to fix the C library path when uClibc and Musl is used. This is a better approach than the POST_INSTALL_TARGET_HOOKS because this approach can potentially be submitted upstreamed, which ultimately allows to simplify the Buildroot package.

- Depend on a 'monolite' package, and use it instead of letting Mono download Monolite by itself, which circumvents Buildroot's download infrastructure.
mono-managed stuff is done by the host variant of the mono package, while the mono-native stuff is done as the target variant of the mono package.

- Introduce a BR2_PACKAGE_MONO_ARCH_SUPPORTS blind Config.in option to make sure the IPv6 related comment is not displayed when the architecture being used anyway doesn't support Mono.

- Add a patch to Mono to fix the C library path when uClibc and Musl is used. This is a better approach than the POST_INSTALL_TARGET_HOOKS because this approach can potentially be submitted upstreamed, which ultimately allows to simplify the Buildroot package.

- Depend on a 'monolite' package, and use it instead of letting Mono download Monolite by itself, which circumvents Buildroot's download infrastructure.

- Move the installation of Mono libraries to the target Mono package, as a POST_INSTALL_TARGET_HOOKS.]

[Angelo:

- Bump to the latest Mono version 3.10.0

- Add selection for .Net runtime compilation and installation in target.]

Angelo Compagnucci (2):
package/monolite: new package
package/mono: new package

 package/Config.in                               |  1 +
 package/mono/Config.in                          | 40 ++++++++++++++++
 package/mono/mono-001-gc-fix-uclibc.patch       | 16 +++++++
 package/mono/mono-002-support-uclibc-musl.patch | 25 ++++++++++
 package/mono/mono.mk                            | 64 +++++++++++++++++++++++++
 package/monolite/monolite.mk                    | 17 +++++++
 6 files changed, 163 insertions(+)
 create mode 100644 package/mono/Config.in
 create mode 100644 package/mono/mono-001-gc-fix-uclibc.patch
 create mode 100644 package/mono/mono-002-support-uclibc-musl.patch
 create mode 100644 package/mono/mono.mk
 create mode 100644 package/monolite/monolite.mk
Signature · 1 line
2.1.1
#1 lore raw

PATCH v5 1/2 package/monolite: new package

This patch adds Monolite package. This package is a dependency of Mono package.

---
 package/monolite/monolite.mk | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
 create mode 100644 package/monolite/monolite.mk
package/monolite/monolite.mk new file +17 -0
new file mode 100644
index 0000000..82eaf57
@@ -0,0 +1,17 @@
+#############################################################
+#
+# monolite
+#
+#############################################################
+
+MONOLITE_VERSION = 111
+MONOLITE_SITE = http://storage.bos.xamarin.com/mono-dist-master/latest/
+MONOLITE_SOURCE = monolite-$(MONOLITE_VERSION)-latest.tar.gz
+MONOLITE_LICENSE = Dual license LGPL, commercial
+
+define HOST_MONOLITE_INSTALL_CMDS
+	mkdir -p $(HOST_DIR)/usr/lib/monolite
+	cp $(@D)/* $(HOST_DIR)/usr/lib/monolite
+endef
+
+$(eval $(host-generic-package))
Signature · 1 line
2.1.1
#2 lore raw

PATCH v5 2/2 package/mono: new package

In reply to Angelo Compagnucci

This patch adds the complete Mono implementation. This patch builds both the native and managed parts.

---
 package/Config.in                               |  1 +
 package/mono/Config.in                          | 40 ++++++++++++++++
 package/mono/mono-001-gc-fix-uclibc.patch       | 16 +++++++
 package/mono/mono-002-support-uclibc-musl.patch | 25 ++++++++++
 package/mono/mono.mk                            | 64 +++++++++++++++++++++++++
 5 files changed, 146 insertions(+)
 create mode 100644 package/mono/Config.in
 create mode 100644 package/mono/mono-001-gc-fix-uclibc.patch
 create mode 100644 package/mono/mono-002-support-uclibc-musl.patch
 create mode 100644 package/mono/mono.mk
package/Config.in +1 -0
index 19bb9bf..d615872 100644
@@ -435,6 +435,7 @@ menu "Lua libraries/modules"
 	source "package/xavante/Config.in"
 endmenu
 endif
+	source "package/mono/Config.in"
 	source "package/nodejs/Config.in"
 	source "package/perl/Config.in"
 if BR2_PACKAGE_PERL
package/mono/Config.in new file +40 -0
new file mode 100644
index 0000000..f8f4895
@@ -0,0 +1,40 @@
+config BR2_PACKAGE_MONO_ARCH_SUPPORTS
+	bool
+	default y if (BR2_arm || BR2_armeb || BR2_i386 || BR2_mips || \
+		      BR2_mipsel || BR2_powerpc || BR2_sparc || BR2_x86_64)
+
+config BR2_PACKAGE_MONO
+	bool "mono"
+	depends on BR2_PACKAGE_MONO_ARCH_SUPPORTS
+	depends on BR2_INET_IPV6
+	select BR2_PACKAGE_MONO_45 if !BR2_PACKAGE_MONO_20 && !BR2_PACKAGE_MONO_40
+	help
+	  An open source, cross-platform, implementation of C#
+	  and the CLR that is binary compatible with Microsoft.NET.
+
+	  http://download.mono-project.com/sources/mono/
+
+if BR2_PACKAGE_MONO
+
+config BR2_PACKAGE_MONO_20
+	bool "2.0/3.5 .Net Runtime"
+	help
+	  This option enables the installation of the 2.0/3.5 version
+	  of the Mono .Net runtime to the target
+
+config BR2_PACKAGE_MONO_40
+	bool "4.0 .Net Runtime"
+	help
+	  This option enables the installation of the 4.0 version
+	  of the Mono .Net runtime to the target
+
+config BR2_PACKAGE_MONO_45
+	bool "4.5 .Net Runtime"
+	help
+	  This option enables the installation of the 4.5 version
+	  of the Mono .Net runtime to the target
+
+endif
+
+comment "mono needs a toolchain w/ IPv6"
+	depends on !BR2_INET_IPV6
package/mono/mono-001-gc-fix-uclibc.patch new file +16 -0
new file mode 100644
index 0000000..62b52cd
@@ -0,0 +1,16 @@
+Disable backtrace on not supported uclibc.
+
+Signed-off-by: Angelo Compagnucci <[email protected]>
+
+diff -purN mono-native-3.8.0.orig/libgc/include/gc.h mono-native-3.8.0/libgc/include/gc.h
+--- mono-native-3.8.0.orig/libgc/include/gc.h	2014-10-07 15:00:21.259466731 +0200
++++ mono-native-3.8.0/libgc/include/gc.h	2014-10-07 15:05:25.560975681 +0200
+@@ -500,7 +500,7 @@ GC_API GC_PTR GC_malloc_atomic_ignore_of
+ #ifdef __linux__
+ # include <features.h>
+ # if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1 || __GLIBC__ > 2) \
+-     && !defined(__ia64__)
++     && !defined(__ia64__) && !defined(__UCLIBC__)
+ #   ifndef GC_HAVE_BUILTIN_BACKTRACE
+ #     define GC_HAVE_BUILTIN_BACKTRACE
+ #   endif
package/mono/mono-002-support-uclibc-musl.patch new file +25 -0
new file mode 100644
index 0000000..48a3493
@@ -0,0 +1,25 @@
+Adjust libc.so path depending on C library being used
+
+By default, on Linux systems, Mono assumes that the C library is
+libc.so.6. While this is true for glibc, it is not true for uClibc and
+Musl based systems. This patch adds support for such systems.
+
+Signed-off-by: Thomas Petazzoni <[email protected]>
+
+Index: b/configure.ac
+===================================================================
+--- a/configure.ac
++++ b/configure.ac
+@@ -2973,6 +2973,12 @@
+         SQLITE="libsqlite.so"
+         SQLITE3="libsqlite3.so"
+ 	;;
++    *-*-*uclibc*)
++	LIBC="libc.so.0"
++	;;
++    *-*-*musl*)
++	LIBC="libc.so"
++	;;
+     *-*-*linux*)
+ 	AC_PATH_X
+ 	dlsearch_path=`(libtool --config ; echo eval echo \\$sys_lib_dlsearch_path_spec) | sh`
package/mono/mono.mk new file +64 -0

64 lines not on this page · raw message

Signature · 1 line
2.1.1