summaryrefslogtreecommitdiff
path: root/classes/package.bbclass
diff options
context:
space:
mode:
Diffstat (limited to 'classes/package.bbclass')
-rw-r--r--classes/package.bbclass55
1 files changed, 22 insertions, 33 deletions
diff --git a/classes/package.bbclass b/classes/package.bbclass
index fe48ec6afd..5233fa363c 100644
--- a/classes/package.bbclass
+++ b/classes/package.bbclass
@@ -2,6 +2,8 @@
# General packaging help functions
#
+PKGDEST = "${WORKDIR}/install"
+
def legitimize_package_name(s):
"""
Make sure package names are legitimate strings
@@ -120,18 +122,12 @@ PACKAGE_DEPENDS += "file-native"
python () {
import bb
-
if bb.data.getVar('PACKAGES', d, True) != '':
deps = bb.data.getVarFlag('do_package', 'depends', d) or ""
for dep in (bb.data.getVar('PACKAGE_DEPENDS', d, True) or "").split():
deps += " %s:do_populate_staging" % dep
bb.data.setVarFlag('do_package', 'depends', deps, d)
- deps = bb.data.getVarFlag('do_package_write', 'depends', d) or ""
- for dep in (bb.data.getVar('PACKAGE_EXTRA_DEPENDS', d, True) or "").split():
- deps += " %s:do_populate_staging" % dep
- bb.data.setVarFlag('do_package_write', 'depends', deps, d)
-
# shlibs requires any DEPENDS to have already packaged for the *.list files
bb.data.setVarFlag('do_package', 'deptask', 'do_package', d)
}
@@ -380,25 +376,21 @@ python populate_packages () {
if not os.path.islink(file) and not os.path.isdir(file) and isexec(file):
runstrip(file, d)
+ pkgdest = bb.data.getVar('PKGDEST', d, 1)
+ os.system('rm -rf %s' % pkgdest)
+
for pkg in package_list:
localdata = bb.data.createCopy(d)
- root = os.path.join(workdir, "install", pkg)
-
- os.system('rm -rf %s' % root)
+ root = os.path.join(pkgdest, pkg)
+ bb.mkdirhier(root)
- bb.data.setVar('ROOT', '', localdata)
- bb.data.setVar('ROOT_%s' % pkg, root, localdata)
bb.data.setVar('PKG', pkg, 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.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()
for file in files:
@@ -451,7 +443,7 @@ python populate_packages () {
for pkg in package_list:
dangling_links[pkg] = []
pkg_files[pkg] = []
- inst_root = os.path.join(workdir, "install", pkg)
+ inst_root = os.path.join(pkgdest, pkg)
for root, dirs, files in os.walk(inst_root):
for f in files:
path = os.path.join(root, f)
@@ -572,6 +564,8 @@ python package_do_shlibs() {
bb.error("TARGET_SYS not defined")
return
+ pkgdest = bb.data.getVar('PKGDEST', d, 1)
+
shlibs_dir = os.path.join(staging, target_sys, "shlibs")
old_shlibs_dir = os.path.join(staging, "shlibs")
bb.mkdirhier(shlibs_dir)
@@ -584,7 +578,7 @@ python package_do_shlibs() {
needed[pkg] = []
sonames = list()
- top = os.path.join(workdir, "install", pkg)
+ top = os.path.join(pkgdest, pkg)
for root, dirs, files in os.walk(top):
for file in files:
soname = None
@@ -670,7 +664,7 @@ 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")
+ deps_file = os.path.join(pkgdest, pkg + ".shlibdeps")
if os.path.exists(deps_file):
os.remove(deps_file)
if len(deps):
@@ -703,6 +697,8 @@ python package_do_pkgconfig () {
bb.error("TARGET_SYS not defined")
return
+ pkgdest = bb.data.getVar('PKGDEST', d, 1)
+
shlibs_dir = os.path.join(staging, target_sys, "shlibs")
old_shlibs_dir = os.path.join(staging, "shlibs")
bb.mkdirhier(shlibs_dir)
@@ -716,7 +712,7 @@ python package_do_pkgconfig () {
for pkg in packages.split():
pkgconfig_provided[pkg] = []
pkgconfig_needed[pkg] = []
- top = os.path.join(workdir, "install", pkg)
+ top = os.path.join(pkgdest, pkg)
for root, dirs, files in os.walk(top):
for file in files:
m = pc_re.match(file)
@@ -779,7 +775,7 @@ python package_do_pkgconfig () {
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")
+ deps_file = os.path.join(pkgdest, pkg + ".pcdeps")
if os.path.exists(deps_file):
os.remove(deps_file)
if len(deps):
@@ -793,14 +789,14 @@ python read_shlibdeps () {
packages = (bb.data.getVar('PACKAGES', d, 1) or "").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("${WORKDIR}/install/" + pkg + ".shlibdeps", d)
+ 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("${WORKDIR}/install/" + pkg + ".pcdeps", d)
+ pcfile = bb.data.expand("${PKGDEST}/" + pkg + ".pcdeps", d)
if os.access(pcfile, os.R_OK):
fd = file(pcfile)
lines = fd.readlines()
@@ -906,21 +902,14 @@ python package_do_package () {
do_package[dirs] = "${D}"
addtask package before do_build after do_install
-
-
-PACKAGE_WRITE_FUNCS ?= "read_subpackage_metadata"
-
-python package_do_package_write () {
- for f in (bb.data.getVar('PACKAGE_WRITE_FUNCS', d, 1) or '').split():
- bb.build.exec_func(f, d)
+# Dummy task to mark when all packaging is complete
+do_package_write () {
+ :
}
-do_package_write[dirs] = "${D}"
addtask package_write before do_build after do_package
-
EXPORT_FUNCTIONS do_package do_package_write
-
#
# Helper functions for the package writing classes
#