diff options
author | Chris Larson <kergoth@openedhand.com> | 2006-09-21 16:29:02 +0000 |
---|---|---|
committer | Chris Larson <kergoth@openedhand.com> | 2006-09-21 16:29:02 +0000 |
commit | 8d804ea40a349e679850b716012120e54fe5242d (patch) | |
tree | d8b1d37ea78880df826f81bb4b791f8f93f1f985 | |
parent | 5cacd3ea7efd69e57979d962616bf87c521c6f8b (diff) | |
download | openembedded-core-8d804ea40a349e679850b716012120e54fe5242d.tar.gz openembedded-core-8d804ea40a349e679850b716012120e54fe5242d.tar.bz2 openembedded-core-8d804ea40a349e679850b716012120e54fe5242d.zip |
Merge devgen branch to trunk.
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@743 311d38ba-8fff-0310-9ca6-ca027cbcb966
-rw-r--r-- | meta/classes/base.bbclass | 48 | ||||
-rw-r--r-- | meta/classes/package.bbclass | 122 | ||||
-rw-r--r-- | meta/classes/package_ipk.bbclass | 2 | ||||
-rw-r--r-- | meta/conf/bitbake.conf | 5 | ||||
-rw-r--r-- | meta/packages/tasks/task-oh-sdk.bb | 203 |
5 files changed, 176 insertions, 204 deletions
diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass index a36829006e..0d5f5ea164 100644 --- a/meta/classes/base.bbclass +++ b/meta/classes/base.bbclass @@ -624,24 +624,60 @@ python read_shlibdeps () { bb.data.setVar('RDEPENDS_' + pkg, " " + " ".join(rdepends), d) } -python read_subpackage_metadata () { - import re +def read_pkgdatafile(fn): + pkgdata = {} def decode(str): import codecs c = codecs.getdecoder("string_escape") return c(str)[0] - data_file = bb.data.expand("${WORKDIR}/install/${PN}.package", d) - if os.access(data_file, os.R_OK): - f = file(data_file, 'r') + import os + if os.access(fn, os.R_OK): + import re + f = file(fn, 'r') lines = f.readlines() f.close() r = re.compile("([^:]+):\s*(.*)") for l in lines: m = r.match(l) if m: - bb.data.setVar(m.group(1), decode(m.group(2)), d) + pkgdata[m.group(1)] = decode(m.group(2)) + + return pkgdata + +def has_subpkgdata(pkg, d): + import bb, os + fn = bb.data.expand('${STAGING_DIR}/pkgdata/runtime/%s' % pkg, d) + return os.access(fn, os.R_OK) + +def read_subpkgdata(pkg, d): + import bb, os + fn = bb.data.expand('${STAGING_DIR}/pkgdata/runtime/%s' % pkg, d) + return read_pkgdatafile(fn) + + +def has_pkgdata(pn, d): + import bb, os + fn = bb.data.expand('${STAGING_DIR}/pkgdata/%s' % pn, d) + return os.access(fn, os.R_OK) + +def read_pkgdata(pn, d): + import bb, os + fn = bb.data.expand('${STAGING_DIR}/pkgdata/%s' % pn, d) + return read_pkgdatafile(fn) + +python read_subpackage_metadata () { + import bb + data = read_pkgdata(bb.data.getVar('PN', d, 1), d) + + for key in data.keys(): + bb.data.setVar(key, data[key], d) + + for pkg in bb.data.getVar('PACKAGES', d, 1).split(): + sdata = read_subpkgdata(pkg, d) + for key in sdata.keys(): + bb.data.setVar(key, sdata[key], d) } python __anonymous () { diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass index d39a1afb70..e2e98624ca 100644 --- a/meta/classes/package.bbclass +++ b/meta/classes/package.bbclass @@ -107,7 +107,7 @@ def do_split_packages(d, root, file_regex, output_pattern, description, postinst objs.append(relpath) if extra_depends == None: - extra_depends = bb.data.getVar('PKG_' + packages[0], d, 1) or packages[0] + extra_depends = packages[0] for o in objs: import re, stat @@ -287,10 +287,7 @@ python populate_packages () { 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) + bb.data.setVar('PKG', pkg, localdata) overrides = bb.data.getVar('OVERRIDES', localdata, 1) if not overrides: @@ -381,14 +378,17 @@ python populate_packages () { 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) + if not p in rdepends: + rdepends.append(p) break if found == False: bb.note("%s contains dangling symlink to %s" % (pkg, l)) bb.data.setVar('RDEPENDS_' + pkg, " " + " ".join(rdepends), d) + bb.build.exec_func('emit_pkgdata', d) +} + +python emit_pkgdata() { def write_if_exists(f, pkg, var): def encode(str): import codecs @@ -399,21 +399,29 @@ python populate_packages () { if val: f.write('%s_%s: %s\n' % (var, pkg, encode(val))) - data_file = os.path.join(workdir, "install", pn + ".package") + packages = bb.data.getVar('PACKAGES', d, 1) + if not packages: + return + + data_file = bb.data.expand("${STAGING_DIR}/pkgdata/${PN}", d) 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') - write_if_exists(f, pkg, 'pkg_preinst') - write_if_exists(f, pkg, 'pkg_prerm') f.close() + + for pkg in packages.split(): + subdata_file = bb.data.expand("${STAGING_DIR}/pkgdata/runtime/%s" % pkg, d) + sf = open(subdata_file, 'w') + write_if_exists(sf, pkg, 'DESCRIPTION') + write_if_exists(sf, pkg, 'RDEPENDS') + write_if_exists(sf, pkg, 'RPROVIDES') + write_if_exists(sf, pkg, 'PKG') + write_if_exists(sf, pkg, 'ALLOW_EMPTY') + write_if_exists(sf, pkg, 'FILES') + write_if_exists(sf, pkg, 'pkg_postinst') + write_if_exists(sf, pkg, 'pkg_postrm') + write_if_exists(sf, pkg, 'pkg_preinst') + write_if_exists(sf, pkg, 'pkg_prerm') + sf.close() bb.build.exec_func("read_subpackage_metadata", d) } @@ -423,6 +431,57 @@ if [ x"$D" = "x" ]; then fi } +python package_depchains() { + """ + For a given set of prefix and postfix modifiers, make those packages + RRECOMMENDS on the corresponding packages for its DEPENDS. + + Example: If package A depends upon package B, and A's .bb emits an + A-dev package, this would make A-dev Recommends: B-dev. + """ + + packages = bb.data.getVar('PACKAGES', d, 1) + postfixes = (bb.data.getVar('DEPCHAIN_POST', d, 1) or '').split() + prefixes = (bb.data.getVar('DEPCHAIN_PRE', d, 1) or '').split() + + def pkg_addrrecs(pkg, base, func, d): + rdepends = explode_deps(bb.data.getVar('RDEPENDS_' + base, d, 1) or bb.data.getVar('RDEPENDS', d, 1) or "") + # bb.note('rdepends for %s is %s' % (base, rdepends)) + rreclist = [] + + for depend in rdepends: + split_depend = depend.split(' (') + name = split_depend[0].strip() + func(rreclist, name) + + bb.data.setVar('RRECOMMENDS_%s' % pkg, ' '.join(rreclist), d) + + def packaged(pkg, d): + return os.access(bb.data.expand('${STAGING_DIR}/pkgdata/runtime/%s.packaged' % pkg, d), os.R_OK) + + for pkg in packages.split(): + for postfix in postfixes: + def func(list, name): + pkg = '%s%s' % (name, postfix) + if packaged(pkg, d): + list.append(pkg) + + base = pkg[:-len(postfix)] + if pkg.endswith(postfix): + pkg_addrrecs(pkg, base, func, d) + continue + + for prefix in prefixes: + def func(list, name): + pkg = '%s%s' % (prefix, name) + if packaged(pkg, d): + list.append(pkg) + + base = pkg[len(prefix):] + if pkg.startswith(prefix): + pkg_addrrecs(pkg, base, func, d) +} + python package_do_shlibs() { import os, re, os.path @@ -468,10 +527,6 @@ python package_do_shlibs() { 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) @@ -493,10 +548,10 @@ python package_do_shlibs() { sonames.append(m.group(1)) if m and libdir_re.match(root): needs_ldconfig = True - shlibs_file = os.path.join(shlibs_dir, pkgname + ".list") + shlibs_file = os.path.join(shlibs_dir, pkg + ".list") if os.path.exists(shlibs_file): os.remove(shlibs_file) - shver_file = os.path.join(shlibs_dir, pkgname + ".ver") + shver_file = os.path.join(shlibs_dir, pkg + ".ver") if os.path.exists(shver_file): os.remove(shver_file) if len(sonames): @@ -540,14 +595,12 @@ 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: + if dep_pkg == pkg: continue if ver_needed: @@ -559,7 +612,6 @@ python package_do_shlibs() { 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) @@ -635,8 +687,7 @@ python package_do_pkgconfig () { pkgconfig_needed[pkg] += exp.replace(',', ' ').split() for pkg in packages.split(): - ppkg = bb.data.getVar("PKG_" + pkg, d, 1) or pkg - pkgs_file = os.path.join(shlibs_dir, ppkg + ".pclist") + pkgs_file = os.path.join(shlibs_dir, pkg + ".pclist") if os.path.exists(pkgs_file): os.remove(pkgs_file) if pkgconfig_provided[pkg] != []: @@ -725,7 +776,7 @@ python package_do_split_locales() { 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('RDEPENDS_' + 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) @@ -738,7 +789,8 @@ python package_do_split_locales() { PACKAGEFUNCS = "package_do_split_locales \ populate_packages package_do_shlibs \ - package_do_pkgconfig read_shlibdeps" + package_do_pkgconfig read_shlibdeps \ + package_depchains" python package_do_package () { for f in (bb.data.getVar('PACKAGEFUNCS', d, 1) or '').split(): bb.build.exec_func(f, d) @@ -747,6 +799,6 @@ python package_do_package () { do_package[dirs] = "${D}" # shlibs requires any DEPENDS to have already packaged for the *.list files do_package[deptask] = "do_package" -populate_packages[dirs] = "${D}" +populate_packages[dirs] = "${STAGING_DIR}/pkgdata/runtime ${D}" EXPORT_FUNCTIONS do_package do_shlibs do_split_locales mapping_rename_hook addtask package before do_build after do_install diff --git a/meta/classes/package_ipk.bbclass b/meta/classes/package_ipk.bbclass index 2847cee6e0..cb44484855 100644 --- a/meta/classes/package_ipk.bbclass +++ b/meta/classes/package_ipk.bbclass @@ -222,6 +222,8 @@ python do_package_ipk () { if ret != 0: raise bb.build.FuncFailed("ipkg-build execution failed") + file(bb.data.expand('${STAGING_DIR}/pkgdata/runtime/%s.packaged' % pkg, d), 'w').close() + for script in ["preinst", "postinst", "prerm", "postrm", "control" ]: scriptfile = os.path.join(controldir, script) try: diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf index 228c8706e4..ced2f1f7eb 100644 --- a/meta/conf/bitbake.conf +++ b/meta/conf/bitbake.conf @@ -96,6 +96,11 @@ HOMEPAGE = "unknown" # Package dependencies and provides. +# Ensure that -dev packages recommend the corresponding -dev packages of their +# deps, and the same for -dbg. +DEPCHAIN_PRE = "" +DEPCHAIN_POST = "-dev -dbg" + DEPENDS = "" RDEPENDS = "" PROVIDES = "" diff --git a/meta/packages/tasks/task-oh-sdk.bb b/meta/packages/tasks/task-oh-sdk.bb index 84cbdcb5b9..c4b8749f9c 100644 --- a/meta/packages/tasks/task-oh-sdk.bb +++ b/meta/packages/tasks/task-oh-sdk.bb @@ -1,187 +1,64 @@ DESCRIPTON = "Software Development Tasks for OpenedHand Poky" MAINTAINER = "Richard Purdie <richard@openedhand.com>" -PR = "r8" - -PACKAGES = "\ - task-oh-sdk \ - task-oh-sdk-base \ - task-oh-sdk-apps \ - task-oh-sdk-libs \ - task-oh-sdk-x11-base \ - task-oh-sdk-x11-apps \ - task-oh-sdk-x11-libs \ - task-oh-sdk-x11-xext \ - task-oh-sdk-x11-xlibs" - +PR = "r10" +DEPENDS = "task-oh" ALLOW_EMPTY = "1" +PACKAGEFUNCS =+ 'generate_sdk_pkgs' -RDEPENDS_task-oh-sdk := "\ - task-oh-sdk-base \ - task-oh-sdk-apps \ - task-oh-sdk-libs \ - task-oh-sdk-x11-base \ - task-oh-sdk-x11-apps \ - task-oh-sdk-x11-libs \ - task-oh-sdk-x11-xext \ - task-oh-sdk-x11-xlibs" +PACKAGES = "task-oh-sdk" -RDEPENDS_task-oh-sdk-base := "\ +RDEPENDS_task-oh-sdk = "\ autoconf \ automake \ binutils \ binutils-symlinks \ gcc \ gcc-symlinks \ - glibc-dev \ make \ perl-module-re \ perl-module-text-wrap \ pkgconfig" -RDEPENDS_task-oh-sdk-apps := "\ - avahi-dev \ - binutils-dev \ - console-tools-dev \ - db-dev \ - gdb-dev \ - udev-dev" - -RDEPENDS_task-oh-sdk-libs := "\ - bzip2-dev \ - dbus-dev \ - eds-dbus-dev \ - glib-2.0-dev \ - ncurses-dev \ - zlib-dev" +python generate_sdk_pkgs () { + def packaged(pkg, d): + return os.access(bb.data.expand('${STAGING_DIR}/pkgdata/runtime/%s.packaged' % pkg, d), os.R_OK) -RDEPENDS_task-oh-sdk-x11-base := "\ - atk-dev \ - cairo-dev \ - gconf-dbus-dev \ - gtk+-dev \ - libmatchbox-dev \ - matchbox-desktop-dev \ - pango-dev \ - startup-notification-dev" -# gtk-engines-dev \ -# libsvg-cairo-dev \ + ohpkgs = read_pkgdata('task-oh', d)['PACKAGES'] + pkgs = bb.data.getVar('PACKAGES', d, 1).split() + for pkg in ohpkgs.split(): + newpkg = pkg.replace('task-oh', 'task-oh-sdk') -RDEPENDS_task-oh-sdk-x11-apps := "\ - dates-dev \ -" + # for each of the task packages, add a corresponding sdk task + pkgs.append(newpkg) -RDEPENDS_task-oh-sdk-x11-libs := "\ - gconf-dbus-dev \ - gnome-vfs-dbus-dev \ -" + # for each sdk task, take the rdepends of the non-sdk task, and turn + # that into rrecommends upon the -dev versions of those, not unlike + # the package depchain code + spkgdata = read_subpkgdata(pkg, d) -RDEPENDS_task-oh-sdk-x11-xext := "\ - compositeext-dev \ - damageext-dev \ - fixesext-dev \ - randrext-dev \ - recordext-dev \ - renderext-dev \ - xcalibrate-dev \ - xcalibrateext-dev \ - xextensions-dev \ - xproto-dev \ - xtrans-dev" + rdepends = explode_deps(spkgdata.get('RDEPENDS_%s' % pkg) or '') + rreclist = [] -RDEPENDS_task-oh-sdk-x11-xlibs := "\ - libx11-dev \ - libxau-dev \ - libxcursor-dev \ - libxdmcp-dev \ - libxext-dev \ - libxfixes-dev \ - libxfont-dev \ - libxft-dev \ - libxpm-dev \ - libxrandr-dev \ - libxrender-dev \ - libxsettings-client-dev \ - libxt-dev \ - libxtst-dev" -# libxdamage-dev \ -# libxcomposite-dev \ + for depend in rdepends: + split_depend = depend.split(' (') + name = split_depend[0].strip() + if packaged('%s-dev' % name, d): + rreclist.append('%s-dev' % name) + else: + deppkgdata = read_subpkgdata(name, d) + rdepends2 = explode_deps(deppkgdata.get('RDEPENDS_%s' % name) or '') + for depend in rdepends2: + split_depend = depend.split(' (') + name = split_depend[0].strip() + if packaged('%s-dev' % name, d): + rreclist.append('%s-dev' % name) + oldrrec = bb.data.getVar('RRECOMMENDS_%s' % newpkg, d) or '' + bb.data.setVar('RRECOMMENDS_%s' % newpkg, oldrrec + ' ' + ' '.join(rreclist), d) + # bb.note('RRECOMMENDS_%s = "%s"' % (newpkg, bb.data.getVar('RRECOMMENDS_%s' % newpkg, d))) + # bb.note('pkgs is %s' % pkgs) + bb.data.setVar('PACKAGES', ' '.join(pkgs), d) +} -RDEPENDS_task-sdk-unsorted := "\ - gnome-mime-data-dev \ - gtk-clearlooks-engine-dev \ - ipkg-dev \ - js-dev \ - kernel-dev \ - libapm-dev \ - libcurl-dev \ - libdaemon-dev \ - libexpat-dev \ - libfakekey-dev \ - libfontconfig-dev \ - libfreetype-dev \ - libgcrypt-dev \ - libglade-2.0-dev \ - libgmp-dev \ - libgnutls-dev \ - libgpg-error-dev \ - libgtkhtml-2-dev \ - libice-dev \ - libiconv-dev \ - libipkg-dev \ - libiw-dev \ - libjpeg-dev \ - libloudmouth-1-dev \ - libpcap-dev \ - libpng-dev \ - libpng12-dev \ - libpopt-dev \ - libreadline-dev \ - libsm-dev \ - libstartup-notification-1-dev \ - libxau-dev \ - libxcalibrate-dev \ - libxml2-dev \ - libxmu-dev \ - libxmuu-dev \ - libxsettings-dev \ - linux-libc-headers-dev \ - lttng-viewer-dev \ - matchbox-desktop-dev \ - ppp-dev \ - shared-mime-info-dev \ - sysfsutils-dev \ - sysvinit-dev \ - others found \ - expat-dev \ - fontconfig-dev \ - freetype-dev \ - gstreamer-dev \ - ice-dev \ - ipkg-dev \ - jpeg-dev \ - libapm-dev \ - libdisplaymigration-dev \ - libetpan-dev \ - libgcrypt-dev \ - libglade-dev \ - libgpg-error-dev \ - libidl-dev \ - libiw-dev \ - libmimedir-dev \ - libpcap-dev \ - libpixman-dev \ - libpng-dev \ - libschedule-dev \ - libsm-dev \ - libsoundgen-dev \ - libsvg-dev \ - libtododb-dev \ - libts-dev \ - libxml2-dev \ - openobex-dev \ - popt-dev \ - readline-dev \ - sqlite-dev \ - xmu-dev" +PACKAGES_DYNAMIC = "task-oh-sdk-*" |