summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/classes/package.bbclass36
1 files changed, 19 insertions, 17 deletions
diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
index 7982c21b08..2168dbea7b 100644
--- a/meta/classes/package.bbclass
+++ b/meta/classes/package.bbclass
@@ -2,6 +2,8 @@
2# General packaging help functions 2# General packaging help functions
3# 3#
4 4
5PKGDEST = "${WORKDIR}/install"
6
5def legitimize_package_name(s): 7def legitimize_package_name(s):
6 """ 8 """
7 Make sure package names are legitimate strings 9 Make sure package names are legitimate strings
@@ -374,25 +376,21 @@ python populate_packages () {
374 if not os.path.islink(file) and not os.path.isdir(file) and isexec(file): 376 if not os.path.islink(file) and not os.path.isdir(file) and isexec(file):
375 runstrip(file, d) 377 runstrip(file, d)
376 378
379 pkgdest = bb.data.getVar('PKGDEST', d, 1)
380 os.system('rm -rf %s' % pkgdest)
381
377 for pkg in package_list: 382 for pkg in package_list:
378 localdata = bb.data.createCopy(d) 383 localdata = bb.data.createCopy(d)
379 root = os.path.join(workdir, "install", pkg) 384 root = os.path.join(pkgdest, pkg)
380 385 bb.mkdirhier(root)
381 os.system('rm -rf %s' % root)
382 386
383 bb.data.setVar('ROOT', '', localdata)
384 bb.data.setVar('ROOT_%s' % pkg, root, localdata)
385 bb.data.setVar('PKG', pkg, localdata) 387 bb.data.setVar('PKG', pkg, localdata)
386
387 overrides = bb.data.getVar('OVERRIDES', localdata, 1) 388 overrides = bb.data.getVar('OVERRIDES', localdata, 1)
388 if not overrides: 389 if not overrides:
389 raise bb.build.FuncFailed('OVERRIDES not defined') 390 raise bb.build.FuncFailed('OVERRIDES not defined')
390 bb.data.setVar('OVERRIDES', overrides+':'+pkg, localdata) 391 bb.data.setVar('OVERRIDES', overrides + ':' + pkg, localdata)
391
392 bb.data.update_data(localdata) 392 bb.data.update_data(localdata)
393 393
394 root = bb.data.getVar('ROOT', localdata, 1)
395 bb.mkdirhier(root)
396 filesvar = bb.data.getVar('FILES', localdata, 1) or "" 394 filesvar = bb.data.getVar('FILES', localdata, 1) or ""
397 files = filesvar.split() 395 files = filesvar.split()
398 for file in files: 396 for file in files:
@@ -445,7 +443,7 @@ python populate_packages () {
445 for pkg in package_list: 443 for pkg in package_list:
446 dangling_links[pkg] = [] 444 dangling_links[pkg] = []
447 pkg_files[pkg] = [] 445 pkg_files[pkg] = []
448 inst_root = os.path.join(workdir, "install", pkg) 446 inst_root = os.path.join(pkgdest, pkg)
449 for root, dirs, files in os.walk(inst_root): 447 for root, dirs, files in os.walk(inst_root):
450 for f in files: 448 for f in files:
451 path = os.path.join(root, f) 449 path = os.path.join(root, f)
@@ -566,6 +564,8 @@ python package_do_shlibs() {
566 bb.error("TARGET_SYS not defined") 564 bb.error("TARGET_SYS not defined")
567 return 565 return
568 566
567 pkgdest = bb.data.getVar('PKGDEST', d, 1)
568
569 shlibs_dir = os.path.join(staging, target_sys, "shlibs") 569 shlibs_dir = os.path.join(staging, target_sys, "shlibs")
570 old_shlibs_dir = os.path.join(staging, "shlibs") 570 old_shlibs_dir = os.path.join(staging, "shlibs")
571 bb.mkdirhier(shlibs_dir) 571 bb.mkdirhier(shlibs_dir)
@@ -577,7 +577,7 @@ python package_do_shlibs() {
577 577
578 needed[pkg] = [] 578 needed[pkg] = []
579 sonames = list() 579 sonames = list()
580 top = os.path.join(workdir, "install", pkg) 580 top = os.path.join(pkgdest, pkg)
581 for root, dirs, files in os.walk(top): 581 for root, dirs, files in os.walk(top):
582 for file in files: 582 for file in files:
583 soname = None 583 soname = None
@@ -660,7 +660,7 @@ python package_do_shlibs() {
660 else: 660 else:
661 bb.note("Couldn't find shared library provider for %s" % n) 661 bb.note("Couldn't find shared library provider for %s" % n)
662 662
663 deps_file = os.path.join(workdir, "install", pkg + ".shlibdeps") 663 deps_file = os.path.join(pkgdest, pkg + ".shlibdeps")
664 if os.path.exists(deps_file): 664 if os.path.exists(deps_file):
665 os.remove(deps_file) 665 os.remove(deps_file)
666 if len(deps): 666 if len(deps):
@@ -693,6 +693,8 @@ python package_do_pkgconfig () {
693 bb.error("TARGET_SYS not defined") 693 bb.error("TARGET_SYS not defined")
694 return 694 return
695 695
696 pkgdest = bb.data.getVar('PKGDEST', d, 1)
697
696 shlibs_dir = os.path.join(staging, target_sys, "shlibs") 698 shlibs_dir = os.path.join(staging, target_sys, "shlibs")
697 old_shlibs_dir = os.path.join(staging, "shlibs") 699 old_shlibs_dir = os.path.join(staging, "shlibs")
698 bb.mkdirhier(shlibs_dir) 700 bb.mkdirhier(shlibs_dir)
@@ -706,7 +708,7 @@ python package_do_pkgconfig () {
706 for pkg in packages.split(): 708 for pkg in packages.split():
707 pkgconfig_provided[pkg] = [] 709 pkgconfig_provided[pkg] = []
708 pkgconfig_needed[pkg] = [] 710 pkgconfig_needed[pkg] = []
709 top = os.path.join(workdir, "install", pkg) 711 top = os.path.join(pkgdest, pkg)
710 for root, dirs, files in os.walk(top): 712 for root, dirs, files in os.walk(top):
711 for file in files: 713 for file in files:
712 m = pc_re.match(file) 714 m = pc_re.match(file)
@@ -769,7 +771,7 @@ python package_do_pkgconfig () {
769 found = True 771 found = True
770 if found == False: 772 if found == False:
771 bb.note("couldn't find pkgconfig module '%s' in any package" % n) 773 bb.note("couldn't find pkgconfig module '%s' in any package" % n)
772 deps_file = os.path.join(workdir, "install", pkg + ".pcdeps") 774 deps_file = os.path.join(pkgdest, pkg + ".pcdeps")
773 if os.path.exists(deps_file): 775 if os.path.exists(deps_file):
774 os.remove(deps_file) 776 os.remove(deps_file)
775 if len(deps): 777 if len(deps):
@@ -783,14 +785,14 @@ python read_shlibdeps () {
783 packages = (bb.data.getVar('PACKAGES', d, 1) or "").split() 785 packages = (bb.data.getVar('PACKAGES', d, 1) or "").split()
784 for pkg in packages: 786 for pkg in packages:
785 rdepends = explode_deps(bb.data.getVar('RDEPENDS_' + pkg, d, 0) or bb.data.getVar('RDEPENDS', d, 0) or "") 787 rdepends = explode_deps(bb.data.getVar('RDEPENDS_' + pkg, d, 0) or bb.data.getVar('RDEPENDS', d, 0) or "")
786 shlibsfile = bb.data.expand("${WORKDIR}/install/" + pkg + ".shlibdeps", d) 788 shlibsfile = bb.data.expand("${PKGDEST}/" + pkg + ".shlibdeps", d)
787 if os.access(shlibsfile, os.R_OK): 789 if os.access(shlibsfile, os.R_OK):
788 fd = file(shlibsfile) 790 fd = file(shlibsfile)
789 lines = fd.readlines() 791 lines = fd.readlines()
790 fd.close() 792 fd.close()
791 for l in lines: 793 for l in lines:
792 rdepends.append(l.rstrip()) 794 rdepends.append(l.rstrip())
793 pcfile = bb.data.expand("${WORKDIR}/install/" + pkg + ".pcdeps", d) 795 pcfile = bb.data.expand("${PKGDEST}/" + pkg + ".pcdeps", d)
794 if os.access(pcfile, os.R_OK): 796 if os.access(pcfile, os.R_OK):
795 fd = file(pcfile) 797 fd = file(pcfile)
796 lines = fd.readlines() 798 lines = fd.readlines()