1
0
mirror of https://git.yoctoproject.org/poky synced 2026-06-02 13:29:49 +00:00

package.bbclass: Sync with OE.dev

git-svn-id: https://svn.o-hand.com/repos/poky/trunk@4062 311d38ba-8fff-0310-9ca6-ca027cbcb966
This commit is contained in:
Richard Purdie
2008-03-19 16:05:35 +00:00
parent 75d9692ecc
commit 7c097c7812
+49 -8
View File
@@ -152,7 +152,7 @@ def runstrip(file, d):
# If the file is in a .debug directory it was already stripped, # If the file is in a .debug directory it was already stripped,
# don't do it again... # don't do it again...
if os.path.dirname(file).endswith(".debug"): if os.path.dirname(file).endswith(".debug"):
bb.note("Already run strip") bb.note("Already ran strip")
return 0 return 0
strip = bb.data.getVar("STRIP", d, 1) strip = bb.data.getVar("STRIP", d, 1)
@@ -472,25 +472,31 @@ python emit_pkgdata() {
if val: if val:
f.write('%s_%s: %s\n' % (var, pkg, encode(val))) f.write('%s_%s: %s\n' % (var, pkg, encode(val)))
packages = bb.data.getVar('PACKAGES', d, 1) packages = bb.data.getVar('PACKAGES', d, True)
pkgdatadir = bb.data.getVar('PKGDATA_DIR', d, True)
data_file = bb.data.expand("${PKGDATA_DIR}/${PN}", d) pstageactive = bb.data.getVar('PSTAGING_ACTIVE', d, True)
if pstageactive == "1":
lf = bb.utils.lockfile(bb.data.expand("${STAGING_DIR}/staging.lock", d))
data_file = pkgdatadir + bb.data.expand("/${PN}" , d)
f = open(data_file, 'w') f = open(data_file, 'w')
f.write("PACKAGES: %s\n" % packages) f.write("PACKAGES: %s\n" % packages)
f.close() f.close()
package_stagefile(data_file, d)
workdir = bb.data.getVar('WORKDIR', d, 1) workdir = bb.data.getVar('WORKDIR', d, 1)
for pkg in packages.split(): for pkg in packages.split():
subdata_file = bb.data.expand("${PKGDATA_DIR}/runtime/%s" % pkg, d) subdata_file = pkgdatadir + "/runtime/%s" % pkg
sf = open(subdata_file, 'w') sf = open(subdata_file, 'w')
write_if_exists(sf, pkg, 'PN') write_if_exists(sf, pkg, 'PN')
write_if_exists(sf, pkg, 'PR')
write_if_exists(sf, pkg, 'DESCRIPTION') write_if_exists(sf, pkg, 'DESCRIPTION')
write_if_exists(sf, pkg, 'RDEPENDS') write_if_exists(sf, pkg, 'RDEPENDS')
write_if_exists(sf, pkg, 'RPROVIDES') write_if_exists(sf, pkg, 'RPROVIDES')
write_if_exists(sf, pkg, 'RRECOMMENDS') write_if_exists(sf, pkg, 'RRECOMMENDS')
write_if_exists(sf, pkg, 'RSUGGESTS') write_if_exists(sf, pkg, 'RSUGGESTS')
write_if_exists(sf, pkg, 'RPROVIDES')
write_if_exists(sf, pkg, 'RREPLACES') write_if_exists(sf, pkg, 'RREPLACES')
write_if_exists(sf, pkg, 'RCONFLICTS') write_if_exists(sf, pkg, 'RCONFLICTS')
write_if_exists(sf, pkg, 'PKG') write_if_exists(sf, pkg, 'PKG')
@@ -502,6 +508,10 @@ python emit_pkgdata() {
write_if_exists(sf, pkg, 'pkg_prerm') write_if_exists(sf, pkg, 'pkg_prerm')
sf.close() sf.close()
package_stagefile(subdata_file, d)
#if pkgdatadir2:
# bb.copyfile(subdata_file, pkgdatadir2 + "/runtime/%s" % pkg)
allow_empty = bb.data.getVar('ALLOW_EMPTY_%s' % pkg, d, 1) allow_empty = bb.data.getVar('ALLOW_EMPTY_%s' % pkg, d, 1)
if not allow_empty: if not allow_empty:
allow_empty = bb.data.getVar('ALLOW_EMPTY', d, 1) allow_empty = bb.data.getVar('ALLOW_EMPTY', d, 1)
@@ -509,18 +519,21 @@ python emit_pkgdata() {
os.chdir(root) os.chdir(root)
g = glob('*') g = glob('*')
if g or allow_empty == "1": if g or allow_empty == "1":
packagedfile = bb.data.expand('${PKGDATA_DIR}/runtime/%s.packaged' % pkg, d) packagedfile = pkgdatadir + '/runtime/%s.packaged' % pkg
file(packagedfile, 'w').close() file(packagedfile, 'w').close()
package_stagefile(packagedfile, d)
if pstageactive == "1":
bb.utils.unlockfile(lf)
} }
emit_pkgdata[dirs] = "${PKGDATA_DIR}/runtime" emit_pkgdata[dirs] = "${PKGDATA_DIR}/runtime"
ldconfig_postinst_fragment() { ldconfig_postinst_fragment() {
if [ x"$D" = "x" ]; then if [ x"$D" = "x" ]; then
ldconfig [ -x /sbin/ldconfig ] && /sbin/ldconfig
fi fi
} }
SHLIBSDIR = "${STAGING_DIR}/${HOST_SYS}/shlibs" SHLIBSDIR = "${STAGING_DIR_HOST}/shlibs"
python package_do_shlibs() { python package_do_shlibs() {
import os, re, os.path import os, re, os.path
@@ -550,6 +563,10 @@ python package_do_shlibs() {
shlibs_dir = bb.data.getVar('SHLIBSDIR', d, 1) shlibs_dir = bb.data.getVar('SHLIBSDIR', d, 1)
bb.mkdirhier(shlibs_dir) bb.mkdirhier(shlibs_dir)
pstageactive = bb.data.getVar('PSTAGING_ACTIVE', d, True)
if pstageactive == "1":
lf = bb.utils.lockfile(bb.data.expand("${STAGING_DIR}/staging.lock", d))
needed = {} needed = {}
private_libs = bb.data.getVar('PRIVATE_LIBS', d, 1) private_libs = bb.data.getVar('PRIVATE_LIBS', d, 1)
for pkg in packages.split(): for pkg in packages.split():
@@ -591,9 +608,11 @@ python package_do_shlibs() {
for s in sonames: for s in sonames:
fd.write(s + '\n') fd.write(s + '\n')
fd.close() fd.close()
package_stagefile(shlibs_file, d)
fd = open(shver_file, 'w') fd = open(shver_file, 'w')
fd.write(ver + '\n') fd.write(ver + '\n')
fd.close() fd.close()
package_stagefile(shver_file, d)
if needs_ldconfig: if needs_ldconfig:
bb.debug(1, 'adding ldconfig call to postinst for %s' % pkg) bb.debug(1, 'adding ldconfig call to postinst for %s' % pkg)
postinst = bb.data.getVar('pkg_postinst_%s' % pkg, d, 1) or bb.data.getVar('pkg_postinst', d, 1) postinst = bb.data.getVar('pkg_postinst_%s' % pkg, d, 1) or bb.data.getVar('pkg_postinst', d, 1)
@@ -602,6 +621,9 @@ python package_do_shlibs() {
postinst += bb.data.getVar('ldconfig_postinst_fragment', d, 1) postinst += bb.data.getVar('ldconfig_postinst_fragment', d, 1)
bb.data.setVar('pkg_postinst_%s' % pkg, postinst, d) bb.data.setVar('pkg_postinst_%s' % pkg, postinst, d)
if pstageactive == "1":
bb.utils.unlockfile(lf)
shlib_provider = {} shlib_provider = {}
list_re = re.compile('^(.*)\.list$') list_re = re.compile('^(.*)\.list$')
for dir in [shlibs_dir]: for dir in [shlibs_dir]:
@@ -623,6 +645,16 @@ python package_do_shlibs() {
for l in lines: for l in lines:
shlib_provider[l.rstrip()] = (dep_pkg, lib_ver) shlib_provider[l.rstrip()] = (dep_pkg, lib_ver)
assumed_libs = bb.data.getVar('ASSUME_SHLIBS', d, 1)
if assumed_libs:
for e in assumed_libs.split():
l, dep_pkg = e.split(":")
lib_ver = None
dep_pkg = dep_pkg.rsplit("_", 1)
if len(dep_pkg) == 2:
lib_ver = dep_pkg[1]
dep_pkg = dep_pkg[0]
shlib_provider[l] = (dep_pkg, lib_ver)
for pkg in packages.split(): for pkg in packages.split():
bb.debug(2, "calculating shlib requirements for %s" % pkg) bb.debug(2, "calculating shlib requirements for %s" % pkg)
@@ -706,6 +738,10 @@ python package_do_pkgconfig () {
if hdr == 'Requires': if hdr == 'Requires':
pkgconfig_needed[pkg] += exp.replace(',', ' ').split() pkgconfig_needed[pkg] += exp.replace(',', ' ').split()
pstageactive = bb.data.getVar('PSTAGING_ACTIVE', d, True)
if pstageactive == "1":
lf = bb.utils.lockfile(bb.data.expand("${STAGING_DIR}/staging.lock", d))
for pkg in packages.split(): for pkg in packages.split():
pkgs_file = os.path.join(shlibs_dir, pkg + ".pclist") pkgs_file = os.path.join(shlibs_dir, pkg + ".pclist")
if os.path.exists(pkgs_file): if os.path.exists(pkgs_file):
@@ -715,6 +751,7 @@ python package_do_pkgconfig () {
for p in pkgconfig_provided[pkg]: for p in pkgconfig_provided[pkg]:
f.write('%s\n' % p) f.write('%s\n' % p)
f.close() f.close()
package_stagefile(pkgs_file, d)
for dir in [shlibs_dir]: for dir in [shlibs_dir]:
if not os.path.exists(dir): if not os.path.exists(dir):
@@ -749,6 +786,10 @@ python package_do_pkgconfig () {
for dep in deps: for dep in deps:
fd.write(dep + '\n') fd.write(dep + '\n')
fd.close() fd.close()
package_stagefile(deps_file, d)
if pstageactive == "1":
bb.utils.unlockfile(lf)
} }
python read_shlibdeps () { python read_shlibdeps () {