backport USE_LDCONFIG and PACKAGE_SNAP_LIB_SYMLINKS from oe master
This is a backport of the corresponding package.bbclass functionality (which is needed by micro) from the openembedded tree. (From OE-Core rev: 600dbb7cb384c2290af38b993a9bea3a4dfc4494) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
parent
f93d6872f2
commit
f5cc1f2c03
|
@ -933,12 +933,17 @@ python package_do_shlibs() {
|
||||||
if m:
|
if m:
|
||||||
needed[pkg].append(m.group(1))
|
needed[pkg].append(m.group(1))
|
||||||
m = re.match("\s+SONAME\s+([^\s]*)", l)
|
m = re.match("\s+SONAME\s+([^\s]*)", l)
|
||||||
if m and not m.group(1) in sonames:
|
if m:
|
||||||
# if library is private (only used by package) then do not build shlib for it
|
this_soname = m.group(1)
|
||||||
if not private_libs or -1 == private_libs.find(m.group(1)):
|
if not this_soname in sonames:
|
||||||
sonames.append(m.group(1))
|
# if library is private (only used by package) then do not build shlib for it
|
||||||
if m and libdir_re.match(root):
|
if not private_libs or -1 == private_libs.find(this_soname):
|
||||||
needs_ldconfig = True
|
sonames.append(this_soname)
|
||||||
|
if libdir_re.match(root):
|
||||||
|
needs_ldconfig = True
|
||||||
|
if snap_symlinks and (file != this_soname):
|
||||||
|
renames.append((os.path.join(root, file), os.path.join(root, this_soname)))
|
||||||
|
|
||||||
def darwin_so(root, path, file):
|
def darwin_so(root, path, file):
|
||||||
fullpath = os.path.join(root, file)
|
fullpath = os.path.join(root, file)
|
||||||
if not os.path.exists(fullpath):
|
if not os.path.exists(fullpath):
|
||||||
|
@ -1000,6 +1005,17 @@ python package_do_shlibs() {
|
||||||
if name:
|
if name:
|
||||||
needed[pkg].append(name)
|
needed[pkg].append(name)
|
||||||
#bb.note("Adding %s for %s" % (name, pkg))
|
#bb.note("Adding %s for %s" % (name, pkg))
|
||||||
|
|
||||||
|
if bb.data.getVar('PACKAGE_SNAP_LIB_SYMLINKS', d, True) == "1":
|
||||||
|
snap_symlinks = True
|
||||||
|
else:
|
||||||
|
snap_symlinks = False
|
||||||
|
|
||||||
|
if (bb.data.getVar('USE_LDCONFIG', d, True) or "1") == "1":
|
||||||
|
use_ldconfig = True
|
||||||
|
else:
|
||||||
|
use_ldconfig = False
|
||||||
|
|
||||||
needed = {}
|
needed = {}
|
||||||
shlib_provider = {}
|
shlib_provider = {}
|
||||||
private_libs = bb.data.getVar('PRIVATE_LIBS', d, True)
|
private_libs = bb.data.getVar('PRIVATE_LIBS', d, True)
|
||||||
|
@ -1009,6 +1025,7 @@ python package_do_shlibs() {
|
||||||
|
|
||||||
needed[pkg] = []
|
needed[pkg] = []
|
||||||
sonames = list()
|
sonames = list()
|
||||||
|
renames = list()
|
||||||
top = os.path.join(pkgdest, pkg)
|
top = os.path.join(pkgdest, pkg)
|
||||||
for root, dirs, files in os.walk(top):
|
for root, dirs, files in os.walk(top):
|
||||||
for file in files:
|
for file in files:
|
||||||
|
@ -1020,6 +1037,9 @@ python package_do_shlibs() {
|
||||||
darwin_so(root, dirs, file)
|
darwin_so(root, dirs, file)
|
||||||
elif os.access(path, os.X_OK) or lib_re.match(file):
|
elif os.access(path, os.X_OK) or lib_re.match(file):
|
||||||
linux_so(root, dirs, file)
|
linux_so(root, dirs, file)
|
||||||
|
for (old, new) in renames:
|
||||||
|
bb.note("Renaming %s to %s" % (old, new))
|
||||||
|
os.rename(old, new)
|
||||||
shlibs_file = os.path.join(shlibswork_dir, pkg + ".list")
|
shlibs_file = os.path.join(shlibswork_dir, pkg + ".list")
|
||||||
shver_file = os.path.join(shlibswork_dir, pkg + ".ver")
|
shver_file = os.path.join(shlibswork_dir, pkg + ".ver")
|
||||||
if len(sonames):
|
if len(sonames):
|
||||||
|
@ -1031,7 +1051,7 @@ python package_do_shlibs() {
|
||||||
fd = open(shver_file, 'w')
|
fd = open(shver_file, 'w')
|
||||||
fd.write(ver + '\n')
|
fd.write(ver + '\n')
|
||||||
fd.close()
|
fd.close()
|
||||||
if needs_ldconfig:
|
if needs_ldconfig and use_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, True) or bb.data.getVar('pkg_postinst', d, True)
|
postinst = bb.data.getVar('pkg_postinst_%s' % pkg, d, True) or bb.data.getVar('pkg_postinst', d, True)
|
||||||
if not postinst:
|
if not postinst:
|
||||||
|
|
Loading…
Reference in New Issue