diff options
-rw-r--r-- | handbook/extendpoky.xml | 95 | ||||
-rw-r--r-- | meta/classes/base.bbclass | 102 | ||||
-rw-r--r-- | meta/classes/insane.bbclass | 2 | ||||
-rw-r--r-- | meta/classes/package.bbclass | 20 | ||||
-rw-r--r-- | meta/classes/package_deb.bbclass | 4 | ||||
-rw-r--r-- | meta/classes/package_ipk.bbclass | 4 | ||||
-rw-r--r-- | meta/classes/packagedata.bbclass | 82 | ||||
-rw-r--r-- | meta/packages/libidl/libidl-native_0.8.12.bb (renamed from meta/packages/libidl/libidl-native_0.8.3.bb) | 0 | ||||
-rw-r--r-- | meta/packages/libidl/libidl_0.8.12.bb (renamed from meta/packages/libidl/libidl_0.8.3.bb) | 0 | ||||
-rw-r--r-- | meta/packages/xorg-xserver/xserver-xf86-dri-lite_1.6.0.bb | 15 |
10 files changed, 205 insertions, 119 deletions
diff --git a/handbook/extendpoky.xml b/handbook/extendpoky.xml index f259d2ef0..fa789d4af 100644 --- a/handbook/extendpoky.xml +++ b/handbook/extendpoky.xml @@ -26,7 +26,15 @@ </para> <para> - The simplest way to add a new package is to base it on a similar + Before writing a recipe from scratch it is often useful to check + someone else hasn't written one already. OpenEmbedded is a good place + to look as it has a wider scope and hence a wider range of packages. + Poky aims to be compatible with OpenEmbedded so most recipes should + just work in Poky. + </para> + + <para> + For new packages, the simplest way to add a recipe is to base it on a similar pre-existing recipe. There are some examples below of how to add standard types of packages: </para> @@ -556,6 +564,37 @@ BBFILE_PRIORITY_extras = "5"</literallayout> </para> </section> + <section id="usingpoky-changes-supplement"> + <title>Supplementry Metadata Repositories</title> + + <para> + Often when developing a project based on Poky there will be components + that are not ready for public consumption for whatever reason. By making + use of the collections mechanism and other functionality within Poky, it + is possible to have a public repository which is supplemented by a private + one just containing the pieces that need to be kept private. + </para> + <para> + The usual approach with these is to create a separate git repository called + "meta-prvt-XXX" which is checked out alongside the other meta-* + directories included in Poky. Under this directory there can be several + different directories such as classes, conf and packages which all + function as per the usual Poky directory structure. + </para> + <para> + If extra meta-* directories are found, Poky will automatically add them + into the BBPATH variable so the conf and class files contained there + are found. If a file called poky-extra-environment is found within the + meta-* directory, this will be sourced as the environment is setup, + allowing certain configuration to be overridden such as the location of the + local.conf.sample file that is used. + </para> + <para> + Note that at present, BBFILES is not automatically changed and this needs + to be adjusted to find files in the packages/ directory. Usually a custom + local.conf.sample file will be used to handle this instead. + </para> + </section> <section id='usingpoky-changes-commits'> <title>Committing Changes</title> @@ -564,8 +603,8 @@ BBFILE_PRIORITY_extras = "5"</literallayout> Modifications to Poky are often managed under some kind of source revision control system. The policy for committing to such systems is important as some simple policy can significantly improve - usability. The tips below are based on the policy that OpenedHand - uses for commits to Poky. + usability. The tips below are based on the policy followed for the + Poky core. </para> <para> @@ -622,6 +661,56 @@ BBFILE_PRIORITY_extras = "5"</literallayout> upgradable packages in all cases. </para> </section> + <section id='usingpoky-changes-collaborate'> + <title>Using Poky in a Team Environment</title> + + <para> + It may not be immediately clear how Poky can work in a team environment, + or scale to a large team of developers. The specifics of any situation + will determine the best solution and poky offers immense flexibility in + that aspect but there are some practises that experience has shown to work + well. + </para> + + <para> + The core component of any development effort with Poky is often an + automated build testing framework and image generation process. This + can be used to check that the metadata is buildable, highlight when + commits break the builds and provide up to date images allowing people + to test the end result and use them as a base platform for further + development. Experience shows that buildbot is a good fit for this role + and that it works well to configure it to make two types of build - + incremental builds and 'from scratch'/full builds. The incremental builds + can be tied to a commit hook which triggers them each time a commit is + made to the metadata and are a useful acid test of whether a given commit + breaks the build in some serious way. They catch lots of simple errors + and whilst they won't catch 100% of failures, the tests are fast so + developers can get feedback on their changes quickly. The full builds + are builds that build everything from the ground up and test everything. + They usually happen at preset times such as at night when the machine + load isn't high from the incremental builds. + </para> + + <para> + Most teams have pieces of software undergoing active development. It is of + significant benefit to put these under control of a source control system + compatible with Poky such as git or svn. The autobuilder can then be set to + pull the latest revisions of these packages so the latest commits get tested + by the builds allowing any issues to be highlighted quickly. Poky easily + supports configurations where there is both a stable known good revision + and a floating revision to test. Poky can also only take changes from specific + source control branches giving another way it can be used to track/test only + specified changes. + </para> + <para> + Perhaps the hardest part of setting this up is the policy that surrounds + the different source control systems, be them software projects or the Poky + metadata itself. The circumstances will be different in each case but this is + one of Poky's advantages - the system itself doesn't force any particular policy + unlike a lot of build systems, allowing the best policy to be chosen for the + circumstances. + </para> + </section> </section> <section id='usingpoky-modifing-packages'> diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass index b7eb62c01..e801fd12a 100644 --- a/meta/classes/base.bbclass +++ b/meta/classes/base.bbclass @@ -946,108 +946,6 @@ addtask build after do_populate_staging do_build = "" do_build[func] = "1" -# Functions that update metadata based on files outputted -# during the build process. - -def explode_deps(s): - r = [] - l = s.split() - flag = False - for i in l: - if i[0] == '(': - flag = True - j = [] - if flag: - j.append(i) - if i.endswith(')'): - flag = False - r[-1] += ' ' + ' '.join(j) - else: - r.append(i) - return r - -def packaged(pkg, d): - import os, bb - return os.access(get_subpkgedata_fn(pkg, d) + '.packaged', os.R_OK) - -def read_pkgdatafile(fn): - pkgdata = {} - - def decode(str): - import codecs - c = codecs.getdecoder("string_escape") - return c(str)[0] - - 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: - pkgdata[m.group(1)] = decode(m.group(2)) - - return pkgdata - -def get_subpkgedata_fn(pkg, d): - import bb, os - archs = bb.data.expand("${PACKAGE_ARCHS}", d).split(" ") - archs.reverse() - pkgdata = bb.data.expand('${TMPDIR}/pkgdata/', d) - targetdir = bb.data.expand('${TARGET_VENDOR}-${TARGET_OS}/runtime/', d) - for arch in archs: - fn = pkgdata + arch + targetdir + pkg - if os.path.exists(fn): - return fn - return bb.data.expand('${PKGDATA_DIR}/runtime/%s' % pkg, d) - -def has_subpkgdata(pkg, d): - import bb, os - return os.access(get_subpkgedata_fn(pkg, d), os.R_OK) - -def read_subpkgdata(pkg, d): - import bb - return read_pkgdatafile(get_subpkgedata_fn(pkg, d)) - -def has_pkgdata(pn, d): - import bb, os - fn = bb.data.expand('${PKGDATA_DIR}/%s' % pn, d) - return os.access(fn, os.R_OK) - -def read_pkgdata(pn, d): - import bb - fn = bb.data.expand('${PKGDATA_DIR}/%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) -} - - -# -# Collapse FOO_pkg variables into FOO -# -def read_subpkgdata_dict(pkg, d): - import bb - ret = {} - subd = read_pkgdatafile(get_subpkgedata_fn(pkg, d)) - for var in subd: - newvar = var.replace("_" + pkg, "") - ret[newvar] = subd[var] - return ret - # Make sure MACHINE isn't exported # (breaks binutils at least) MACHINE[unexport] = "1" diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass index 1f136d78c..2b0c28477 100644 --- a/meta/classes/insane.bbclass +++ b/meta/classes/insane.bbclass @@ -439,7 +439,7 @@ def package_qa_check_rdepends(pkg, workdir, d): bb.data.update_data(localdata) # Now check the RDEPENDS - rdepends = explode_deps(bb.data.getVar('RDEPENDS', localdata, True) or "") + rdepends = bb.utils.explode_deps(bb.data.getVar('RDEPENDS', localdata, True) or "") # Now do the sanity check!!! diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass index 282315567..df870142f 100644 --- a/meta/classes/package.bbclass +++ b/meta/classes/package.bbclass @@ -2,6 +2,8 @@ # General packaging help functions # +inherit packagedata + PKGDEST = "${WORKDIR}/install" def legitimize_package_name(s): @@ -208,7 +210,7 @@ def runtime_mapping_rename (varname, d): #bb.note("%s before: %s" % (varname, bb.data.getVar(varname, d, 1))) new_depends = [] - for depend in explode_deps(bb.data.getVar(varname, d, 1) or ""): + for depend in bb.utils.explode_deps(bb.data.getVar(varname, d, 1) or ""): # Have to be careful with any version component of the depend split_depend = depend.split(' (') new_depend = get_package_mapping(split_depend[0].strip(), d) @@ -438,7 +440,7 @@ python populate_packages () { dangling_links[pkg].append(os.path.normpath(target)) for pkg in package_list: - rdepends = explode_deps(bb.data.getVar('RDEPENDS_' + pkg, d, 1) or bb.data.getVar('RDEPENDS', d, 1) or "") + rdepends = bb.utils.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)) @@ -868,7 +870,7 @@ python package_do_pkgconfig () { 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 "") + rdepends = bb.utils.explode_deps(bb.data.getVar('RDEPENDS_' + pkg, d, 0) or bb.data.getVar('RDEPENDS', d, 0) or "") for extension in ".shlibdeps", ".pcdeps", ".clilibdeps": depsfile = bb.data.expand("${PKGDEST}/" + pkg + extension, d) if os.access(depsfile, os.R_OK): @@ -901,7 +903,7 @@ python package_depchains() { def pkg_adddeprrecs(pkg, base, suffix, getname, depends, d): #bb.note('depends for %s is %s' % (base, depends)) - rreclist = explode_deps(bb.data.getVar('RRECOMMENDS_' + pkg, d, 1) or bb.data.getVar('RRECOMMENDS', d, 1) or "") + rreclist = bb.utils.explode_deps(bb.data.getVar('RRECOMMENDS_' + pkg, d, 1) or bb.data.getVar('RRECOMMENDS', d, 1) or "") for depend in depends: if depend.find('-native') != -1 or depend.find('-cross') != -1 or depend.startswith('virtual/'): @@ -922,7 +924,7 @@ python package_depchains() { def pkg_addrrecs(pkg, base, suffix, getname, rdepends, d): #bb.note('rdepends for %s is %s' % (base, rdepends)) - rreclist = explode_deps(bb.data.getVar('RRECOMMENDS_' + pkg, d, 1) or bb.data.getVar('RRECOMMENDS', d, 1) or "") + rreclist = bb.utils.explode_deps(bb.data.getVar('RRECOMMENDS_' + pkg, d, 1) or bb.data.getVar('RRECOMMENDS', d, 1) or "") for depend in rdepends: if depend.find('virtual-locale-') != -1: @@ -946,15 +948,15 @@ python package_depchains() { list.append(dep) depends = [] - for dep in explode_deps(bb.data.getVar('DEPENDS', d, 1) or ""): + for dep in bb.utils.explode_deps(bb.data.getVar('DEPENDS', d, 1) or ""): add_dep(depends, dep) rdepends = [] - for dep in explode_deps(bb.data.getVar('RDEPENDS', d, 1) or ""): + for dep in bb.utils.explode_deps(bb.data.getVar('RDEPENDS', d, 1) or ""): add_dep(rdepends, dep) for pkg in packages.split(): - for dep in explode_deps(bb.data.getVar('RDEPENDS_' + pkg, d, 1) or ""): + for dep in bb.utils.explode_deps(bb.data.getVar('RDEPENDS_' + pkg, d, 1) or ""): add_dep(rdepends, dep) #bb.note('rdepends is %s' % rdepends) @@ -987,7 +989,7 @@ python package_depchains() { pkg_addrrecs(pkg, base, suffix, func, rdepends, d) else: rdeps = [] - for dep in explode_deps(bb.data.getVar('RDEPENDS_' + base, d, 1) or bb.data.getVar('RDEPENDS', d, 1) or ""): + for dep in bb.utils.explode_deps(bb.data.getVar('RDEPENDS_' + base, d, 1) or bb.data.getVar('RDEPENDS', d, 1) or ""): add_dep(rdeps, dep) pkg_addrrecs(pkg, base, suffix, func, rdeps, d) } diff --git a/meta/classes/package_deb.bbclass b/meta/classes/package_deb.bbclass index 28e67fcc9..d90939fdb 100644 --- a/meta/classes/package_deb.bbclass +++ b/meta/classes/package_deb.bbclass @@ -194,9 +194,9 @@ python do_package_deb () { bb.build.exec_func("mapping_rename_hook", localdata) - rdepends = explode_deps(unicode(bb.data.getVar("RDEPENDS", localdata, 1) or "")) + rdepends = bb.utils.explode_deps(unicode(bb.data.getVar("RDEPENDS", localdata, 1) or "")) rdepends = [dep for dep in rdepends if not '*' in dep] - rrecommends = explode_deps(unicode(bb.data.getVar("RRECOMMENDS", localdata, 1) or "")) + rrecommends = bb.utils.explode_deps(unicode(bb.data.getVar("RRECOMMENDS", localdata, 1) or "")) rrecommends = [rec for rec in rrecommends if not '*' in rec] rsuggests = (unicode(bb.data.getVar("RSUGGESTS", localdata, 1) or "")).split() rprovides = (unicode(bb.data.getVar("RPROVIDES", localdata, 1) or "")).split() diff --git a/meta/classes/package_ipk.bbclass b/meta/classes/package_ipk.bbclass index c4f53046f..1aa2c814b 100644 --- a/meta/classes/package_ipk.bbclass +++ b/meta/classes/package_ipk.bbclass @@ -235,8 +235,8 @@ python do_package_ipk () { bb.build.exec_func("mapping_rename_hook", localdata) - rdepends = explode_deps(bb.data.getVar("RDEPENDS", localdata, 1) or "") - rrecommends = explode_deps(bb.data.getVar("RRECOMMENDS", localdata, 1) or "") + rdepends = bb.utils.explode_deps(bb.data.getVar("RDEPENDS", localdata, 1) or "") + rrecommends = bb.utils.explode_deps(bb.data.getVar("RRECOMMENDS", localdata, 1) or "") rsuggests = (bb.data.getVar("RSUGGESTS", localdata, 1) or "").split() rprovides = (bb.data.getVar("RPROVIDES", localdata, 1) or "").split() rreplaces = (bb.data.getVar("RREPLACES", localdata, 1) or "").split() diff --git a/meta/classes/packagedata.bbclass b/meta/classes/packagedata.bbclass new file mode 100644 index 000000000..c9d64d6da --- /dev/null +++ b/meta/classes/packagedata.bbclass @@ -0,0 +1,82 @@ +def packaged(pkg, d): + import os, bb + return os.access(get_subpkgedata_fn(pkg, d) + '.packaged', os.R_OK) + +def read_pkgdatafile(fn): + pkgdata = {} + + def decode(str): + import codecs + c = codecs.getdecoder("string_escape") + return c(str)[0] + + 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: + pkgdata[m.group(1)] = decode(m.group(2)) + + return pkgdata + +def get_subpkgedata_fn(pkg, d): + import bb, os + archs = bb.data.expand("${PACKAGE_ARCHS}", d).split(" ") + archs.reverse() + pkgdata = bb.data.expand('${TMPDIR}/pkgdata/', d) + targetdir = bb.data.expand('${TARGET_VENDOR}-${TARGET_OS}/runtime/', d) + for arch in archs: + fn = pkgdata + arch + targetdir + pkg + if os.path.exists(fn): + return fn + return bb.data.expand('${PKGDATA_DIR}/runtime/%s' % pkg, d) + +def has_subpkgdata(pkg, d): + import bb, os + return os.access(get_subpkgedata_fn(pkg, d), os.R_OK) + +def read_subpkgdata(pkg, d): + import bb + return read_pkgdatafile(get_subpkgedata_fn(pkg, d)) + +def has_pkgdata(pn, d): + import bb, os + fn = bb.data.expand('${PKGDATA_DIR}/%s' % pn, d) + return os.access(fn, os.R_OK) + +def read_pkgdata(pn, d): + import bb + fn = bb.data.expand('${PKGDATA_DIR}/%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) +} + + +# +# Collapse FOO_pkg variables into FOO +# +def read_subpkgdata_dict(pkg, d): + import bb + ret = {} + subd = read_pkgdatafile(get_subpkgedata_fn(pkg, d)) + for var in subd: + newvar = var.replace("_" + pkg, "") + ret[newvar] = subd[var] + return ret + diff --git a/meta/packages/libidl/libidl-native_0.8.3.bb b/meta/packages/libidl/libidl-native_0.8.12.bb index ce59fd4b8..ce59fd4b8 100644 --- a/meta/packages/libidl/libidl-native_0.8.3.bb +++ b/meta/packages/libidl/libidl-native_0.8.12.bb diff --git a/meta/packages/libidl/libidl_0.8.3.bb b/meta/packages/libidl/libidl_0.8.12.bb index ac10a2422..ac10a2422 100644 --- a/meta/packages/libidl/libidl_0.8.3.bb +++ b/meta/packages/libidl/libidl_0.8.12.bb diff --git a/meta/packages/xorg-xserver/xserver-xf86-dri-lite_1.6.0.bb b/meta/packages/xorg-xserver/xserver-xf86-dri-lite_1.6.0.bb new file mode 100644 index 000000000..8f5ed47d3 --- /dev/null +++ b/meta/packages/xorg-xserver/xserver-xf86-dri-lite_1.6.0.bb @@ -0,0 +1,15 @@ +require xserver-xf86-dri-lite.inc + +PE = "1" +PR = "r0" + +PROTO_DEPS += "xf86driproto" + +SRC_URI += "file://nodolt.patch;patch=1 \ + file://libdri-xinerama-symbol.patch;patch=1 \ + file://xserver-boottime.patch;patch=1" + +# Misc build failure for master HEAD +SRC_URI += "file://fix_open_max_preprocessor_error.patch;patch=1" + +EXTRA_OECONF += "--enable-dri --enable-dri2" |