diff options
-rw-r--r-- | meta/classes/package.bbclass | 31 |
1 files changed, 11 insertions, 20 deletions
diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass index bc91e9f866..d7de72bda3 100644 --- a/meta/classes/package.bbclass +++ b/meta/classes/package.bbclass | |||
@@ -1326,8 +1326,8 @@ python package_do_filedeps() { | |||
1326 | d.setVar("FILERPROVIDESFLIST_" + pkg, " ".join(provides_files[pkg])) | 1326 | d.setVar("FILERPROVIDESFLIST_" + pkg, " ".join(provides_files[pkg])) |
1327 | } | 1327 | } |
1328 | 1328 | ||
1329 | SHLIBSDIRS = "${PKGDATA_DIR}/${MLPREFIX}shlibs" | 1329 | SHLIBSDIRS = "${PKGDATA_DIR}/${MLPREFIX}shlibs2" |
1330 | SHLIBSWORKDIR = "${PKGDESTWORK}/${MLPREFIX}shlibs" | 1330 | SHLIBSWORKDIR = "${PKGDESTWORK}/${MLPREFIX}shlibs2" |
1331 | 1331 | ||
1332 | python package_do_shlibs() { | 1332 | python package_do_shlibs() { |
1333 | import re, pipes | 1333 | import re, pipes |
@@ -1373,16 +1373,11 @@ python package_do_shlibs() { | |||
1373 | fd = open(os.path.join(dir, file)) | 1373 | fd = open(os.path.join(dir, file)) |
1374 | lines = fd.readlines() | 1374 | lines = fd.readlines() |
1375 | fd.close() | 1375 | fd.close() |
1376 | ver_file = os.path.join(dir, dep_pkg + '.ver') | ||
1377 | lib_ver = None | ||
1378 | if os.path.exists(ver_file): | ||
1379 | fd = open(ver_file) | ||
1380 | lib_ver = fd.readline().rstrip() | ||
1381 | fd.close() | ||
1382 | for l in lines: | 1376 | for l in lines: |
1383 | shlib_provider[l.rstrip()] = (dep_pkg, lib_ver) | 1377 | s = l.strip().split(":") |
1378 | shlib_provider[s[0]] = (dep_pkg, s[2]) | ||
1384 | 1379 | ||
1385 | def linux_so(file, needed, sonames, renames): | 1380 | def linux_so(file, needed, sonames, renames, pkgver): |
1386 | needs_ldconfig = False | 1381 | needs_ldconfig = False |
1387 | ldir = os.path.dirname(file).replace(pkgdest + "/" + pkg, '') | 1382 | ldir = os.path.dirname(file).replace(pkgdest + "/" + pkg, '') |
1388 | cmd = d.getVar('OBJDUMP', True) + " -p " + pipes.quote(file) + " 2>/dev/null" | 1383 | cmd = d.getVar('OBJDUMP', True) + " -p " + pipes.quote(file) + " 2>/dev/null" |
@@ -1404,7 +1399,7 @@ python package_do_shlibs() { | |||
1404 | m = re.match("\s+SONAME\s+([^\s]*)", l) | 1399 | m = re.match("\s+SONAME\s+([^\s]*)", l) |
1405 | if m: | 1400 | if m: |
1406 | this_soname = m.group(1) | 1401 | this_soname = m.group(1) |
1407 | prov = (this_soname, ldir) | 1402 | prov = (this_soname, ldir, pkgver) |
1408 | if not prov in sonames: | 1403 | if not prov in sonames: |
1409 | # if library is private (only used by package) then do not build shlib for it | 1404 | # if library is private (only used by package) then do not build shlib for it |
1410 | if not private_libs or this_soname not in private_libs: | 1405 | if not private_libs or this_soname not in private_libs: |
@@ -1415,7 +1410,7 @@ python package_do_shlibs() { | |||
1415 | renames.append((file, os.path.join(os.path.dirname(file), this_soname))) | 1410 | renames.append((file, os.path.join(os.path.dirname(file), this_soname))) |
1416 | return needs_ldconfig | 1411 | return needs_ldconfig |
1417 | 1412 | ||
1418 | def darwin_so(file, needed, sonames, renames): | 1413 | def darwin_so(file, needed, sonames, renames, pkgver): |
1419 | if not os.path.exists(file): | 1414 | if not os.path.exists(file): |
1420 | return | 1415 | return |
1421 | ldir = os.path.dirname(file).replace(pkgdest, '') | 1416 | ldir = os.path.dirname(file).replace(pkgdest, '') |
@@ -1440,7 +1435,7 @@ python package_do_shlibs() { | |||
1440 | combos = get_combinations(name) | 1435 | combos = get_combinations(name) |
1441 | for combo in combos: | 1436 | for combo in combos: |
1442 | if not combo in sonames: | 1437 | if not combo in sonames: |
1443 | prov = (combo, ldir) | 1438 | prov = (combo, ldir, pkgver) |
1444 | sonames.append(prov) | 1439 | sonames.append(prov) |
1445 | if file.endswith('.dylib') or file.endswith('.so'): | 1440 | if file.endswith('.dylib') or file.endswith('.so'): |
1446 | lafile = file.replace(os.path.join(pkgdest, pkg), d.getVar('PKGD', True)) | 1441 | lafile = file.replace(os.path.join(pkgdest, pkg), d.getVar('PKGD', True)) |
@@ -1510,9 +1505,9 @@ python package_do_shlibs() { | |||
1510 | if cpath.islink(file): | 1505 | if cpath.islink(file): |
1511 | continue | 1506 | continue |
1512 | if targetos == "darwin" or targetos == "darwin8": | 1507 | if targetos == "darwin" or targetos == "darwin8": |
1513 | darwin_so(file, needed, sonames, renames) | 1508 | darwin_so(file, needed, sonames, renames, pkgver) |
1514 | elif os.access(file, os.X_OK) or lib_re.match(file): | 1509 | elif os.access(file, os.X_OK) or lib_re.match(file): |
1515 | ldconfig = linux_so(file, needed, sonames, renames) | 1510 | ldconfig = linux_so(file, needed, sonames, renames, pkgver) |
1516 | needs_ldconfig = needs_ldconfig or ldconfig | 1511 | needs_ldconfig = needs_ldconfig or ldconfig |
1517 | for (old, new) in renames: | 1512 | for (old, new) in renames: |
1518 | bb.note("Renaming %s to %s" % (old, new)) | 1513 | bb.note("Renaming %s to %s" % (old, new)) |
@@ -1520,7 +1515,6 @@ python package_do_shlibs() { | |||
1520 | pkgfiles[pkg].remove(old) | 1515 | pkgfiles[pkg].remove(old) |
1521 | 1516 | ||
1522 | shlibs_file = os.path.join(shlibswork_dir, pkg + ".list") | 1517 | shlibs_file = os.path.join(shlibswork_dir, pkg + ".list") |
1523 | shver_file = os.path.join(shlibswork_dir, pkg + ".ver") | ||
1524 | if len(sonames): | 1518 | if len(sonames): |
1525 | fd = open(shlibs_file, 'w') | 1519 | fd = open(shlibs_file, 'w') |
1526 | for s in sonames: | 1520 | for s in sonames: |
@@ -1529,12 +1523,9 @@ python package_do_shlibs() { | |||
1529 | if old_pkg != pkg: | 1523 | if old_pkg != pkg: |
1530 | bb.warn('%s-%s was registered as shlib provider for %s, changing it to %s-%s because it was built later' % (old_pkg, old_pkgver, s[0], pkg, pkgver)) | 1524 | bb.warn('%s-%s was registered as shlib provider for %s, changing it to %s-%s because it was built later' % (old_pkg, old_pkgver, s[0], pkg, pkgver)) |
1531 | bb.debug(1, 'registering %s-%s as shlib provider for %s' % (pkg, pkgver, s[0])) | 1525 | bb.debug(1, 'registering %s-%s as shlib provider for %s' % (pkg, pkgver, s[0])) |
1532 | fd.write(s[0] + '\n') | 1526 | fd.write(s[0] + ':' + s[1] + ':' + s[2] + '\n') |
1533 | shlib_provider[s[0]] = (pkg, pkgver) | 1527 | shlib_provider[s[0]] = (pkg, pkgver) |
1534 | fd.close() | 1528 | fd.close() |
1535 | fd = open(shver_file, 'w') | ||
1536 | fd.write(pkgver + '\n') | ||
1537 | fd.close() | ||
1538 | if needs_ldconfig and use_ldconfig: | 1529 | if needs_ldconfig and use_ldconfig: |
1539 | bb.debug(1, 'adding ldconfig call to postinst for %s' % pkg) | 1530 | bb.debug(1, 'adding ldconfig call to postinst for %s' % pkg) |
1540 | postinst = d.getVar('pkg_postinst_%s' % pkg, True) | 1531 | postinst = d.getVar('pkg_postinst_%s' % pkg, True) |