summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/classes/package.bbclass43
1 files changed, 21 insertions, 22 deletions
diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
index 5b1a7cf28a..4d9553d693 100644
--- a/meta/classes/package.bbclass
+++ b/meta/classes/package.bbclass
@@ -385,8 +385,9 @@ python populate_packages () {
385 if file in seen: 385 if file in seen:
386 continue 386 continue
387 seen.append(file) 387 seen.append(file)
388 if os.path.isdir(file): 388 if os.path.isdir(file) and not os.path.islink(file):
389 bb.mkdirhier(os.path.join(root,file)) 389 bb.mkdirhier(os.path.join(root,file))
390 os.chmod(os.path.join(root,file), os.stat(file).st_mode)
390 continue 391 continue
391 fpath = os.path.join(root,file) 392 fpath = os.path.join(root,file)
392 dpath = os.path.dirname(fpath) 393 dpath = os.path.dirname(fpath)
@@ -501,11 +502,14 @@ python emit_pkgdata() {
501 sf.close() 502 sf.close()
502 503
503 allow_empty = bb.data.getVar('ALLOW_EMPTY_%s' % pkg, d, 1) 504 allow_empty = bb.data.getVar('ALLOW_EMPTY_%s' % pkg, d, 1)
505 if not allow_empty:
506 allow_empty = bb.data.getVar('ALLOW_EMPTY', d, 1)
504 root = "%s/install/%s" % (workdir, pkg) 507 root = "%s/install/%s" % (workdir, pkg)
505 os.chdir(root) 508 os.chdir(root)
506 g = glob('*') 509 g = glob('*')
507 if g or allow_empty == "1": 510 if g or allow_empty == "1":
508 file(bb.data.expand('${PKGDATA_DIR}/runtime/%s.packaged' % pkg, d), 'w').close() 511 packagedfile = bb.data.expand('${PKGDATA_DIR}/runtime/%s.packaged' % pkg, d)
512 file(packagedfile, 'w').close()
509} 513}
510emit_pkgdata[dirs] = "${PKGDATA_DIR}/runtime" 514emit_pkgdata[dirs] = "${PKGDATA_DIR}/runtime"
511 515
@@ -555,6 +559,7 @@ python package_do_shlibs() {
555 bb.mkdirhier(shlibs_dir) 559 bb.mkdirhier(shlibs_dir)
556 560
557 needed = {} 561 needed = {}
562 private_libs = bb.data.getVar('PRIVATE_LIBS', d, 1)
558 for pkg in packages.split(): 563 for pkg in packages.split():
559 needs_ldconfig = False 564 needs_ldconfig = False
560 bb.debug(2, "calculating shlib provides for %s" % pkg) 565 bb.debug(2, "calculating shlib provides for %s" % pkg)
@@ -567,7 +572,8 @@ python package_do_shlibs() {
567 soname = None 572 soname = None
568 path = os.path.join(root, file) 573 path = os.path.join(root, file)
569 if os.access(path, os.X_OK) or lib_re.match(file): 574 if os.access(path, os.X_OK) or lib_re.match(file):
570 cmd = (bb.data.getVar('BUILD_PREFIX', d, 1) or "") + "objdump -p " + path + " 2>/dev/null" 575 cmd = bb.data.getVar('OBJDUMP', d, 1) + " -p " + path + " 2>/dev/null"
576 cmd = "PATH=\"%s\" %s" % (bb.data.getVar('PATH', d, 1), cmd)
571 fd = os.popen(cmd) 577 fd = os.popen(cmd)
572 lines = fd.readlines() 578 lines = fd.readlines()
573 fd.close() 579 fd.close()
@@ -577,7 +583,9 @@ python package_do_shlibs() {
577 needed[pkg].append(m.group(1)) 583 needed[pkg].append(m.group(1))
578 m = re.match("\s+SONAME\s+([^\s]*)", l) 584 m = re.match("\s+SONAME\s+([^\s]*)", l)
579 if m and not m.group(1) in sonames: 585 if m and not m.group(1) in sonames:
580 sonames.append(m.group(1)) 586 # if library is private (only used by package) then do not build shlib for it
587 if not private_libs or -1 == private_libs.find(m.group(1)):
588 sonames.append(m.group(1))
581 if m and libdir_re.match(root): 589 if m and libdir_re.match(root):
582 needs_ldconfig = True 590 needs_ldconfig = True
583 shlibs_file = os.path.join(shlibs_dir, pkg + ".list") 591 shlibs_file = os.path.join(shlibs_dir, pkg + ".list")
@@ -766,20 +774,14 @@ python read_shlibdeps () {
766 packages = bb.data.getVar('PACKAGES', d, 1).split() 774 packages = bb.data.getVar('PACKAGES', d, 1).split()
767 for pkg in packages: 775 for pkg in packages:
768 rdepends = explode_deps(bb.data.getVar('RDEPENDS_' + pkg, d, 0) or bb.data.getVar('RDEPENDS', d, 0) or "") 776 rdepends = explode_deps(bb.data.getVar('RDEPENDS_' + pkg, d, 0) or bb.data.getVar('RDEPENDS', d, 0) or "")
769 shlibsfile = bb.data.expand("${PKGDEST}/" + pkg + ".shlibdeps", d) 777 for extension in ".shlibdeps", ".pcdeps", ".clilibdeps":
770 if os.access(shlibsfile, os.R_OK): 778 depsfile = bb.data.expand("${PKGDEST}/" + pkg + extension, d)
771 fd = file(shlibsfile) 779 if os.access(depsfile, os.R_OK):
772 lines = fd.readlines() 780 fd = file(depsfile)
773 fd.close() 781 lines = fd.readlines()
774 for l in lines: 782 fd.close()
775 rdepends.append(l.rstrip()) 783 for l in lines:
776 pcfile = bb.data.expand("${PKGDEST}/" + pkg + ".pcdeps", d) 784 rdepends.append(l.rstrip())
777 if os.access(pcfile, os.R_OK):
778 fd = file(pcfile)
779 lines = fd.readlines()
780 fd.close()
781 for l in lines:
782 rdepends.append(l.rstrip())
783 bb.data.setVar('RDEPENDS_' + pkg, " " + " ".join(rdepends), d) 785 bb.data.setVar('RDEPENDS_' + pkg, " " + " ".join(rdepends), d)
784} 786}
785 787
@@ -802,10 +804,7 @@ python package_depchains() {
802 prefixes = (bb.data.getVar('DEPCHAIN_PRE', d, 1) or '').split() 804 prefixes = (bb.data.getVar('DEPCHAIN_PRE', d, 1) or '').split()
803 805
804 def pkg_addrrecs(pkg, base, suffix, getname, rdepends, d): 806 def pkg_addrrecs(pkg, base, suffix, getname, rdepends, d):
805 #def packaged(pkg, d): 807 #bb.note('rdepends for %s is %s' % (base, rdepends))
806 # return os.access(bb.data.expand('${PKGDATA_DIR}/runtime/%s.packaged' % pkg, d), os.R_OK)
807
808 #bb.note('rdepends for %s is %s' % (base, rdepends))
809 808
810 rreclist = explode_deps(bb.data.getVar('RRECOMMENDS_' + pkg, d, 1) or bb.data.getVar('RRECOMMENDS', d, 1) or "") 809 rreclist = explode_deps(bb.data.getVar('RRECOMMENDS_' + pkg, d, 1) or bb.data.getVar('RRECOMMENDS', d, 1) or "")
811 810