diff options
author | Henryk Ploetz <henryk@openmoko.org> | 2007-10-02 18:51:53 +0000 |
---|---|---|
committer | Cliff Brake <cbrake@bec-systems.com> | 2007-10-02 18:51:53 +0000 |
commit | bcaec55e4e64f6bca21cf0e50eaec787bd29b735 (patch) | |
tree | e9f2ec6ba9110006d87f5e5e6db042fcd8045c68 /packages/mono/mono_1.2.5.1.bb | |
parent | 1f1297df3c3822b2c5c6682c990ce7fac5183117 (diff) |
mono 1.2.5.1: added mono.bbclass, many changes required for packaging
New file: packages/mono/mono-mcs-intermediate_1.2.5.1.bb
Compiles mono in native mode with standard prefix, then tars up the
resulting tree and puts the tarfile into staging
New file: packages/mono/mono_files.py
Automatically generated using collect-path.py (attached to this mail)
and contains a list that maps file patterns to package names (and
contained assemblies, see below).
New file: classes/mono.bbclass
Has a helper function for the list that maps file patterns to package
names and assemblies (see below). Also has a function mono_do_clilibs
and inserts that function into PACKAGEFUNCS. This function calls
mono_find_provides_and_requires which finds out (through calls to
monodis --assembly and monodis --assemblyref) which assemblies are
provided and required by a particular package. mono_do_clilibs then
puts the information about provided assemblies into
${STAGING_DIR}/clilibs/${packagename}.list and information about the
required packages into ${PKGDEST}/{packagename}.clilibdeps where it
will later be picked up by the modified read_shlibdeps.
Originally I had dependency resolution through the partial list in
mono_files.py but obviously this doens't scale, so I implemented the
new method with mono_do_clilibs. The benefit is now that I don't really
need the extra information in mono_files.py anymore and can in
principle get rid of mono_get_file_table and related code. Instead it
should be possible to modify collect-paths.py to output bitbake .inc
code (e.g. PACKAGES = "..." and a whole lot of FILES_... = "...")
instead of python code. There's still the minor problem of how to
handle the .mdb files, that's why I didn't implement it yet but instead
opted for an approach that I knew would work. (Debian just puts
the .mdb files into the individual packages, while I would argue that
they do belong into corresponding -dbg packages.)
Modified file: classes/package.bbclass
In read_shlibdeps I folded the two identical code blocks dealing with
*.shlibdeps and *.pcdeps into one and added *.clilibdeps (generated by
mono_do_clilibs above).
Modified file: packages/mono/mono_1.2.5.1.bb
Add the mono-mcs-intermediate workaround. Add a whole lot of python
code in populate_packages_prepend in order to split up the packages
based on information from mono_files.py (via mono.bbclass'
mono_get_file_table). As I said above a lot of this code can hopefully
be replaced in the future.
Diffstat (limited to 'packages/mono/mono_1.2.5.1.bb')
-rw-r--r-- | packages/mono/mono_1.2.5.1.bb | 140 |
1 files changed, 133 insertions, 7 deletions
diff --git a/packages/mono/mono_1.2.5.1.bb b/packages/mono/mono_1.2.5.1.bb index e1f3f1b6a5..53a671cd74 100644 --- a/packages/mono/mono_1.2.5.1.bb +++ b/packages/mono/mono_1.2.5.1.bb @@ -1,19 +1,145 @@ require mono_1.2.5.inc -DEPENDS = "mono-native glib-2.0" +DEPENDS = "mono-native mono-mcs-intermediate glib-2.0" -PR = "r1" +PR = "r2" SRC_URI += "file://configure.patch;patch=1" +# Per http://www.mono-project.com/Mono:ARM +EXTRA_OECONF += " --disable-mcs-build " +# Instead, get the mcs tree from a different build (see mono-mcs-intermediate) + +do_install_prepend() { + install -d ${D} + pushd ${D} + tar -xzf ${STAGING_DIR}/share/mono-mcs/mono-mcs-${PV}.tar.gz + popd +} + do_install_append() { - install -d ${D}${libdir}/mono/1.0/ - cp ${S}/mcs/class/lib/monolite/* ${D}${libdir}/mono/1.0/ + # mono-mcs-intermediate builds and installs jay (a Yacc for Java and C#), + # however, jay is not being cross-compiled and thus only + # available for the buildhost architecture, so remove it + # entirely + pushd ${D} + rm -rf ./usr/share/man/man1/jay.1 ./usr/share/jay \ + ./usr/share/jay/README.jay \ + ./usr/bin/jay + popd + + # Not packaged with the default rules and apparently + # not used for anything + rm -rf ${D}${datadir}/mono-1.0/mono/cil/cil-opcodes.xml } -EXTRA_OECONF += " --disable-mcs-build " +inherit mono +PACKAGES = "${@" ".join([e["name"] for e in mono_get_file_table(bb.data.getVar('PV', d, 1), d) if e.has_key("name")])}" -PACKAGES =+ "mono-dll" -FILES_mono-dll = "${libdir}/mono/1.0/" +FILES_mono-doc_append = " /usr/share/libgc-mono/ " +FILES_mono = "" # Apparently this gets ignored, so I'm setting it again below +ALLOW_EMPTY_mono = "1" +RDEPENDS_mono = "mono-common mono-jit" +FILES_mono-runtime = "" +ALLOW_EMPTY_mono-runtime = "1" +RDEPENDS_mono-runtime = "mono-jit mono-gac" + +RDEPENDS_mono-jit = "mono-common" + +FILES_libmono-dev = "/usr/lib/libmono.la /usr/lib/libmono-profiler-cov.la /usr/lib/libmono-profiler-aot.la \ + /usr/lib/libMonoPosixHelper.la /usr/lib/libMonoSupportW.la" +FILES_libmono-dbg = "/usr/lib/.debug/libmono*.so.* /usr/lib/.debug/libikvm-native.so \ + /usr/lib/.debug/libMonoPosixHelper.so /usr/lib/.debug/libMonoSupportW.so" + +python populate_packages_prepend () { + def fillin_packages(): + # A lot of this code can probably be replaced with less code and some + # calls to do_split_packages + import bb, sys, os, glob, commands + + PV = bb.data.getVar('PV', d, 1) + + file_table = mono_get_file_table(PV, d) + packages_to_add = [] + + D = bb.data.getVar('D', d, 1) + if not D: return + D = D + "/" + + def classify_files(files): + normal, dev, dbg, doc = [], [], [], [] + for filename in files: + if filename.endswith(".mdb"): + dbg.append(filename) + elif os.path.basename( os.path.dirname( filename ) ) == ".debug": + dbg.append(filename) + elif filename.endswith(".pc"): + dev.append(filename) + else: + normal.append(filename) + return normal, dev, dbg, doc + + def will_strip(filename): + # From package.bbclass function runstrip + pathprefix = "export PATH=%s; " % bb.data.getVar('PATH', d, 1) + ret, result = commands.getstatusoutput("%sfile '%s'" % (pathprefix, filename)) + if "not stripped" in result: + return True + else: + return False + + def append(name, value): + oldvalue = bb.data.getVar(name, d, 1) or "" + newvalue = " ".join([oldvalue, value]) + bb.data.setVar(name, newvalue, d) + + already_covered = [] + for package in file_table: + pn = package["name"] + if package.has_key("patterns"): + files = [] + for pattern in package["patterns"]: + matching = glob.glob( D + pattern ) + for filename in matching: + if os.path.isdir(filename): + for dirpath, dirnames, filenames in os.walk(filename): + for f in filenames: + debugname = os.path.join(dirpath, ".debug", f) + fullname = os.path.join(dirpath, f) + files.append(fullname) + if will_strip(fullname): + files.append(debugname) + else: + files.append(filename) + + # Remove the D prefix + files = [ e[len(D):] for e in files ] + + # Remove files that have already been placed in other packages + files = [ e for e in files if not e in already_covered ] + already_covered.extend( files ) + + if pn.endswith("-dev") or pn.endswith("-dbg") or pn.endswith("-doc"): + normal, dev, dbg, doc = files, [], [], [] + else: + normal, dev, dbg, doc = classify_files(files) + + for extension, filelist in [ ("",normal), ("-dev", dev), ("-dbg", dbg), ("-doc", doc)]: + if len(filelist) > 0: + packagename = pn + extension + append("FILES_%s" % packagename, " ".join(filelist)) + bb.debug(2, "%s\n\t%s" %( packagename, "\n\t".join( filelist ) )) + if not packagename in packages_to_add: + packages_to_add.append(packagename) + + else: + packages_to_add.append(pn) + + # mono is just a stub package + bb.data.setVar("FILES_mono", "", d) + + bb.data.setVar("PACKAGES", " ".join(packages_to_add), d) + fillin_packages() +} |