From 072ffcd9b18f1dcdb38045ce0ab7eb8b3ad30cfc Mon Sep 17 00:00:00 2001 From: Koen Kooi Date: Sat, 29 Sep 2007 08:04:44 +0000 Subject: gnome.bbclass: sync with poky --- classes/gnome.bbclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'classes') diff --git a/classes/gnome.bbclass b/classes/gnome.bbclass index 56233578aa..b29d86cefd 100644 --- a/classes/gnome.bbclass +++ b/classes/gnome.bbclass @@ -1,6 +1,6 @@ def gnome_verdir(v): import re - m = re.match("([0-9]+)\.([0-9]+)\..*", v) + m = re.match("^([0-9]+)\.([0-9]+)", v) return "%s.%s" % (m.group(1), m.group(2)) SECTION ?= "x11/gnome" -- cgit v1.2.3 From 0e22fa54ab226d755e436aa5bfe1b646604d2002 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Sat, 29 Sep 2007 10:27:39 +0000 Subject: insane.bbclass: Raise exceptions, not strings (from poky) --- classes/insane.bbclass | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'classes') diff --git a/classes/insane.bbclass b/classes/insane.bbclass index d54d6c7b9e..83f8c43bba 100644 --- a/classes/insane.bbclass +++ b/classes/insane.bbclass @@ -101,7 +101,7 @@ def package_qa_get_elf(path, bits32): def my_assert(expectation, result): if not expectation == result: #print "'%x','%x'" % (ord(expectation), ord(result)) - raise "This does not work as expected" + raise Exception("This does not work as expected") my_assert = staticmethod(my_assert) def __init__(self, name): @@ -124,13 +124,13 @@ def package_qa_get_elf(path, bits32): self.sex = self.data[ELFFile.EI_DATA] if self.sex == chr(ELFFile.ELFDATANONE): - raise "Can't be" + raise Exception("self.sex == ELFDATANONE") elif self.sex == chr(ELFFile.ELFDATA2LSB): self.sex = "<" elif self.sex == chr(ELFFile.ELFDATA2MSB): self.sex = ">" else: - raise "Even more worse" + raise Exception("Unknown self.sex") def osAbi(self): return ord(self.data[ELFFile.EI_OSABI]) @@ -376,7 +376,7 @@ def package_qa_check_rdepends(pkg, workdir, d): bb.data.setVar('ROOT', '', localdata) bb.data.setVar('ROOT_%s' % pkg, root, localdata) - pkgname = bb.data.getVar('PKG_%s' % pkg, localdata, 1) + pkgname = bb.data.getVar('PKG_%s' % pkg, localdata, True) if not pkgname: pkgname = pkg bb.data.setVar('PKG', pkgname, localdata) -- cgit v1.2.3 From 8bdf669985f2f3e75da54b1c10642181a56bbba4 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Sat, 29 Sep 2007 10:28:56 +0000 Subject: kernel.bbclass: Package vmlinux file (used by oprofile) (from poky) --- classes/kernel.bbclass | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'classes') diff --git a/classes/kernel.bbclass b/classes/kernel.bbclass index b25275e702..758a7c3992 100644 --- a/classes/kernel.bbclass +++ b/classes/kernel.bbclass @@ -142,6 +142,7 @@ kernel_do_install() { install -m 0644 ${KERNEL_OUTPUT} ${D}/${KERNEL_IMAGEDEST}/${KERNEL_IMAGETYPE}-${KERNEL_VERSION} install -m 0644 System.map ${D}/boot/System.map-${KERNEL_VERSION} install -m 0644 .config ${D}/boot/config-${KERNEL_VERSION} + install -m 0644 vmlinux ${D}/boot/vmlinux-${KERNEL_VERSION} install -d ${D}/etc/modutils if [ "${KERNEL_MAJOR_VERSION}" = "2.6" ]; then install -d ${D}/etc/modprobe.d @@ -174,10 +175,11 @@ EXPORT_FUNCTIONS do_compile do_install do_stage do_configure # kernel-base becomes kernel-${KERNEL_VERSION} # kernel-image becomes kernel-image-${KERNEL_VERISON} -PACKAGES = "kernel kernel-base kernel-image kernel-dev" +PACKAGES = "kernel kernel-base kernel-image kernel-dev kernel-vmlinux" FILES = "" FILES_kernel-image = "/boot/${KERNEL_IMAGETYPE}*" FILES_kernel-dev = "/boot/System.map* /boot/config*" +FILES_kernel-vmlinux = "/boot/vmlinux*" RDEPENDS_kernel = "kernel-base" # Allow machines to override this dependency if kernel image files are # not wanted in images as standard -- cgit v1.2.3 From 0926149ccd7fb1fbf2810a04a9929df3e1266ed4 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Sat, 29 Sep 2007 10:29:36 +0000 Subject: kernel.bbclass: Add menuconfig task (from poky) --- classes/kernel.bbclass | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'classes') diff --git a/classes/kernel.bbclass b/classes/kernel.bbclass index 758a7c3992..5976f42c71 100644 --- a/classes/kernel.bbclass +++ b/classes/kernel.bbclass @@ -161,6 +161,18 @@ kernel_do_configure() { yes '' | oe_runmake oldconfig } +do_menuconfig() { + export TERMWINDOWTITLE="${PN} Kernel Configuration" + export SHELLCMDS="make menuconfig" + ${TERMCMDRUN} + if [ $? -ne 0 ]; then + echo "Fatal: '${TERMCMD}' not found. Check TERMCMD variable." + exit 1 + fi +} +do_menuconfig[nostamp] = "1" +addtask menuconfig after do_patch + pkg_postinst_kernel () { cd /${KERNEL_IMAGEDEST}; update-alternatives --install /${KERNEL_IMAGEDEST}/${KERNEL_IMAGETYPE} ${KERNEL_IMAGETYPE} ${KERNEL_IMAGETYPE}-${KERNEL_VERSION} ${KERNEL_PRIORITY} || true } -- cgit v1.2.3 From 4db71c3a65096e3186abeb14a8eec3b5d6e1909c Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Sat, 29 Sep 2007 10:34:46 +0000 Subject: package.bbclass: Fix .packaged pkgmaps data creation to fix depchains. Clean up/optimise PACKAGES checks a bit --- classes/package.bbclass | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) (limited to 'classes') diff --git a/classes/package.bbclass b/classes/package.bbclass index 5233fa363c..516cae823d 100644 --- a/classes/package.bbclass +++ b/classes/package.bbclass @@ -128,11 +128,12 @@ python () { deps += " %s:do_populate_staging" % dep bb.data.setVarFlag('do_package', 'depends', deps, d) + deps = (bb.data.getVarFlag('do_package', 'deptask', d) or "").split() # shlibs requires any DEPENDS to have already packaged for the *.list files - bb.data.setVarFlag('do_package', 'deptask', 'do_package', d) + deps.append("do_package") + bb.data.setVarFlag('do_package', 'deptask', " ".join(deps), d) } - def runstrip(file, d): # Function to strip a single file, called from populate_packages below # A working 'file' (one which works on the target architecture) @@ -481,6 +482,8 @@ python populate_packages () { populate_packages[dirs] = "${D}" python emit_pkgdata() { + from glob import glob + def write_if_exists(f, pkg, var): def encode(str): import codecs @@ -492,14 +495,14 @@ python emit_pkgdata() { f.write('%s_%s: %s\n' % (var, pkg, encode(val))) packages = bb.data.getVar('PACKAGES', d, 1) - if not packages: - return data_file = bb.data.expand("${PKGDATA_DIR}/${PN}", d) f = open(data_file, 'w') f.write("PACKAGES: %s\n" % packages) f.close() + workdir = bb.data.getVar('WORKDIR', d, 1) + for pkg in packages.split(): subdata_file = bb.data.expand("${PKGDATA_DIR}/runtime/%s" % pkg, d) sf = open(subdata_file, 'w') @@ -519,6 +522,13 @@ python emit_pkgdata() { write_if_exists(sf, pkg, 'pkg_preinst') write_if_exists(sf, pkg, 'pkg_prerm') sf.close() + + allow_empty = bb.data.getVar('ALLOW_EMPTY_%s' % pkg, d, 1) + root = "%s/install/%s" % (workdir, pkg) + os.chdir(root) + g = glob('*') + if g or allow_empty == "1": + file(bb.data.expand('${PKGDATA_DIR}/runtime/%s.packaged' % pkg, d), 'w').close() } emit_pkgdata[dirs] = "${PKGDATA_DIR}/runtime" @@ -540,9 +550,6 @@ python package_do_shlibs() { libdir_re = re.compile(".*/lib$") packages = bb.data.getVar('PACKAGES', d, 1) - if not packages: - bb.debug(1, "no packages to build; not calculating shlibs") - return workdir = bb.data.getVar('WORKDIR', d, 1) if not workdir: @@ -678,9 +685,6 @@ python package_do_pkgconfig () { import re, os packages = bb.data.getVar('PACKAGES', d, 1) - if not packages: - bb.debug(1, "no packages to build; not calculating pkgconfig dependencies") - return workdir = bb.data.getVar('WORKDIR', d, 1) if not workdir: @@ -786,7 +790,7 @@ python package_do_pkgconfig () { } python read_shlibdeps () { - packages = (bb.data.getVar('PACKAGES', d, 1) or "").split() + packages = bb.data.getVar('PACKAGES', d, 1).split() for pkg in packages: rdepends = explode_deps(bb.data.getVar('RDEPENDS_' + pkg, d, 0) or bb.data.getVar('RDEPENDS', d, 0) or "") shlibsfile = bb.data.expand("${PKGDEST}/" + pkg + ".shlibdeps", d) @@ -896,6 +900,11 @@ PACKAGEFUNCS ?= "package_do_split_locales \ emit_pkgdata" python package_do_package () { + packages = (bb.data.getVar('PACKAGES', d, 1) or "").split() + if len(packages) < 1: + bb.debug(1, "No packages to build, skipping do_package") + return + for f in (bb.data.getVar('PACKAGEFUNCS', d, 1) or '').split(): bb.build.exec_func(f, d) } -- cgit v1.2.3 From a76818e2745b8cc4aeb9e26f8257c69ece37baa7 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Sat, 29 Sep 2007 10:39:22 +0000 Subject: package_deb.bbclass: Map TARGET_ARCH to DPKG_ARCH to keep dpkg/apt happy with 'valid' archs (from poky) --- classes/package_deb.bbclass | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'classes') diff --git a/classes/package_deb.bbclass b/classes/package_deb.bbclass index 2ab537f174..57c79f997e 100644 --- a/classes/package_deb.bbclass +++ b/classes/package_deb.bbclass @@ -8,6 +8,14 @@ BOOTSTRAP_EXTRA_RDEPENDS += "dpkg" DISTRO_EXTRA_RDEPENDS += "dpkg" IMAGE_PKGTYPE ?= "deb" +# Map TARGET_ARCH to Debian's ideas about architectures +DPKG_ARCH ?= "${TARGET_ARCH}" +DPKG_ARCH_x86 ?= "i386" +DPKG_ARCH_i486 ?= "i386" +DPKG_ARCH_i586 ?= "i386" +DPKG_ARCH_i686 ?= "i386" +DPKG_ARCH_pentium ?= "i386" + python package_deb_fn () { from bb import data bb.data.setVar('PKGFN', bb.data.getVar('PKG',d), d) @@ -141,6 +149,7 @@ python do_package_deb () { note("Not creating empty archive for %s-%s-%s" % (pkg, bb.data.getVar('PV', localdata, 1), bb.data.getVar('PR', localdata, 1))) unlockfile(lf) continue + controldir = os.path.join(root, 'DEBIAN') bb.mkdirhier(controldir) os.chmod(controldir, 0755) @@ -161,7 +170,7 @@ python do_package_deb () { fields.append(["Section: %s\n", ['SECTION']]) fields.append(["Priority: %s\n", ['PRIORITY']]) fields.append(["Maintainer: %s\n", ['MAINTAINER']]) - fields.append(["Architecture: %s\n", ['TARGET_ARCH']]) + fields.append(["Architecture: %s\n", ['DPKG_ARCH']]) fields.append(["OE: %s\n", ['PN']]) fields.append(["Homepage: %s\n", ['HOMEPAGE']]) @@ -175,7 +184,7 @@ python do_package_deb () { data = bb.data.getVar(i, d, 1) if data is None: raise KeyError(f) - if i == 'TARGET_ARCH' and bb.data.getVar('PACKAGE_ARCH', d, 1) == 'all': + if i == 'DPKG_ARCH' and bb.data.getVar('PACKAGE_ARCH', d, 1) == 'all': data = 'all' l2.append(data) return l2 -- cgit v1.2.3 From 34b62784e42e1e2c6e1c74cc23bc68cbf63c5c39 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Sat, 29 Sep 2007 10:41:11 +0000 Subject: package_(deb|ipk).bbclass: Rename package index stamp to make it more obvious what its for (from poky) --- classes/package_deb.bbclass | 8 ++++---- classes/package_ipk.bbclass | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) (limited to 'classes') diff --git a/classes/package_deb.bbclass b/classes/package_deb.bbclass index 57c79f997e..b85ffe254f 100644 --- a/classes/package_deb.bbclass +++ b/classes/package_deb.bbclass @@ -46,7 +46,7 @@ python do_package_deb_install () { if (exitstatus != 0 ): raise bb.build.FuncFailed(output) - f = open(os.path.join(tmpdir, "stamps", "do_packages"), "w") + f = open(os.path.join(tmpdir, "stamps", "DEB_PACKAGE_INDEX_CLEAN"), "w") f.close() # NOTE: this env stuff is racy at best, we need something more capable @@ -94,9 +94,9 @@ python do_package_deb () { return tmpdir = bb.data.getVar('TMPDIR', d, 1) - # Invalidate the packages file - if os.access(os.path.join(tmpdir, "stamps", "do_packages"),os.R_OK): - os.unlink(os.path.join(tmpdir, "stamps", "do_packages")) + + if os.access(os.path.join(tmpdir, "stamps", "DEB_PACKAGE_INDEX_CLEAN"),os.R_OK): + os.unlink(os.path.join(tmpdir, "stamps", "DEB_PACKAGE_INDEX_CLEAN")) if packages == []: bb.debug(1, "No packages; nothing to do") diff --git a/classes/package_ipk.bbclass b/classes/package_ipk.bbclass index 0b7f274a96..a12899e2a1 100644 --- a/classes/package_ipk.bbclass +++ b/classes/package_ipk.bbclass @@ -49,11 +49,11 @@ python package_ipk_install () { if (not os.access(os.path.join(ipkdir,"Packages"), os.R_OK) or - not os.access(os.path.join(tmpdir, "stamps", "do_packages"),os.R_OK): + not os.access(os.path.join(tmpdir, "stamps", "IPK_PACKAGE_INDEX_CLEAN"),os.R_OK): ret = os.system('ipkg-make-index -p %s %s ' % (os.path.join(ipkdir, "Packages"), ipkdir)) if (ret != 0 ): raise bb.build.FuncFailed - f=open(os.path.join(tmpdir, "stamps", "do_packages"),"w") + f = open(os.path.join(tmpdir, "stamps", "IPK_PACKAGE_INDEX_CLEAN"),"w") f.close() ret = os.system('ipkg-cl -o %s -f %s update' % (rootfs, conffile)) @@ -143,9 +143,9 @@ python do_package_ipk () { return tmpdir = bb.data.getVar('TMPDIR', d, 1) - # Invalidate the packages file - if os.access(os.path.join(tmpdir, "stamps", "do_packages"),os.R_OK): - os.unlink(os.path.join(tmpdir, "stamps", "do_packages")) + + if os.access(os.path.join(tmpdir, "stamps", "IPK_PACKAGE_INDEX_CLEAN"), os.R_OK): + os.unlink(os.path.join(tmpdir, "stamps", "IPK_PACKAGE_INDEX_CLEAN")) if packages == []: bb.debug(1, "No packages; nothing to do") -- cgit v1.2.3 From bcaec55e4e64f6bca21cf0e50eaec787bd29b735 Mon Sep 17 00:00:00 2001 From: Henryk Ploetz Date: Tue, 2 Oct 2007 18:51:53 +0000 Subject: 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. --- classes/mono.bbclass | 214 ++++++++++++++++++++++++++++++++++++++++++++++++ classes/package.bbclass | 22 ++--- 2 files changed, 222 insertions(+), 14 deletions(-) create mode 100644 classes/mono.bbclass (limited to 'classes') diff --git a/classes/mono.bbclass b/classes/mono.bbclass new file mode 100644 index 0000000000..dcf5f7272c --- /dev/null +++ b/classes/mono.bbclass @@ -0,0 +1,214 @@ +def mono_get_file_table(packageversion, d): + # The packageversion is currently ignored, but might be used in the future + # if more than one mono version is available and different versions + # need to use different tables + + import bb, sys, os, glob, commands + curdir = os.path.dirname( bb.data.getVar('FILE', d, 1) ) + if curdir not in sys.path: sys.path.append( curdir ) + from mono_files import debian_mono_file_table + + # mono-jay is not being built (for all platforms at least) + IGNORE = ("mono-jay", ) + file_table = [ + # Standard package + {"name": "mono-doc"}, + + # Virtual packages + {"name": "mono"}, + {"name": "mono-runtime"}, + + # Not provided by Debian: + {"name": "libnunit2.2-cil", + "patterns": [ + "/usr/lib/mono/gac/nunit.*/2.2.*", + "/usr/lib/mono/1.0/nunit.*.dll", + "/usr/lib/pkgconfig/mono-nunit.pc", + ], + "assemblies": [ + ("nunit.core", "2.2.0.0"), + ("nunit.framework", "2.2.0.0"), + ("nunit.util", "2.2.0.0"), + ("nunit.mocks", "2.2.8.0"), + ], + }, + {"name": "libmono-cecil0.5-cil", + "patterns": [ + "/usr/lib/mono/gac/Mono.Cecil/0.5.*", + ], + "assemblies": [ + ("Mono.Cecil", "0.5.*"), + ], + }, + {"name": "libmono-db2-1.0-cil", + "patterns": [ + "/usr/lib/mono/gac/IBM.Data.DB2/1.0*", + "/usr/lib/mono/1.0/IBM.Data.DB2.dll", + ], + "assemblies": [ + ("IBM.Data.DB2", "1.0*"), + ], + }, + ] + debian_mono_file_table + + file_table = [e for e in file_table + if not (e.has_key("name") and e["name"] in IGNORE)] + + return file_table + +def mono_find_provides_and_requires(files, d): + provides = [] + requires = [] + + import bb, os, commands + + pathprefix = "export PATH=%s; export LANG=; export LC_ALL=; " % bb.data.getVar('PATH', d, 1) + for filename in files: + if not filename.endswith(".dll") and not filename.endswith(".exe"): + continue + if not os.path.isfile(filename) or os.path.islink(filename): + continue + + ## Provides + name, version = None, None + + ret, result = commands.getstatusoutput("%smonodis --assembly '%s'" % (pathprefix, filename)) + if ret: + bb.error("raw_provides_and_requires: monodis --assembly '%s' failed, dependency information will be inaccurate" % filename) + continue + for line in result.splitlines(): + if not ":" in line: continue + key, value = line.split(":", 1) + if key.strip() == "Name": + name = value.strip() + elif key.strip() == "Version": + version = value.strip() + if name is not None and version is not None: + if (name, version) not in provides: + provides.append( (name, version) ) + + ## Requires + name, version = None, None + ret, result = commands.getstatusoutput("%smonodis --assemblyref '%s'" % (pathprefix, filename)) + if ret: + bb.error("raw_provides_and_requires: monodis --assemblyref '%s' failed, dependency information will be inaccurate" % filename) + continue + for line in result.splitlines(): + if not "=" in line: continue + key, value = line.split("=", 1) + if ":" in key and key.split(":",1)[1].strip() == "Version": + version = value.strip() + elif key.strip() == "Name": + name = value.strip() + if name is not None and version is not None: + if (name, version) not in requires: + requires.append( (name, version) ) + name, version = None, None + + # Remove everything from requires that's already in provides as it's not actually required + # to be provided externally + requires = [e for e in requires if not e in provides] + return provides, requires + +python mono_do_clilibs() { + import bb, os, re, os.path + + exclude_clilibs = bb.data.getVar('EXCLUDE_FROM_CLILIBS', d, 0) + if exclude_clilibs: + bb.note("not generating clilibs") + return + + lib_re = re.compile("^lib.*\.so") + libdir_re = re.compile(".*/lib$") + + packages = bb.data.getVar('PACKAGES', d, 1) + + workdir = bb.data.getVar('WORKDIR', d, 1) + if not workdir: + bb.error("WORKDIR not defined") + return + + staging = bb.data.getVar('STAGING_DIR', d, 1) + if not staging: + bb.error("STAGING_DIR not defined") + return + + pkgdest = bb.data.getVar('PKGDEST', d, 1) + + clilibs_dir = os.path.join(staging, "clilibs") + bb.mkdirhier(clilibs_dir) + + provides, requires = {}, {} + private_libs = bb.data.getVar('PRIVATE_CLILIBS', d, 1) + for pkg in packages.split(): + bb.debug(2, "calculating clilib provides for %s" % pkg) + + files_to_check = [] + top = os.path.join(pkgdest, pkg) + for root, dirs, files in os.walk(top): + for file in files: + path = os.path.join(root, file) + if file.endswith(".exe") or file.endswith(".dll"): + files_to_check.append( path ) + provides[pkg], requires[pkg] = mono_find_provides_and_requires(files_to_check, d) + clilibs_file = os.path.join(clilibs_dir, pkg + ".list") + if os.path.exists(clilibs_file): + os.remove(clilibs_file) + if len(provides[pkg]) > 0: + fd = open(clilibs_file, 'w') + for s in provides[pkg]: + fd.write(" ".join(s) + '\n') + fd.close() + + clilib_provider = {} + list_re = re.compile('^(.*)\.list$') + for file in os.listdir(clilibs_dir): + m = list_re.match(file) + if m: + dep_pkg = m.group(1) + fd = open(os.path.join(clilibs_dir, file)) + lines = fd.readlines() + fd.close() + for l in lines: + clilib_provider[tuple(l.rstrip().split())] = dep_pkg + + for pkg in packages.split(): + bb.debug(2, "calculating clilib requirements for %s" % pkg) + + deps = [] + for n in requires[pkg]: + if n in clilib_provider.keys(): + dep_pkg = clilib_provider[n] + + if dep_pkg == pkg: + continue + + if not dep_pkg in deps: + deps.append(dep_pkg) + else: + bb.note("Couldn't find CLI library provider for %s" % n) + + deps_file = os.path.join(pkgdest, pkg + ".clilibdeps") + if os.path.exists(deps_file): + os.remove(deps_file) + if len(deps) > 0: + fd = open(deps_file, 'w') + for dep in deps: + fd.write(dep + '\n') + fd.close() +} + +python() { + # Insert mono_do_clilibs into PACKAGEFUNCS + # Needs to be called after populate_packages, but before read_shlibdeps + PACKAGEFUNCS = bb.data.getVar("PACKAGEFUNCS", d, 1) + if PACKAGEFUNCS: + PACKAGEFUNCS = PACKAGEFUNCS.split() + if "read_shlibdeps" in PACKAGEFUNCS: + i = PACKAGEFUNCS.index("read_shlibdeps") + PACKAGEFUNCS.insert(i, "mono_do_clilibs") + elif "populate_packages" in PACKAGEFUNCS: + i = PACKAGEFUNCS.index("populate_packages") + PACKAGEFUNCS.insert(i+1, "mono_do_clilibs") + bb.data.setVar("PACKAGEFUNCS", " ".join(PACKAGEFUNCS), d) +} diff --git a/classes/package.bbclass b/classes/package.bbclass index 516cae823d..b114049b8e 100644 --- a/classes/package.bbclass +++ b/classes/package.bbclass @@ -793,20 +793,14 @@ python read_shlibdeps () { packages = bb.data.getVar('PACKAGES', d, 1).split() for pkg in packages: rdepends = explode_deps(bb.data.getVar('RDEPENDS_' + pkg, d, 0) or bb.data.getVar('RDEPENDS', d, 0) or "") - shlibsfile = bb.data.expand("${PKGDEST}/" + pkg + ".shlibdeps", d) - if os.access(shlibsfile, os.R_OK): - fd = file(shlibsfile) - lines = fd.readlines() - fd.close() - for l in lines: - rdepends.append(l.rstrip()) - pcfile = bb.data.expand("${PKGDEST}/" + pkg + ".pcdeps", d) - if os.access(pcfile, os.R_OK): - fd = file(pcfile) - lines = fd.readlines() - fd.close() - for l in lines: - rdepends.append(l.rstrip()) + for extension in ".shlibdeps", ".pcdeps", ".clilibdeps": + depsfile = bb.data.expand("${PKGDEST}/" + pkg + extension, d) + if os.access(depsfile, os.R_OK): + fd = file(depsfile) + lines = fd.readlines() + fd.close() + for l in lines: + rdepends.append(l.rstrip()) bb.data.setVar('RDEPENDS_' + pkg, " " + " ".join(rdepends), d) } -- cgit v1.2.3 From c682389deb5384a1a18c9755376b0d255a9c3482 Mon Sep 17 00:00:00 2001 From: Henryk Ploetz Date: Wed, 3 Oct 2007 01:04:46 +0000 Subject: mono.bbclass: fix whitespace problem - fix for the problem experienced by scruggs on IRC today. There was an inconsistency in the amount and type of whitespace used in the python anonymous blocks between mono.bbclass and multimachine.bbclass. - fixed a small problem in the error output of mono_do_clilibs --- classes/mono.bbclass | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'classes') diff --git a/classes/mono.bbclass b/classes/mono.bbclass index dcf5f7272c..c50274ed0c 100644 --- a/classes/mono.bbclass +++ b/classes/mono.bbclass @@ -186,7 +186,7 @@ python mono_do_clilibs() { if not dep_pkg in deps: deps.append(dep_pkg) else: - bb.note("Couldn't find CLI library provider for %s" % n) + bb.note("Couldn't find CLI library provider for %s" % (n,)) deps_file = os.path.join(pkgdest, pkg + ".clilibdeps") if os.path.exists(deps_file): @@ -198,7 +198,8 @@ python mono_do_clilibs() { fd.close() } -python() { +def mono_after_parse(d): + import bb # Insert mono_do_clilibs into PACKAGEFUNCS # Needs to be called after populate_packages, but before read_shlibdeps PACKAGEFUNCS = bb.data.getVar("PACKAGEFUNCS", d, 1) @@ -211,4 +212,7 @@ python() { i = PACKAGEFUNCS.index("populate_packages") PACKAGEFUNCS.insert(i+1, "mono_do_clilibs") bb.data.setVar("PACKAGEFUNCS", " ".join(PACKAGEFUNCS), d) + +python () { + mono_after_parse(d) } -- cgit v1.2.3