Refactor common mono build bits into mono.bbclass
cover Refactor common mono build bits into mono.bbclass
Building CLI packages involves lots of boilerplate recipe settings, particularly involving FILES and DEPENDS. This is a first attempt at refactoring these settings into a single bbclass that can be inherited by all CLI packages that do not require unusual build settings.
I attempted to refactor every recipe in the layer with these exceptions:
- cefglue, because it doesn't actually install anything (!)
- monotools-server, because I haven't been able to build it successfully
- mono-upnp and taglib-sharp because I don't use them
The following changes since commit 136ed556de19bd497279d6c3ae8704551fb1ec4d:
mono-xsp-3.x.inc: use autogen.sh (2015-07-16 18:56:23 +0100)
are available in the git repository at:
git://github.com/rtollert/meta-mono dev/rtollert/v4/bbclass
https://github.com/rtollert/meta-mono/tree/dev/rtollert/v4/bbclass
Richard Tollerton (11):
mono.bbclass: add
dbus-sharp-glib: use mono.bbclass
dbus-sharp: use mono.bbclass
fsharp.inc: use mono.bbclass
mono-addins: use mono.bbclass
mono-helloworld: use mono.bbclass
mono-xsp: use mono.bbclass
mono-basic-4.xx.inc: use mono.bbclass gtk-sharp.inc: use mono.bbclass and make some FILES fixes
gtk-sharp-native: remove mono-native dependency
gtk-sharp: remove mono-native dependency
classes/mono.bbclass | 32 ++++++++++++++++++++++ recipes-mono/dbus-sharp-glib/dbus-sharp-glib.inc | 13 ++------- recipes-mono/dbus-sharp/dbus-sharp.inc | 13 +-------- recipes-mono/fsharp/fsharp.inc | 19 +------------ recipes-mono/gtk-sharp/gtk-sharp-native_2.12.21.bb | 2 +- recipes-mono/gtk-sharp/gtk-sharp.inc | 23 +++------------- recipes-mono/gtk-sharp/gtk-sharp_2.12.21.bb | 2 +- recipes-mono/mono-addins/mono-addins.inc | 14 ++-------- recipes-mono/mono-basic/mono-basic-4.xx.inc | 13 +-------- recipes-mono/mono-helloworld/mono-helloworld.inc | 4 +-- recipes-mono/mono-xsp/mono-xsp-3.x.inc | 3 +- 11 files changed, 47 insertions(+), 91 deletions(-) create mode 100644 classes/mono.bbclass
Signature · 1 line
2.4.4
PATCH 1/11 mono.bbclass: add
The DEPENDS_*, RDEPENDS_*, and FILES_* settings between C# packages share a lot in common. We can refactor these bits into their own bbclass:
- DEPEND on mono-native because we need it to compile stuff
- DEPEND on mono to have the native sysroot available
- RDEPEND on mono to make sure we can run the package
- ${PN} contains dlls, exes, and config bits thereof
- ${PN}-dbg contains mono debug (mdb) files
- ${PN}-dev contains:
- build response (rsp) files
- machine-readable assembly documentation (xml)
- xbuild-related files
- ${PN}-doc contains monodoc output
Some C# packages build native code, though, so don't set PACKAGE_ARCH="all".
--- classes/mono.bbclass | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 classes/mono.bbclass
classes/mono.bbclass new file +32 -0
@@ -0,0 +1,32 @@ +# Class for building C# packages. If your package is all-managed, add +# PACKAGE_ARCH="all" + +DEPENDS += "mono-native mono" +RDEPENDS_${PN} += "mono" + +FILES_${PN} += "\ + ${libdir}/mono/*/*.exe \ + ${libdir}/mono/*/*.dll \ + ${libdir}/mono/*/*.config \ + ${libdir}/mono/gac/*/*/*.dll \ + ${libdir}/mono/gac/*/*/*.*.config \ +" + +FILES_${PN}-dbg += "\ + ${libdir}/mono/*/*.mdb \ + ${libdir}/mono/gac/*/*/*.mdb \ +" + +FILES_${PN}-dev += "\ + ${libdir}/mono/*/*.rsp \ + ${libdir}/mono/*/*.xml \ + ${libdir}/mono/gac/*/*/*.xml \ + ${libdir}/mono/xbuild/* \ + ${libdir}/mono/xbuild-frameworks/* \ + ${libdir}/mono/Microsoft* \ + ${libdir}/mono/*/*.Targets \ +" + +FILES_${PN}-doc += "\ + ${libdir}/monodoc/* \ +"
Signature · 1 line
2.4.4
PATCH 2/11 dbus-sharp-glib: use mono.bbclass
In reply to Richard Tollerton--- recipes-mono/dbus-sharp-glib/dbus-sharp-glib.inc | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-)
recipes-mono/dbus-sharp-glib/dbus-sharp-glib.inc +2 -11
@@ -1,11 +1,12 @@ SUMMARY = "C# implementation of D-Bus GlibC integration module" DESCRIPTION = "This is a fork of ndesk-dbus-glib, which provides GLib main loop integration for Managed D-Bus." SECTION = "devel/mono" -DEPENDS = "mono dbus-sharp" +DEPENDS = "dbus-sharp" LICENSE = "MIT" LIC_FILES_CHKSUM = "files://COPYING;md5=ea73672fbe49f67f1c1b44a7e763dab4" inherit autotools +inherit mono def dbus_sharp_glib_download_version(d): pvsplit = d.getVar('PV', True).split('.')
@@ -19,16 +20,6 @@ S = "${WORKDIR}/${PN}-${SDIRVER}" FILESPATH =. "${FILE_DIRNAME}/${PN}-${PV}:" -FILES_${PN} += " \ - ${libdir}/mono/dbus-sharp-glib-2.0/dbus-sharp-glib.dll \ - ${libdir}/mono/gac/dbus-sharp-glib/*/*.config \ - ${libdir}/mono/gac/dbus-sharp-glib/*/*dll \ -" - -FILES_${PN}-dbg += " \ - ${libdir}/mono/gac/dbus-sharp-glib/*/*.mdb \ -" - do_configure_prepend() { export DBUS_SHARP_LIBS="/r:${STAGING_LIBDIR}/mono/dbus-sharp-2.0/dbus-sharp.dll" }
Signature · 1 line
2.4.4
PATCH 3/11 dbus-sharp: use mono.bbclass
In reply to Richard Tollerton--- recipes-mono/dbus-sharp/dbus-sharp.inc | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-)
recipes-mono/dbus-sharp/dbus-sharp.inc +1 -12
@@ -1,11 +1,11 @@ SUMMARY = "C# implementation of D-Bus" DESCRIPTION = "An inter-process communication framework that lets applications interface with the system event bus as well as allowing them to talk to one another in a peer-to-peer configuration." SECTION = "devel/mono" -DEPENDS = "mono" LICENSE = "MIT" LIC_FILES_CHKSUM = "files://COPYING;md5=09d60852216ea29fdba9ea146513336c" inherit autotools +inherit mono def dbus_sharp_download_version(d): pvsplit = d.getVar('PV', True).split('.')
@@ -18,14 +18,3 @@ SRC_URI = "https://github.com/mono/dbus-sharp/archive/v${SDIRVER}.tar.gz" S = "${WORKDIR}/${PN}-${SDIRVER}" FILESPATH =. "${FILE_DIRNAME}/${PN}-${PV}:" - -FILES_${PN} += " \ - ${libdir}/mono/dbus-sharp-2.0/* \ - ${libdir}/mono/gac/dbus-sharp/*/*.dll \ - ${libdir}/mono/gac/dbus-sharp/*/*.config \ -" - -FILES_${PN}-dbg += " \ - ${libdir}/mono/gac/dbus-sharp/*/*.mdb \ -" -
Signature · 1 line
2.4.4
PATCH 4/11 fsharp.inc: use mono.bbclass
In reply to Richard Tollerton--- recipes-mono/fsharp/fsharp.inc | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-)
recipes-mono/fsharp/fsharp.inc +1 -18
@@ -1,36 +1,19 @@ SUMMARY = "F# programming language" DESCRIPTION = "F# is a strongly-typed, functional-first programming language for writing simple code to solve complex problems." SECTION = "devel/mono" -DEPENDS = "mono" LICENSE = "Apache-2.0" LIC_FILES_CHKSUM = "files://LICENSE;md5=512efb9375da0bd2fee9e2b9352c08af" inherit autotools-brokensep +inherit mono # For some reason the URL template changes from version to version, # therefore use some variables for the directory and extension SRC_URI = "https://github.com/fsharp/fsharp/archive/${PV}.tar.gz" FILES_${PN} += "\ - ${libdir}/mono/*/*.exe \ - ${libdir}/mono/*/*.dll \ - ${libdir}/mono/*/*.config \ ${libdir}/mono/*/*.optdata \ ${libdir}/mono/*/*.sigdata \ - ${libdir}/mono/gac/*/*/*.config \ ${libdir}/mono/gac/*/*/*.optdata \ ${libdir}/mono/gac/*/*/*.sigdata \ " - -FILES_${PN}-dbg += "\ - ${libdir}/mono/gac/*/*/*.mdb \ -" - -FILES_${PN}-dev = "\ - ${libdir}/mono/xbuild/* \ - ${libdir}/mono/xbuild-frameworks/* \ - ${libdir}/mono/Microsoft* \ - ${libdir}/mono/*/*.Targets \ - ${libdir}/mono/*/*.xml \ - ${libdir}/mono/gac/*/*/*.xml \ -"
Signature · 1 line
2.4.4
PATCH 5/11 mono-addins: use mono.bbclass
In reply to Richard Tollerton--- recipes-mono/mono-addins/mono-addins.inc | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-)
recipes-mono/mono-addins/mono-addins.inc +2 -12
@@ -6,7 +6,7 @@ SECTION = "mono/applications" PRIORITY = "optional" LICENSE = "MIT" LIC_FILES_CHKSUM = "file://COPYING;md5=4e024d772d8266e3ff9747185842ca82" -DEPENDS = "mono gtk-sharp" +DEPENDS = "gtk-sharp" SRCREV = "64a45d96f39d4714ec85adf0fe04b68ec7273ae1" SRCBRANCH = "master"
@@ -16,14 +16,4 @@ SRC_URI = "git://github.com/mono/mono-addins.git;branch=${SRCBRANCH}" S = "${WORKDIR}/git" inherit autotools pkgconfig - -FILES_${PN} += " \ - ${libdir}/mono/gac/* \ - ${libdir}/mono/gac/*/*/*.dll \ - ${libdir}/mono/gac/*/*/*.config \ - ${libdir}/mono/${PN}/* \ -" - -FILES_${PN}-dbg += " \ - ${libdir}/mono/gac/*/*/*.mdb \ -" +inherit mono
Signature · 1 line
2.4.4
PATCH 6/11 mono-helloworld: use mono.bbclass
In reply to Richard Tollerton--- recipes-mono/mono-helloworld/mono-helloworld.inc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
recipes-mono/mono-helloworld/mono-helloworld.inc +1 -3
@@ -6,16 +6,14 @@ SECTION = "mono/applications" PRIORITY = "optional" LICENSE = "GPLv3" LIC_FILES_CHKSUM = "file://LICENSE;md5=783b7e40cdfb4a1344d15b1f7081af66" -DEPENDS = "mono" SRC_URI = "https://github.com/DynamicDevices/mono-helloworld/archive/v${PV}.tar.gz" inherit autotools +inherit mono FILES_${PN} = "${libdir}/helloworld/helloworld.exe \ ${bindir}/helloworld \ ${libdir}/helloworld/helloworldform.exe \ ${bindir}/helloworldform \ " - -RDEPENDS_${PN} += "mono"
Signature · 1 line
2.4.4
PATCH 7/11 mono-xsp: use mono.bbclass
In reply to Richard Tollerton--- recipes-mono/mono-xsp/mono-xsp-3.x.inc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
recipes-mono/mono-xsp/mono-xsp-3.x.inc +1 -2
@@ -1,11 +1,10 @@ DESCRIPTION = "Standalone web server written in C# that can be used to run ASP.NET applications" SECTION = "devel/mono" -DEPENDS = "mono" -RDEPENDS_${PN} = "mono" LICENSE = "MIT" LIC_FILES_CHKSUM = "file://COPYING;md5=9e1603e27acd337015fdfa7f7ff936c7" inherit autotools-brokensep +inherit mono SRC_URI = "https://github.com/mono/xsp/archive/${PV}.tar.gz"
Signature · 1 line
2.4.4
PATCH 8/11 mono-basic-4.xx.inc: use mono.bbclass
In reply to Richard Tollerton*.Pdb and *.Mdb files were not found in the install so they are not added to FILES.
--- recipes-mono/mono-basic/mono-basic-4.xx.inc | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-)
recipes-mono/mono-basic/mono-basic-4.xx.inc +1 -12
@@ -6,21 +6,10 @@ LICENSE = "LGPLv2" LIC_FILES_CHKSUM = "file://LICENSE;md5=d8c5dc22eb6f25667cf8d96f603635e7" inherit autotools +inherit mono SRC_URI = "https://github.com/mono/mono-basic/archive/${PV}.tar.gz" -FILES_${PN} += " \ - ${libdir}/mono/*/* \ - ${libdir}/mono/gac/*/*/*.dll \ -" - -FILES_${PN}-dbg += " \ - ${libdir}/mono/*/*.mdb \ - ${libdir}/mono/*/*.Pdb \ - ${libdir}/mono/*/*.Mdb \ - ${libdir}/mono/*/*/*/*.mdb \ -" - do_compile_prepend() { sed -e "s|\$(prefix)|${STAGING_DIR_NATIVE}/usr|" -i build/profiles/net_4_0.make sed -e "s|\$(prefix)|${STAGING_DIR_NATIVE}/usr|" -i build/profiles/net_4_5.make
Signature · 1 line
2.4.4
PATCH 9/11 gtk-sharp.inc: use mono.bbclass and make some FILES fixes
In reply to Richard Tollerton/usr/lib/gtk-sharp-2.0 and /usr/share/gapi-2.0 are (AFAIK) only used for building, and so belong in gtk-sharp-dev.
All other relevant FILES entries have been rolled into mono.bbclass.
--- recipes-mono/gtk-sharp/gtk-sharp.inc | 23 ++++------------------- 1 file changed, 4 insertions(+), 19 deletions(-)
recipes-mono/gtk-sharp/gtk-sharp.inc +4 -19
@@ -2,11 +2,11 @@ SUMMARY = "GUI toolkit for Mono" DESCRIPTION = "GTK+ bindings for Mono" SECTION = "devel/mono" BUGTRACKER = "http://bugzilla.xamarin.com" -RDEPENDS_${PN} = "mono" LICENSE = "LGPL-2.1" RDEPENDS_${PN}-dev += "perl" inherit autotools +inherit mono # For some reason the URL template changes from version to version, # therefore use some variables for the directory and extension
@@ -21,22 +21,7 @@ def gtk_sharp_download_version(d): FILESPATH =. "${FILE_DIRNAME}/gtk-sharp-${PV}:" -FILES_${PN} = "\ - ${bindir}/* \ - ${libdir}/* \ +FILES_${PN}-dev += "\ + ${libdir}/${PN}*/* \ + ${datadir}/* \ " - -FILES_${PN}-dbg = "\ - ${libdir}/.debug \ - ${datadir}/* \ - /usr/src/* \ -" - -FILES_${PN}-doc = "\ - ${libdir}/monodoc/* \ -" - -FILES_${PN}-dev = "\ - ${libdir}/pkgconfig \ -" -
Signature · 1 line
2.4.4
PATCH 10/11 gtk-sharp-native: remove mono-native dependency
In reply to Richard Tollertonmono.bbclass already adds it so it's unnecessary here.
--- recipes-mono/gtk-sharp/gtk-sharp-native_2.12.21.bb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
recipes-mono/gtk-sharp/gtk-sharp-native_2.12.21.bb +1 -1
@@ -2,7 +2,7 @@ require gtk-sharp.inc inherit pkgconfig native -DEPENDS = "mono-native gtk+-native atk-native pango-native cairo-native glib-2.0-native libglade-native " +DEPENDS += " gtk+-native atk-native pango-native cairo-native glib-2.0-native libglade-native " LIC_FILES_CHKSUM = "files://COPYING;md5=f14599a2f089f6ff8c97e2baa4e3d575"
Signature · 1 line
2.4.4
PATCH 11/11 gtk-sharp: remove mono-native dependency
In reply to Richard Tollertonmono.bbclass already adds it so it's unnecessary here.
--- recipes-mono/gtk-sharp/gtk-sharp_2.12.21.bb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
recipes-mono/gtk-sharp/gtk-sharp_2.12.21.bb +1 -1
@@ -2,7 +2,7 @@ require gtk-sharp.inc inherit pkgconfig -DEPENDS = "mono gtk+ atk pango cairo glib-2.0 libglade " +DEPENDS += " gtk+ atk pango cairo glib-2.0 libglade" LIC_FILES_CHKSUM = "files://COPYING;md5=f14599a2f089f6ff8c97e2baa4e3d575"
Signature · 1 line
2.4.4
Quoted 34 lines · Richard Tollerton
Building CLI packages involves lots of boilerplate recipe settings, particularly involving FILES and DEPENDS. This is a first attempt at refactoring these settings into a single bbclass that can be inherited by all CLI packages that do not require unusual build settings.
I attempted to refactor every recipe in the layer with these exceptions:
- cefglue, because it doesn't actually install anything (!)
- monotools-server, because I haven't been able to build it successfully
- mono-upnp and taglib-sharp because I don't use themThe following changes since commit
136ed556de19bd497279d6c3ae8704551fb1ec4d:mono-xsp-3.x.inc: use
autogen.sh(2015-07-16 18:56:23 +0100)are available in the git repository at:
git://github.com/rtollert/meta-monodev/rtollert/v4/bbclass
https://github.com/rtollert/meta-mono/tree/dev/rtollert/v4/bbclassRichard Tollerton (11):
mono.bbclass: add
dbus-sharp-glib: use mono.bbclass
dbus-sharp: use mono.bbclass
fsharp.inc: use mono.bbclass
mono-addins: use mono.bbclass
mono-helloworld: use mono.bbclass
mono-xsp: use mono.bbclass
mono-basic-4.xx.inc: use mono.bbclass gtk-sharp.inc: use mono.bbclass and make some FILES fixes
gtk-sharp-native: remove mono-native dependency
gtk-sharp: remove mono-native dependency
Quoted 14 lines
classes/mono.bbclass | 32 ++++++++++++++++++++++ recipes-mono/dbus-sharp-glib/dbus-sharp-glib.inc | 13 ++------- recipes-mono/dbus-sharp/dbus-sharp.inc | 13 +-------- recipes-mono/fsharp/fsharp.inc | 19 +------------ recipes-mono/gtk-sharp/gtk-sharp-native_2.12.21.bb | 2 +- recipes-mono/gtk-sharp/gtk-sharp.inc | 23 +++------------- recipes-mono/gtk-sharp/gtk-sharp_2.12.21.bb | 2 +- recipes-mono/mono-addins/mono-addins.inc | 14 ++-------- recipes-mono/mono-basic/mono-basic-4.xx.inc | 13 +-------- recipes-mono/mono-helloworld/mono-helloworld.inc | 4 +-- recipes-mono/mono-xsp/mono-xsp-3.x.inc | 3 +- 11 files changed, 47 insertions(+), 91 deletions(-) create mode 100644 classes/mono.bbclass
Great idea - applied thanks Richard
Cheers, Alex
Quoted 50 lines · Alex J Lennon
Quoted 34 lines · Richard Tollerton
Building CLI packages involves lots of boilerplate recipe settings, particularly involving FILES and DEPENDS. This is a first attempt at refactoring these settings into a single bbclass that can be inherited by all CLI packages that do not require unusual build settings.
I attempted to refactor every recipe in the layer with these exceptions:
- cefglue, because it doesn't actually install anything (!)
- monotools-server, because I haven't been able to build it successfully
- mono-upnp and taglib-sharp because I don't use themThe following changes since commit
136ed556de19bd497279d6c3ae8704551fb1ec4d:mono-xsp-3.x.inc: use
autogen.sh(2015-07-16 18:56:23 +0100)are available in the git repository at:
git://github.com/rtollert/meta-monodev/rtollert/v4/bbclass
https://github.com/rtollert/meta-mono/tree/dev/rtollert/v4/bbclassRichard Tollerton (11):
mono.bbclass: add
dbus-sharp-glib: use mono.bbclass
dbus-sharp: use mono.bbclass
fsharp.inc: use mono.bbclass
mono-addins: use mono.bbclass
mono-helloworld: use mono.bbclass
mono-xsp: use mono.bbclass
mono-basic-4.xx.inc: use mono.bbclass gtk-sharp.inc: use mono.bbclass and make some FILES fixes
gtk-sharp-native: remove mono-native dependency
gtk-sharp: remove mono-native dependencyQuoted 14 lines
classes/mono.bbclass | 32 ++++++++++++++++++++++ recipes-mono/dbus-sharp-glib/dbus-sharp-glib.inc | 13 ++------- recipes-mono/dbus-sharp/dbus-sharp.inc | 13 +-------- recipes-mono/fsharp/fsharp.inc | 19 +------------ recipes-mono/gtk-sharp/gtk-sharp-native_2.12.21.bb | 2 +- recipes-mono/gtk-sharp/gtk-sharp.inc | 23 +++------------- recipes-mono/gtk-sharp/gtk-sharp_2.12.21.bb | 2 +- recipes-mono/mono-addins/mono-addins.inc | 14 ++-------- recipes-mono/mono-basic/mono-basic-4.xx.inc | 13 +-------- recipes-mono/mono-helloworld/mono-helloworld.inc | 4 +-- recipes-mono/mono-xsp/mono-xsp-3.x.inc | 3 +- 11 files changed, 47 insertions(+), 91 deletions(-) create mode 100644 classes/mono.bbclass
Quoted 2 lines
Great idea - applied thanks Richard
Richard,
I'm having some trouble with builds here since that latest patch.
Can you tell me, what version of Mono did you test against, and also did you have Mono installed out of tree on the host system? (I've had trouble in the past with the host mono being picked up incorrectly)
Thanks,
Alex
Quoted 8 lines · Alex J Lennon
Richard,
I'm having some trouble with builds here since that latest patch.
Can you tell me, what version of Mono did you test against, and also did you have Mono installed out of tree on the host system? (I've had trouble in the past with the host mono being picked up incorrectly)
Sorry for the inconvenience :(
I've been building mono 4.0.2.4 with these changes. I tested the build both on archlinux, with mono installed on the host, and inside an ubuntu 12.04 chroot, with mono not installed.
Quoted 10 lines · Richard Tollerton
Quoted 8 lines · Alex J Lennon
Richard,
I'm having some trouble with builds here since that latest patch.
Can you tell me, what version of Mono did you test against, and also did you have Mono installed out of tree on the host system? (I've had trouble in the past with the host mono being picked up incorrectly)
Quoted 7 lines
Sorry for the inconvenience :(
I've been building mono 4.0.2.4 with these changes. I tested the build both on archlinux, with mono installed on the host, and inside an ubuntu 12.04 chroot, with mono not installed.
Thanks for coming back to me so quickly. No worries. Perhaps it's finger trouble on my part somehow as I took the opportunity to clean up the 4.xx build a little today too.
I'm using 4.0.2.4 here too, and have been testing also with 4.0.2.5 support I added in. No mono on the host. Simple tests of the helloworld/helloworldform apps work fine under qemux86 but I'm seeing trouble building those updated recipes for some reason.
I'll spend a bit of time investigating.
Cheers, Alex