From a780643c4b6aa11e1a36965a69df7116477c7b4c Mon Sep 17 00:00:00 2001 From: Chris Larson Date: Tue, 7 Dec 2004 22:05:47 +0000 Subject: Merge oe-devel@oe-devel.bkbits.net:packages.bb into handhelds.org:/home/kergoth/code/packages.bb 2004/12/07 04:58:25-06:00 ti.com!kergoth More updates per the core rename. 2004/12/07 04:46:51-06:00 ti.com!kergoth Update soundtracker per the core rename. 2004/12/07 04:44:14-06:00 ti.com!kergoth Merge 2004/12/07 04:42:38-06:00 ti.com!kergoth Updates per the recent rename of the oe core from 'oe' to 'bitbake'. BKrev: 41b6293b91LRHSxMOt6WnrZVAdLbFw --- classes/package.bbclass | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 classes/package.bbclass (limited to 'classes/package.bbclass') diff --git a/classes/package.bbclass b/classes/package.bbclass new file mode 100644 index 0000000000..e69de29bb2 -- cgit v1.2.3 From 654d27e64e0e60a8399aeebd586ec2d01a6b66b9 Mon Sep 17 00:00:00 2001 From: Phil Blundell Date: Sun, 12 Dec 2004 19:33:09 +0000 Subject: do_split_packages(): preserve old RDEPENDS on target, if any BKrev: 41bc9cf55UvG8yCqbfJC_8g34ea4Ag --- classes/package.bbclass | 575 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 575 insertions(+) (limited to 'classes/package.bbclass') diff --git a/classes/package.bbclass b/classes/package.bbclass index e69de29bb2..ca2d90c697 100644 --- a/classes/package.bbclass +++ b/classes/package.bbclass @@ -0,0 +1,575 @@ +def legitimize_package_name(s): + return s.lower().replace('_', '-').replace('@', '+').replace(',', '+').replace('/', '-') + +def do_split_packages(d, root, file_regex, output_pattern, description, postinst=None, recursive=False, hook=None, extra_depends=None, aux_files_pattern=None, postrm=None, allow_dirs=False, prepend=False, match_path=False): + import os, os.path, bb + + dvar = bb.data.getVar('D', d, 1) + if not dvar: + bb.error("D not defined") + return + + packages = bb.data.getVar('PACKAGES', d, 1).split() + if not packages: + # nothing to do + return + + if postinst: + postinst = '#!/bin/sh\n' + postinst + if postrm: + postrm = '#!/bin/sh\n' + postrm + if not recursive: + objs = os.listdir(dvar + root) + else: + objs = [] + for walkroot, dirs, files in os.walk(dvar + root): + for file in files: + relpath = os.path.join(walkroot, file).replace(dvar + root + '/', '', 1) + if relpath: + objs.append(relpath) + + if extra_depends == None: + extra_depends = bb.data.getVar('PKG_' + packages[0], d, 1) or packages[0] + + for o in objs: + import re, stat + if match_path: + m = re.match(file_regex, o) + else: + m = re.match(file_regex, os.path.basename(o)) + + if not m: + continue + f = os.path.join(dvar + root, o) + mode = os.lstat(f).st_mode + if not (stat.S_ISREG(mode) or (allow_dirs and stat.S_ISDIR(mode))): + continue + on = legitimize_package_name(m.group(1)) + pkg = output_pattern % on + if not pkg in packages: + if prepend: + packages = [pkg] + packages + else: + packages.append(pkg) + the_files = [os.path.join(root, o)] + if aux_files_pattern: + if type(aux_files_pattern) is list: + for fp in aux_files_pattern: + the_files.append(fp % on) + else: + the_files.append(aux_files_pattern % on) + bb.data.setVar('FILES_' + pkg, " ".join(the_files), d) + if extra_depends != '': + the_depends = bb.data.getVar('RDEPENDS_' + pkg, d, 1) + if the_depends: + the_depends = '%s %s' % (the_depends, extra_depends) + else: + the_depends = extra_depends + bb.data.setVar('RDEPENDS_' + pkg, the_depends, d) + bb.data.setVar('DESCRIPTION_' + pkg, description % on, d) + if postinst: + bb.data.setVar('pkg_postinst_' + pkg, postinst, d) + if postrm: + bb.data.setVar('pkg_postrm_' + pkg, postrm, d) + else: + oldfiles = bb.data.getVar('FILES_' + pkg, d, 1) + if not oldfiles: + bb.fatal("Package '%s' exists but has no files" % pkg) + bb.data.setVar('FILES_' + pkg, oldfiles + " " + os.path.join(root, o), d) + if callable(hook): + hook(f, pkg, file_regex, output_pattern, m.group(1)) + + bb.data.setVar('PACKAGES', ' '.join(packages), d) + +python populate_packages () { + import glob, stat, errno, re, copy + + workdir = bb.data.getVar('WORKDIR', d, 1) + if not workdir: + bb.error("WORKDIR not defined, unable to package") + return + + import os # path manipulations + outdir = bb.data.getVar('DEPLOY_DIR', d, 1) + if not outdir: + bb.error("DEPLOY_DIR not defined, unable to package") + return + bb.mkdirhier(outdir) + + dvar = bb.data.getVar('D', d, 1) + if not dvar: + bb.error("D not defined, unable to package") + return + bb.mkdirhier(dvar) + + packages = bb.data.getVar('PACKAGES', d, 1) + if not packages: + bb.debug(1, "PACKAGES not defined, nothing to package") + return + + pn = bb.data.getVar('PN', d, 1) + if not pn: + bb.error("PN not defined") + return + + os.chdir(dvar) + + def isexec(path): + try: + s = os.stat(path) + except (os.error, AttributeError): + return 0 + return (s[stat.ST_MODE] & stat.S_IEXEC) + + for pkg in packages.split(): + localdata = copy.deepcopy(d) + root = os.path.join(workdir, "install", pkg) + + os.system('rm -rf %s' % root) + + bb.data.setVar('ROOT', '', localdata) + bb.data.setVar('ROOT_%s' % pkg, root, localdata) + pkgname = bb.data.getVar('PKG_%s' % pkg, localdata, 1) + if not pkgname: + pkgname = pkg + bb.data.setVar('PKG', pkgname, localdata) + + overrides = bb.data.getVar('OVERRIDES', localdata, 1) + if not overrides: + raise bb.build.FuncFailed('OVERRIDES not defined') + bb.data.setVar('OVERRIDES', overrides+':'+pkg, localdata) + + bb.data.update_data(localdata) + + root = bb.data.getVar('ROOT', localdata, 1) + bb.mkdirhier(root) + filesvar = bb.data.getVar('FILES', localdata, 1) or "" + files = filesvar.split() + stripfunc = "" + for file in files: + if os.path.isabs(file): + file = '.' + file + if not os.path.islink(file): + if os.path.isdir(file): + newfiles = [ os.path.join(file,x) for x in os.listdir(file) ] + if newfiles: + files += newfiles + continue + globbed = glob.glob(file) + if globbed: + if [ file ] != globbed: + files += globbed + continue + if (not os.path.islink(file)) and (not os.path.exists(file)): + continue + fpath = os.path.join(root,file) + dpath = os.path.dirname(fpath) + bb.mkdirhier(dpath) + if (bb.data.getVar('INHIBIT_PACKAGE_STRIP', d, 1) != '1') and not os.path.islink(file) and isexec(file): + stripfunc += "${STRIP} %s || : ;\n" % fpath + ret = bb.movefile(file,fpath) + if ret is None or ret == 0: + raise bb.build.FuncFailed("File population failed") + if not stripfunc == "": + from bb import build + # strip + bb.data.setVar('RUNSTRIP', '%s\nreturn 0' % stripfunc, localdata) + bb.data.setVarFlag('RUNSTRIP', 'func', 1, localdata) + bb.build.exec_func('RUNSTRIP', localdata) + del localdata + os.chdir(workdir) + + unshipped = [] + for root, dirs, files in os.walk(dvar): + for f in files: + path = os.path.join(root[len(dvar):], f) + unshipped.append(path) + + if unshipped != []: + bb.note("the following files were installed but not shipped in any package:") + for f in unshipped: + bb.note(" " + f) + + bb.build.exec_func("package_name_hook", d) + + for pkg in packages.split(): + if bb.data.getVar('PKG_%s' % pkg, d, 1) is None: + bb.data.setVar('PKG_%s' % pkg, pkg, d) + + dangling_links = {} + pkg_files = {} + for pkg in packages.split(): + dangling_links[pkg] = [] + pkg_files[pkg] = [] + inst_root = os.path.join(workdir, "install", pkg) + for root, dirs, files in os.walk(inst_root): + for f in files: + path = os.path.join(root, f) + rpath = path[len(inst_root):] + pkg_files[pkg].append(rpath) + try: + s = os.stat(path) + except OSError, (err, strerror): + if err != errno.ENOENT: + raise + target = os.readlink(path) + if target[0] != '/': + target = os.path.join(root[len(inst_root):], target) + dangling_links[pkg].append(os.path.normpath(target)) + + for pkg in packages.split(): + rdepends = explode_deps(bb.data.getVar('RDEPENDS_' + pkg, d, 1) or bb.data.getVar('RDEPENDS', d, 1) or "") + for l in dangling_links[pkg]: + found = False + bb.debug(1, "%s contains dangling link %s" % (pkg, l)) + for p in packages.split(): + for f in pkg_files[p]: + if f == l: + found = True + bb.debug(1, "target found in %s" % p) + dp = bb.data.getVar('PKG_' + p, d, 1) or p + if not dp in rdepends: + rdepends.append(dp) + break + if found == False: + bb.note("%s contains dangling symlink to %s" % (pkg, l)) + bb.data.setVar('RDEPENDS_' + pkg, " " + " ".join(rdepends), d) + + def write_if_exists(f, pkg, var): + def encode(str): + import codecs + c = codecs.getencoder("string_escape") + return c(str)[0] + + val = bb.data.getVar('%s_%s' % (var, pkg), d, 1) + if val: + f.write('%s_%s: %s\n' % (var, pkg, encode(val))) + + data_file = os.path.join(workdir, "install", pn + ".package") + f = open(data_file, 'w') + f.write("PACKAGES: %s\n" % packages) + for pkg in packages.split(): + write_if_exists(f, pkg, 'DESCRIPTION') + write_if_exists(f, pkg, 'RDEPENDS') + write_if_exists(f, pkg, 'RPROVIDES') + write_if_exists(f, pkg, 'PKG') + write_if_exists(f, pkg, 'ALLOW_EMPTY') + write_if_exists(f, pkg, 'FILES') + write_if_exists(f, pkg, 'pkg_postinst') + write_if_exists(f, pkg, 'pkg_postrm') + f.close() + bb.build.exec_func("read_subpackage_metadata", d) +} + +ldconfig_postinst_fragment() { +if [ x"$D" = "x" ]; then + ldconfig +fi +} + +python package_do_shlibs() { + import os, re, os.path + + lib_re = re.compile("^lib.*\.so") + 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: + bb.error("WORKDIR not defined") + return + + staging = bb.data.getVar('STAGING_DIR', d, 1) + if not staging: + bb.error("STAGING_DIR not defined") + return + + ver = bb.data.getVar('PV', d, 1) + if not ver: + bb.error("PV not defined") + return + + target_sys = bb.data.getVar('TARGET_SYS', d, 1) + if not target_sys: + bb.error("TARGET_SYS not defined") + return + + shlibs_dir = os.path.join(staging, target_sys, "shlibs") + old_shlibs_dir = os.path.join(staging, "shlibs") + bb.mkdirhier(shlibs_dir) + + needed = {} + for pkg in packages.split(): + needs_ldconfig = False + bb.debug(2, "calculating shlib provides for %s" % pkg) + + pkgname = bb.data.getVar('PKG_%s' % pkg, d, 1) + if not pkgname: + pkgname = pkg + + needed[pkg] = [] + sonames = list() + top = os.path.join(workdir, "install", pkg) + for root, dirs, files in os.walk(top): + for file in files: + soname = None + path = os.path.join(root, file) + if os.access(path, os.X_OK) or lib_re.match(file): + cmd = (bb.data.getVar('BUILD_PREFIX', d, 1) or "") + "objdump -p " + path + " 2>/dev/null" + fd = os.popen(cmd) + lines = fd.readlines() + fd.close() + for l in lines: + m = re.match("\s+NEEDED\s+([^\s]*)", l) + if m: + needed[pkg].append(m.group(1)) + m = re.match("\s+SONAME\s+([^\s]*)", l) + if m and not m.group(1) in sonames: + sonames.append(m.group(1)) + if m and libdir_re.match(root): + needs_ldconfig = True + shlibs_file = os.path.join(shlibs_dir, pkgname + ".list") + if os.path.exists(shlibs_file): + os.remove(shlibs_file) + shver_file = os.path.join(shlibs_dir, pkgname + ".ver") + if os.path.exists(shver_file): + os.remove(shver_file) + if len(sonames): + fd = open(shlibs_file, 'w') + for s in sonames: + fd.write(s + '\n') + fd.close() + fd = open(shver_file, 'w') + fd.write(ver + '\n') + fd.close() + if needs_ldconfig: + bb.debug(1, 'adding ldconfig call to postinst for %s' % pkg) + postinst = bb.data.getVar('pkg_postinst_%s' % pkg, d, 1) or bb.data.getVar('pkg_postinst', d, 1) + if not postinst: + postinst = '#!/bin/sh\n' + postinst += bb.data.getVar('ldconfig_postinst_fragment', d, 1) + bb.data.setVar('pkg_postinst_%s' % pkg, postinst, d) + + shlib_provider = {} + list_re = re.compile('^(.*)\.list$') + for dir in [shlibs_dir, old_shlibs_dir]: + if not os.path.exists(dir): + continue + for file in os.listdir(dir): + m = list_re.match(file) + if m: + dep_pkg = m.group(1) + fd = open(os.path.join(dir, file)) + lines = fd.readlines() + fd.close() + ver_file = os.path.join(dir, dep_pkg + '.ver') + lib_ver = None + if os.path.exists(ver_file): + fd = open(ver_file) + lib_ver = fd.readline().rstrip() + fd.close() + for l in lines: + shlib_provider[l.rstrip()] = (dep_pkg, lib_ver) + + + for pkg in packages.split(): + bb.debug(2, "calculating shlib requirements for %s" % pkg) + + deps = list() + for n in needed[pkg]: + if n in shlib_provider.keys(): + (dep_pkg, ver_needed) = shlib_provider[n] + + if ver_needed: + dep = "%s (>= %s)" % (dep_pkg, ver_needed) + else: + dep = dep_pkg + if not dep in deps: + deps.append(dep) + else: + bb.note("Couldn't find shared library provider for %s" % n) + + + deps_file = os.path.join(workdir, "install", pkg + ".shlibdeps") + if os.path.exists(deps_file): + os.remove(deps_file) + if len(deps): + fd = open(deps_file, 'w') + for dep in deps: + fd.write(dep + '\n') + fd.close() +} + +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: + bb.error("WORKDIR not defined") + return + + staging = bb.data.getVar('STAGING_DIR', d, 1) + if not staging: + bb.error("STAGING_DIR not defined") + return + + pc_re = re.compile('(.*)\.pc$') + var_re = re.compile('(.*)=(.*)') + field_re = re.compile('(.*): (.*)') + + pkgconfig_provided = {} + pkgconfig_needed = {} + for pkg in packages.split(): + pkgconfig_provided[pkg] = [] + pkgconfig_needed[pkg] = [] + top = os.path.join(workdir, "install", pkg) + for root, dirs, files in os.walk(top): + for file in files: + m = pc_re.match(file) + if m: + pd = {} + name = m.group(1) + pkgconfig_provided[pkg].append(name) + path = os.path.join(root, file) + if not os.access(path, os.R_OK): + continue + f = open(path, 'r') + lines = f.readlines() + f.close() + for l in lines: + m = var_re.match(l) + if m: + name = m.group(1) + val = m.group(2) + bb.data.setVar(name, bb.data.expand(val, pd), pd) + continue + m = field_re.match(l) + if m: + hdr = m.group(1) + exp = bb.data.expand(m.group(2), pd) + if hdr == 'Requires': + pkgconfig_needed[pkg] += exp.replace(',', ' ').split() + + shlibs_dir = os.path.join(staging, "shlibs") + bb.mkdirhier(shlibs_dir) + + for pkg in packages.split(): + pkgs_file = os.path.join(shlibs_dir, pkg + ".pclist") + if os.path.exists(pkgs_file): + os.remove(pkgs_file) + if pkgconfig_provided[pkg] != []: + f = open(pkgs_file, 'w') + for p in pkgconfig_provided[pkg]: + f.write('%s\n' % p) + f.close() + + for file in os.listdir(shlibs_dir): + m = re.match('^(.*)\.pclist$', file) + if m: + pkg = m.group(1) + fd = open(os.path.join(shlibs_dir, file)) + lines = fd.readlines() + fd.close() + pkgconfig_provided[pkg] = [] + for l in lines: + pkgconfig_provided[pkg].append(l.rstrip()) + + for pkg in packages.split(): + deps = [] + for n in pkgconfig_needed[pkg]: + found = False + for k in pkgconfig_provided.keys(): + if n in pkgconfig_provided[k]: + if k != pkg and not (k in deps): + deps.append(k) + found = True + if found == False: + bb.note("couldn't find pkgconfig module '%s' in any package" % n) + deps_file = os.path.join(workdir, "install", pkg + ".pcdeps") + if os.path.exists(deps_file): + os.remove(deps_file) + if len(deps): + fd = open(deps_file, 'w') + for dep in deps: + fd.write(dep + '\n') + fd.close() +} + +python package_do_split_locales() { + import os + + if (bb.data.getVar('PACKAGE_NO_LOCALE', d, 1) == '1'): + bb.debug(1, "package requested not splitting locales") + return + + packages = (bb.data.getVar('PACKAGES', d, 1) or "").split() + if not packages: + bb.debug(1, "no packages to build; not splitting locales") + return + + datadir = bb.data.getVar('datadir', d, 1) + if not datadir: + bb.note("datadir not defined") + return + + dvar = bb.data.getVar('D', d, 1) + if not dvar: + bb.error("D not defined") + return + + pn = bb.data.getVar('PN', d, 1) + if not pn: + bb.error("PN not defined") + return + + if pn + '-locale' in packages: + packages.remove(pn + '-locale') + + localedir = os.path.join(dvar + datadir, 'locale') + + if not os.path.isdir(localedir): + bb.debug(1, "No locale files in this package") + return + + locales = os.listdir(localedir) + + mainpkg = packages[0] + + for l in locales: + ln = legitimize_package_name(l) + pkg = pn + '-locale-' + ln + packages.append(pkg) + bb.data.setVar('FILES_' + pkg, os.path.join(datadir, 'locale', l), d) + bb.data.setVar('RDEPENDS_' + pkg, '${PKG_%s} virtual-locale-%s' % (mainpkg, ln), d) + bb.data.setVar('RPROVIDES_' + pkg, '%s-locale %s-translation' % (pn, ln), d) + bb.data.setVar('DESCRIPTION_' + pkg, '%s translation for %s' % (l, pn), d) + + bb.data.setVar('PACKAGES', ' '.join(packages), d) + + rdep = (bb.data.getVar('RDEPENDS_%s' % mainpkg, d, 1) or bb.data.getVar('RDEPENDS', d, 1) or "").split() + rdep.append('%s-locale*' % pn) + bb.data.setVar('RDEPENDS_%s' % mainpkg, ' '.join(rdep), d) +} + +python package_do_package () { + bb.build.exec_func('do_install', d) + bb.build.exec_func('package_do_split_locales', d) + bb.build.exec_func('populate_packages', d) + bb.build.exec_func('package_do_shlibs', d) + bb.build.exec_func('package_do_pkgconfig', d) + bb.build.exec_func('read_shlibdeps', d) +} + +do_package[dirs] = "${D}" +populate_packages[dirs] = "${D}" +EXPORT_FUNCTIONS do_package do_shlibs do_split_locales +addtask package before do_build after do_populate_staging -- cgit v1.2.3 From 4cc600f1bed1c629bf77ebf1178258ca860bca9b Mon Sep 17 00:00:00 2001 From: "nslu2-linux.adm@bkbits.net" Date: Thu, 20 Jan 2005 05:14:20 +0000 Subject: Merge bk://oe-devel.bkbits.net/openembedded into bkbits.net:/repos/n/nslu2-linux/openembedded 2005/01/20 00:02:54-05:00 handhelds.org!kergoth Merge oe-devel@oe-devel.bkbits.net:openembedded into handhelds.org:/home/kergoth/code/openembedded 2005/01/20 00:01:05-05:00 handhelds.org!kergoth Fix a critical bug resulting from the recent changes in bitbake (facilitating make -j). The behavior is that of the root filesystem not having a ton of required shared libraries, like libc. Our packaging classes relied on the tasks being able to modify the global metadata, which is no longer allowed. Rework how we do packaging to account for this. BKrev: 41ef3e2c_WACPUP9Waae3Humbe58ng --- classes/package.bbclass | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'classes/package.bbclass') diff --git a/classes/package.bbclass b/classes/package.bbclass index ca2d90c697..53ec3b8e28 100644 --- a/classes/package.bbclass +++ b/classes/package.bbclass @@ -560,13 +560,12 @@ python package_do_split_locales() { bb.data.setVar('RDEPENDS_%s' % mainpkg, ' '.join(rdep), d) } +PACKAGEFUNCS = "do_install package_do_split_locales \ + populate_packages package_do_shlibs \ + package_do_pkgconfig read_shlibdeps" python package_do_package () { - bb.build.exec_func('do_install', d) - bb.build.exec_func('package_do_split_locales', d) - bb.build.exec_func('populate_packages', d) - bb.build.exec_func('package_do_shlibs', d) - bb.build.exec_func('package_do_pkgconfig', d) - bb.build.exec_func('read_shlibdeps', d) + for f in (bb.data.getVar('PACKAGEFUNCS', d, 1) or '').split(): + bb.build.exec_func(f, d) } do_package[dirs] = "${D}" -- cgit v1.2.3 From 76f188573e8858dee7438a88e8c5ebc840525f0e Mon Sep 17 00:00:00 2001 From: Phil Blundell Date: Sun, 30 Jan 2005 15:15:41 +0000 Subject: don't create RDEPENDS entry for intra-package symlinks BKrev: 41fcfa1ddOWT6k-DBCf8u9qgF6VOBg --- classes/package.bbclass | 2 ++ 1 file changed, 2 insertions(+) (limited to 'classes/package.bbclass') diff --git a/classes/package.bbclass b/classes/package.bbclass index 53ec3b8e28..cbd772cd9f 100644 --- a/classes/package.bbclass +++ b/classes/package.bbclass @@ -227,6 +227,8 @@ python populate_packages () { if f == l: found = True bb.debug(1, "target found in %s" % p) + if p == pkg: + break dp = bb.data.getVar('PKG_' + p, d, 1) or p if not dp in rdepends: rdepends.append(dp) -- cgit v1.2.3 From bae07f485b55b4038b65e117016ea6ff7498eca9 Mon Sep 17 00:00:00 2001 From: Derek Young Date: Tue, 1 Mar 2005 18:55:39 +0000 Subject: Merge bk://nslu2-linux@nslu2-linux.bkbits.net/openembedded into builder.(none):/home/dereky/bbroot/openembedded 2005/02/28 04:40:13-08:00 bkbits.net!nslu2-linux.adm Merge bk://oe-devel.bkbits.net/openembedded into bkbits.net:/repos/n/nslu2-linux/openembedded 2005/02/28 12:37:13+00:00 nexus.co.uk!pb straighten out new x11 snapshot 2005/02/28 12:18:18+00:00 reciva.com!pb add new version of xproto 2005/02/28 12:16:45+00:00 reciva.com!pb Merge bk://oe-devel@openembedded-devel.bkbits.net/openembedded into mebius.reciva.com:/home/pb/oe/oe 2005/03/01 18:55:34+00:00 (none)!pb collapse multiple spaces in SRC_URI to a single space. replace some inefficient string concatenation with %-substitution 2005/03/01 18:54:47+00:00 (none)!pb suppress circular dependency when package contains both binaries and libraries move pkgconfig shlibs data into new location; consider old files first so that new ones override them 2005/03/01 18:53:46+00:00 (none)!pb add missing patch to gstreamer SRC_URI BKrev: 4224baabcSg6J2wzDfVE30KMAuYbQA --- classes/package.bbclass | 40 ++++++++++++++++++++++++++-------------- 1 file changed, 26 insertions(+), 14 deletions(-) (limited to 'classes/package.bbclass') diff --git a/classes/package.bbclass b/classes/package.bbclass index cbd772cd9f..4ca34a3d05 100644 --- a/classes/package.bbclass +++ b/classes/package.bbclass @@ -358,7 +358,7 @@ python package_do_shlibs() { shlib_provider = {} list_re = re.compile('^(.*)\.list$') - for dir in [shlibs_dir, old_shlibs_dir]: + for dir in [old_shlibs_dir, shlibs_dir]: if not os.path.exists(dir): continue for file in os.listdir(dir): @@ -381,11 +381,16 @@ python package_do_shlibs() { for pkg in packages.split(): bb.debug(2, "calculating shlib requirements for %s" % pkg) + p_pkg = bb.data.getVar("PKG_%s" % pkg, d, 1) or pkg + deps = list() for n in needed[pkg]: if n in shlib_provider.keys(): (dep_pkg, ver_needed) = shlib_provider[n] + if dep_pkg == p_pkg: + continue + if ver_needed: dep = "%s (>= %s)" % (dep_pkg, ver_needed) else: @@ -424,6 +429,15 @@ python package_do_pkgconfig () { bb.error("STAGING_DIR not defined") return + target_sys = bb.data.getVar('TARGET_SYS', d, 1) + if not target_sys: + bb.error("TARGET_SYS not defined") + return + + shlibs_dir = os.path.join(staging, target_sys, "shlibs") + old_shlibs_dir = os.path.join(staging, "shlibs") + bb.mkdirhier(shlibs_dir) + pc_re = re.compile('(.*)\.pc$') var_re = re.compile('(.*)=(.*)') field_re = re.compile('(.*): (.*)') @@ -461,9 +475,6 @@ python package_do_pkgconfig () { if hdr == 'Requires': pkgconfig_needed[pkg] += exp.replace(',', ' ').split() - shlibs_dir = os.path.join(staging, "shlibs") - bb.mkdirhier(shlibs_dir) - for pkg in packages.split(): pkgs_file = os.path.join(shlibs_dir, pkg + ".pclist") if os.path.exists(pkgs_file): @@ -474,16 +485,17 @@ python package_do_pkgconfig () { f.write('%s\n' % p) f.close() - for file in os.listdir(shlibs_dir): - m = re.match('^(.*)\.pclist$', file) - if m: - pkg = m.group(1) - fd = open(os.path.join(shlibs_dir, file)) - lines = fd.readlines() - fd.close() - pkgconfig_provided[pkg] = [] - for l in lines: - pkgconfig_provided[pkg].append(l.rstrip()) + for dir in [old_shlibs_dir, shlibs_dir]: + for file in os.listdir(dir): + m = re.match('^(.*)\.pclist$', file) + if m: + pkg = m.group(1) + fd = open(os.path.join(dir, file)) + lines = fd.readlines() + fd.close() + pkgconfig_provided[pkg] = [] + for l in lines: + pkgconfig_provided[pkg].append(l.rstrip()) for pkg in packages.split(): deps = [] -- cgit v1.2.3 From 4e4f9126035a265bb4f43da55cf6be07cd60f181 Mon Sep 17 00:00:00 2001 From: "nslu2-linux.adm@bkbits.net" Date: Tue, 1 Mar 2005 18:55:50 +0000 Subject: Merge bk://oe-devel.bkbits.net/openembedded into bkbits.net:/repos/n/nslu2-linux/openembedded 2005/02/28 19:35:49+00:00 reciva.com!pb update libdisplaymigration to 0.99 2005/02/28 19:33:15+00:00 reciva.com!pb avoid crash when old shlibs dir does not exist 2005/03/01 01:51:41+00:00 reciva.com!pb Merge bk://oe-devel@openembedded-devel.bkbits.net/openembedded into mebius.reciva.com:/home/pb/oe/oe 2005/03/01 01:50:40+00:00 reciva.com!pb undelete not-redundant-after-all autofoo x11 patch BKrev: 4224bab6qEo9lRsAKfk1n1wgknwp-w --- classes/package.bbclass | 2 ++ 1 file changed, 2 insertions(+) (limited to 'classes/package.bbclass') diff --git a/classes/package.bbclass b/classes/package.bbclass index 4ca34a3d05..e7cf98edd8 100644 --- a/classes/package.bbclass +++ b/classes/package.bbclass @@ -486,6 +486,8 @@ python package_do_pkgconfig () { f.close() for dir in [old_shlibs_dir, shlibs_dir]: + if not os.path.exists(dir): + continue for file in os.listdir(dir): m = re.match('^(.*)\.pclist$', file) if m: -- cgit v1.2.3 From df91e18416af9f4d460a3fc9b65f2de2f3362bac Mon Sep 17 00:00:00 2001 From: "g2@giantshoulder.com" Date: Wed, 16 Mar 2005 13:36:11 +0000 Subject: Merge nslu2-linux@nslu2-linux.bkbits.net:openembedded into giantshoulder.com:/home/tom/dev/openslug/openembedded 2005/03/17 00:06:10+10:30 (none)!rwhitby Removed the ehci module from openslug-init. 2005/03/17 00:03:09+10:30 (none)!rwhitby Removed the ehci module from openslug-image. 2005/03/16 08:34:55+10:30 (none)!rwhitby OpenSlug 1.7 - removed KALLSYMS, and EHCI is now compiled back into the kernel. 2005/03/15 08:41:13-08:00 bkbits.net!nslu2-linux.adm Merge bk://oe-devel.bkbits.net/openembedded into bkbits.net:/repos/n/nslu2-linux/openembedded 2005/03/15 15:48:57+00:00 (none)!dp Merge bk://oe-devel@oe-devel.bkbits.net/openembedded into cimmeria.(none):/home/dp/zaurus/openembedded 2005/03/15 15:44:34+00:00 (none)!dp Change TARGET_ARCH to TARGET_SYS and enable RTC for timing 2005/03/15 07:41:18-08:00 bkbits.net!nslu2-linux.adm Merge bk://oe-devel.bkbits.net/openembedded into bkbits.net:/repos/n/nslu2-linux/openembedded 2005/03/15 16:02:40+01:00 mn-solutions.de!schurig mnci-ramses: kernel image fixes 2005/03/14 03:41:08-08:00 bkbits.net!nslu2-linux.adm Merge bk://oe-devel.bkbits.net/openembedded into bkbits.net:/repos/n/nslu2-linux/openembedded 2005/03/14 12:29:29+01:00 local!hrw Merge bk://oe-devel@oe-devel.bkbits.net/openembedded/ into marcinj.local:/home/hrw/zaurus/bb/openembedded 2005/03/14 12:26:37+01:00 local!hrw allow packages to not have shlibs info generated - useful with packages like sharp-compat-libs 2005/03/14 03:06:57-08:00 bkbits.net!nslu2-linux.adm Merge bk://oe-devel.bkbits.net/openembedded into bkbits.net:/repos/n/nslu2-linux/openembedded 2005/03/14 21:33:42+10:30 (none)!rwhitby Updated fakeroot from 1.2.1 to 1.2.2 (upstream change). 2005/03/14 12:02:04+01:00 uni-frankfurt.de!mickeyl upgrade fakeroot to 1.2.2 2005/03/13 19:41:10-08:00 bkbits.net!nslu2-linux.adm Merge bk://oe-devel.bkbits.net/openembedded into bkbits.net:/repos/n/nslu2-linux/openembedded 2005/03/14 03:38:40+00:00 (none)!cwiiis Add missing dependencies to gconf-dbus (libxml2, popt) 2005/03/14 03:13:30+00:00 (none)!cwiiis Merge bk://oe-devel@oe-devel.bkbits.net/openembedded into cwiiisdesktop.(none):/home/cwiiis/oe/openembedded 2005/03/14 03:12:25+00:00 (none)!cwiiis Fix automake 1.9 breakage in libmatchbox. 2005/03/13 17:41:10-08:00 bkbits.net!nslu2-linux.adm Merge bk://oe-devel.bkbits.net/openembedded into bkbits.net:/repos/n/nslu2-linux/openembedded 2005/03/14 00:54:51+00:00 rpsys.net!RP openzaurus-2.6: Add pxa udc suspend/resume patch by David Brownell 2005/03/13 10:41:06-08:00 bkbits.net!nslu2-linux.adm Merge bk://oe-devel.bkbits.net/openembedded into bkbits.net:/repos/n/nslu2-linux/openembedded 2005/03/13 13:31:09-05:00 handhelds.org!kergoth Add fakeroot 1.2.1. 2005/03/13 13:25:28-05:00 handhelds.org!kergoth Add hdparm 5.8. 2005/03/13 13:21:24-05:00 handhelds.org!kergoth Merge oe-devel@oe-devel.bkbits.net:openembedded into handhelds.org:/home/kergoth/code/openembedded 2005/03/13 13:21:04-05:00 handhelds.org!kergoth Add rxvt-unicode 5.3. 2005/03/13 09:41:04-08:00 bkbits.net!nslu2-linux.adm Merge bk://oe-devel.bkbits.net/openembedded into bkbits.net:/repos/n/nslu2-linux/openembedded 2005/03/13 18:13:24+01:00 handhelds.org!zecke libsdl-qpe: Try placing __attribute__ at a different location 2005/03/13 08:41:59-08:00 bkbits.net!nslu2-linux.adm Merge bk://oe-devel.bkbits.net/openembedded into bkbits.net:/repos/n/nslu2-linux/openembedded 2005/03/13 11:49:00-05:00 handhelds.org!kergoth Fix the efl package builds that were broken by the recent binconfig changes (they were directly specifying the -config script paths in staging_bindir). 2005/03/13 11:43:47-05:00 handhelds.org!kergoth Merge oe-devel@oe-devel.bkbits.net:openembedded into handhelds.org:/home/kergoth/code/openembedded 2005/03/13 11:43:30-05:00 handhelds.org!kergoth Apply bugfix from Finn Thain to the bytes_per_inode patch in genext2fs. 2005/03/13 07:41:23-08:00 bkbits.net!nslu2-linux.adm Merge bk://oe-devel.bkbits.net/openembedded into bkbits.net:/repos/n/nslu2-linux/openembedded 2005/03/13 16:15:10+01:00 uni-frankfurt.de!mickeyl add collections.so and itertools.so to python-lang 2005/03/13 06:41:12-08:00 bkbits.net!nslu2-linux.adm Merge bk://oe-devel.bkbits.net/openembedded into bkbits.net:/repos/n/nslu2-linux/openembedded 2005/03/13 15:17:47+01:00 uni-frankfurt.de!mickeyl bump CVSDATE for oz-3.5.3 2005/03/13 15:15:43+01:00 uni-frankfurt.de!mickeyl Merge bk://oe-devel@oe-devel.bkbits.net/openembedded into r2d2.tm.informatik.uni-frankfurt.de:/local/pkg/oe/packages 2005/03/13 15:13:39+01:00 uni-frankfurt.de!mickeyl repair fortune-mod and bring it back from nonworking 2005/03/13 13:34:54+01:00 uni-frankfurt.de!mickeyl add GNU recode, a charset conversion utility 2005/03/13 03:41:06-08:00 bkbits.net!nslu2-linux.adm Merge bk://oe-devel.bkbits.net/openembedded into bkbits.net:/repos/n/nslu2-linux/openembedded 2005/03/13 12:16:41+01:00 (none)!koen Add vlc-gpe_0.8.1, courtesy Marc Poulhies. Fix configure flags, disable ogg/tremor for now. 2005/03/12 21:41:06-08:00 bkbits.net!nslu2-linux.adm Merge bk://oe-devel.bkbits.net/openembedded into bkbits.net:/repos/n/nslu2-linux/openembedded 2005/03/13 00:47:35-05:00 handhelds.org!kergoth Upgrade beep-media-player from 0.9.7rc2 to 0.9.7, and fix the build by defining _GNU_SOURCE. 2005/03/13 00:35:23-05:00 handhelds.org!kergoth Make the libogg builds inherit pkgconfig. 2005/03/13 00:21:46-05:00 handhelds.org!kergoth Unbork the ccdv build. 2005/03/12 20:41:07-08:00 bkbits.net!nslu2-linux.adm Merge bk://oe-devel.bkbits.net/openembedded into bkbits.net:/repos/n/nslu2-linux/openembedded 2005/03/12 23:46:08-05:00 handhelds.org!kergoth Add OpenSSH 4.0p1. 2005/03/12 19:41:14-08:00 bkbits.net!nslu2-linux.adm Merge bk://oe-devel.bkbits.net/openembedded into bkbits.net:/repos/n/nslu2-linux/openembedded 2005/03/12 17:28:56-10:00 (none)!dyoung Set NLS for glib-2.0 to be on so packages that depend on it will build 2005/03/12 22:16:52-05:00 handhelds.org!kergoth Add openssh test results to the i686 linux* site files. 2005/03/12 22:02:28-05:00 handhelds.org!kergoth Disable mmx in the inkscape builds. 2005/03/12 21:57:04-05:00 handhelds.org!kergoth Split libsigc++ 1.2 and 2.0 into seperate entities, as they should be, and adjust the inkscape deps accordingly. Inkscape builds again. 2005/03/12 18:41:10-08:00 bkbits.net!nslu2-linux.adm Merge bk://oe-devel.bkbits.net/openembedded into bkbits.net:/repos/n/nslu2-linux/openembedded 2005/03/12 20:57:13-05:00 handhelds.org!kergoth Fix the libart-lgpl build for i686. 2005/03/12 17:41:03-08:00 bkbits.net!nslu2-linux.adm Merge bk://oe-devel.bkbits.net/openembedded into bkbits.net:/repos/n/nslu2-linux/openembedded 2005/03/12 20:44:07-05:00 handhelds.org!kergoth Fix FILESPATH in freetype-native. 2005/03/12 20:34:07-05:00 handhelds.org!kergoth Add feh version 1.2.7. 2005/03/12 20:32:27-05:00 handhelds.org!kergoth imlib2: * Enable X support, and patch up the buildsystem to do so more intelligently. * Depend on x11 and xext. * Fixup the -config script. * Split out the binaries into a -bin package. 2005/03/12 20:03:00-05:00 handhelds.org!kergoth Apply patch to fixup giblib-config. 2005/03/12 16:41:04-08:00 bkbits.net!nslu2-linux.adm Merge bk://oe-devel.bkbits.net/openembedded into bkbits.net:/repos/n/nslu2-linux/openembedded 2005/03/12 19:28:47-05:00 handhelds.org!kergoth Add giblib 1.2.4 and consolodate some metadata into a .inc. 2005/03/12 19:09:47-05:00 handhelds.org!kergoth Unbork the imlib2 build.. its packaging needed tweaks, and its manual set oF EET_CONFIG and FREETYPE_CONFIG was broken by the recent binconfig changes. 2005/03/12 18:53:25-05:00 handhelds.org!kergoth Clean up the freetype builds.. use autotools_stage_includes. 2005/03/12 15:41:11-08:00 bkbits.net!nslu2-linux.adm Merge bk://oe-devel.bkbits.net/openembedded into bkbits.net:/repos/n/nslu2-linux/openembedded 2005/03/12 18:28:04-05:00 handhelds.org!kergoth Add grep 2.5.1. 2005/03/12 18:19:59-05:00 handhelds.org!kergoth Upgrade mysql to 4.1.10a. 2005/03/12 14:41:18-08:00 bkbits.net!nslu2-linux.adm Merge bk://oe-devel.bkbits.net/openembedded into bkbits.net:/repos/n/nslu2-linux/openembedded 2005/03/12 17:38:33-05:00 handhelds.org!kergoth Add php 4.3.10, and move common bits into a .inc. 2005/03/12 17:35:21-05:00 handhelds.org!kergoth Add php test results to the i686 linux* site files. 2005/03/12 17:08:27-05:00 handhelds.org!kergoth Pass the password in the cvs:// uri in the slugimage .bb 2005/03/12 17:03:03-05:00 handhelds.org!kergoth Per the recommendation of Erik Andersen, kill off the setting of -rpath in our TARGET_LDFLAGS. We now rely on ldconfig more than ever. This was necessary, because the linker looks in both rpath _and_ rpath-link to find things during the build. 2005/03/12 17:01:41-05:00 handhelds.org!kergoth Fix the naming of the .ext2 image inside the .ext2.gz for that image type. 2005/03/12 16:57:29-05:00 handhelds.org!kergoth Fix the autom4te_perllibdir bits in gnu-configize, to make it usable natively on the target. 2005/03/12 12:41:25-08:00 bkbits.net!nslu2-linux.adm Merge bk://oe-devel.bkbits.net/openembedded into bkbits.net:/repos/n/nslu2-linux/openembedded 2005/03/12 15:32:05-05:00 handhelds.org!kergoth Merge oe-devel@oe-devel.bkbits.net:openembedded into handhelds.org:/home/kergoth/code/openembedded 2005/03/12 15:31:46-05:00 handhelds.org!kergoth genext2fs 1.3+cvs: * Apply bytes per inode patch, to fix the default inode count based on # of blocks, so it no longer uses the auto bits unnecessarily, and add a cmdline opt to control it. BKrev: 4238364bBtYSx5s1QTTJbjtEROGB3w --- classes/package.bbclass | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'classes/package.bbclass') diff --git a/classes/package.bbclass b/classes/package.bbclass index e7cf98edd8..774bd794af 100644 --- a/classes/package.bbclass +++ b/classes/package.bbclass @@ -272,6 +272,11 @@ fi python package_do_shlibs() { import os, re, os.path + exclude_shlibs = bb.data.getVar('EXCLUDE_FROM_SHLIBS', d, 0) + if exclude_shlibs: + bb.note("not generating shlibs") + return + lib_re = re.compile("^lib.*\.so") libdir_re = re.compile(".*/lib$") -- cgit v1.2.3 From ea2bf8aff2e2adc65603fd65db5ee0c36f0a1e1c Mon Sep 17 00:00:00 2001 From: Phil Blundell Date: Tue, 19 Apr 2005 01:35:12 +0000 Subject: add trailing newlines to postinst and postrm in split packages BKrev: 42646050b9wZ5BDXf6zj1pOZottT1g --- classes/package.bbclass | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'classes/package.bbclass') diff --git a/classes/package.bbclass b/classes/package.bbclass index 774bd794af..9abecd5550 100644 --- a/classes/package.bbclass +++ b/classes/package.bbclass @@ -15,9 +15,9 @@ def do_split_packages(d, root, file_regex, output_pattern, description, postinst return if postinst: - postinst = '#!/bin/sh\n' + postinst + postinst = '#!/bin/sh\n' + postinst + '\n' if postrm: - postrm = '#!/bin/sh\n' + postrm + postrm = '#!/bin/sh\n' + postrm + '\n' if not recursive: objs = os.listdir(dvar + root) else: -- cgit v1.2.3 From 2f9ad2e658e8ad53ecdb6eb82358eb858a8de5f5 Mon Sep 17 00:00:00 2001 From: "nslu2-linux.adm@bkbits.net" Date: Tue, 17 May 2005 18:39:51 +0000 Subject: Merge bk://oe-devel.bkbits.net/openembedded into bkbits.net:/repos/n/nslu2-linux/openembedded 2005/05/17 20:39:04+02:00 uni-frankfurt.de!mickeyl add python-pygtk2 to task-python-everything 2005/05/17 20:32:02+02:00 uni-frankfurt.de!mickeyl apply zecke's patches to prepare for the low memory bitbake. the repository needs bitbake r159 or better now BKrev: 428a3a77SoUtXtfto7tXtwiSdrA1ew --- classes/package.bbclass | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'classes/package.bbclass') diff --git a/classes/package.bbclass b/classes/package.bbclass index 9abecd5550..d6a2193404 100644 --- a/classes/package.bbclass +++ b/classes/package.bbclass @@ -82,7 +82,7 @@ def do_split_packages(d, root, file_regex, output_pattern, description, postinst bb.data.setVar('PACKAGES', ' '.join(packages), d) python populate_packages () { - import glob, stat, errno, re, copy + import glob, stat, errno, re workdir = bb.data.getVar('WORKDIR', d, 1) if not workdir: @@ -122,7 +122,7 @@ python populate_packages () { return (s[stat.ST_MODE] & stat.S_IEXEC) for pkg in packages.split(): - localdata = copy.deepcopy(d) + localdata = bb.data.createCopy(d) root = os.path.join(workdir, "install", pkg) os.system('rm -rf %s' % root) @@ -457,7 +457,7 @@ python package_do_pkgconfig () { for file in files: m = pc_re.match(file) if m: - pd = {} + pd = bb.data.init() name = m.group(1) pkgconfig_provided[pkg].append(name) path = os.path.join(root, file) -- cgit v1.2.3 From 851577d23d9339308345f8a33d025af0bce5f18d Mon Sep 17 00:00:00 2001 From: Florian Boor Date: Fri, 22 Jul 2005 21:51:10 +0000 Subject: Applied patch by Philip Blundell to fix package names in dependencies. --- classes/package.bbclass | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'classes/package.bbclass') diff --git a/classes/package.bbclass b/classes/package.bbclass index d6a2193404..90dfec9fa7 100644 --- a/classes/package.bbclass +++ b/classes/package.bbclass @@ -481,7 +481,8 @@ python package_do_pkgconfig () { pkgconfig_needed[pkg] += exp.replace(',', ' ').split() for pkg in packages.split(): - pkgs_file = os.path.join(shlibs_dir, pkg + ".pclist") + ppkg = bb.data.getVar("PKG_" + pkg, d, 1) or pkg + pkgs_file = os.path.join(shlibs_dir, ppkg + ".pclist") if os.path.exists(pkgs_file): os.remove(pkgs_file) if pkgconfig_provided[pkg] != []: -- cgit v1.2.3