[yocto] [meta-mono][PATCH] mono: Support to build mono without X support.

Enric Balletbo i Serra eballetbo at gmail.com
Wed Mar 18 07:23:02 PDT 2015


Use PACKAGECONFIG to build a version of mono with or without X support in
function of x11 DISTRO_FEATURES.

Tested on qemux86 (mono using X) and imx6 board (mono without X)

Signed-off-by: Enric Balletbo i Serra <enric.balletbo at collabora.com>
---
 recipes-mono/mono/mono-native_3.12.1.bb |  8 ++++++--
 recipes-mono/mono/mono_3.12.1.bb        | 12 +++++++++---
 2 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/recipes-mono/mono/mono-native_3.12.1.bb b/recipes-mono/mono/mono-native_3.12.1.bb
index b575224..3afae4b 100644
--- a/recipes-mono/mono/mono-native_3.12.1.bb
+++ b/recipes-mono/mono/mono-native_3.12.1.bb
@@ -5,10 +5,14 @@ inherit native
 SRC_URI[md5sum] = "ccab015f0c54ffeccd2924b44885809c"
 SRC_URI[sha256sum] = "5d8cf153af2948c06bc9fbf5088f6834868e4db8e5f41c7cff76da173732b60d"
 
-DEPENDS =+ "libgdiplus-native"
-
 EXTRA_OECONF += "mono_cv_uscore=no --with-sigaltstack=no --with-mcs-docs=no "
 
+EDEPENDS_X11 =+ "libgdiplus-native"
+PACKAGECONFIG[x11] = ",,${EDEPENDS_X11}"
+
+# Default configuration, distros might want to override
+PACKAGECONFIG ??= "${@base_contains('DISTRO_FEATURES', 'x11', 'x11', '', d)}"
+
 SRC_URI += "file://fix-basic-mscorlib-dep.patch"
 
 do_compile() {
diff --git a/recipes-mono/mono/mono_3.12.1.bb b/recipes-mono/mono/mono_3.12.1.bb
index c22c1d5..e8a8da0 100644
--- a/recipes-mono/mono/mono_3.12.1.bb
+++ b/recipes-mono/mono/mono_3.12.1.bb
@@ -2,13 +2,21 @@ require mono-3.12.inc
 
 inherit pkgconfig
 
-DEPENDS =+ "mono-native libgdiplus"
+DEPENDS =+ "mono-native"
 
 SRC_URI[md5sum] = "ccab015f0c54ffeccd2924b44885809c"
 SRC_URI[sha256sum] = "5d8cf153af2948c06bc9fbf5088f6834868e4db8e5f41c7cff76da173732b60d"
 
 EXTRA_OECONF += "--disable-mcs-build mono_cv_clang=no mono_cv_uscore=no --with-sigaltstack=no --with-mcs-docs=no"
 
+EDEPENDS_X11 = "libgdiplus"
+ERDEPENDS_X11 = "libgdiplus"
+
+PACKAGECONFIG[x11] = ",,${EDEPENDS_X11},${ERDEPENDS_X11}"
+
+# Default configuration, distros might want to override
+PACKAGECONFIG ??= "${@base_contains('DISTRO_FEATURES', 'x11', 'x11', '', d)}"
+
 do_install_append() {
 	cp -af ${STAGING_DIR_NATIVE}${sysconfdir}/${PN} ${D}${sysconfdir}
 	cp -af ${STAGING_DIR_NATIVE}${libdir}/${PN}  ${D}${libdir}/${PN}
@@ -23,5 +31,3 @@ FILES_${PN}-doc += " ${datadir}/libgc-mono/*"
 FILES_${PN}-dbg += " ${datadir}/mono-2.0/mono/cil/cil-opcodes.xml"
 
 PACKAGES = "${PN} ${PN}-dbg ${PN}-doc ${PN}-dev ${PN}-staticdev ${PN}-locale"
-
-RDEPENDS_${PN} += "libgdiplus"
-- 
2.1.0




More information about the yocto mailing list