summaryrefslogtreecommitdiffstats
path: root/meta/lib/oe
diff options
context:
space:
mode:
authorEtienne Cordonnier <ecordonnier@snap.com>2024-01-12 16:20:30 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2024-01-15 21:42:15 +0000
commit5031cf42ffb221b52e527d8afc54138c1fb161a1 (patch)
treef712a56291de8cd7f120fed7d705964f4bc37934 /meta/lib/oe
parentfc2d534e38a75a99396e63bf374f92167d6331dc (diff)
downloadpoky-5031cf42ffb221b52e527d8afc54138c1fb161a1.tar.gz
package.py: fix Darwin support
- 'subprocess.Popen([d.expand("${HOST_PREFIX}otool)' requires text-mode (a more readable alias for the universal_newlines parameter), since otool produces text and the code 'out.split("\n")' expects a string, not a bytes object. otool is used on MacOS only, so this error isn't triggered on Linux. - use 'startswith("darwin")' in order to support all darwin versions and not just specific versions (meta-darwin supports darwin21 at the moment). (From OE-Core rev: 248ca79a6400e063c4965f9542c614bf837ff758) Signed-off-by: Dominik Schnitzer <dominik@snap.com> Signed-off-by: Etienne Cordonnier <ecordonnier@snap.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oe')
-rw-r--r--meta/lib/oe/package.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/meta/lib/oe/package.py b/meta/lib/oe/package.py
index 9a465eaa09..702d8403be 100644
--- a/meta/lib/oe/package.py
+++ b/meta/lib/oe/package.py
@@ -1615,7 +1615,7 @@ def process_shlibs(pkgfiles, d):
1615 sonames.add(prov) 1615 sonames.add(prov)
1616 if file.endswith('.dylib') or file.endswith('.so'): 1616 if file.endswith('.dylib') or file.endswith('.so'):
1617 rpath = [] 1617 rpath = []
1618 p = subprocess.Popen([d.expand("${HOST_PREFIX}otool"), '-l', file], stdout=subprocess.PIPE, stderr=subprocess.PIPE) 1618 p = subprocess.Popen([d.expand("${HOST_PREFIX}otool"), '-l', file], stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)
1619 out, err = p.communicate() 1619 out, err = p.communicate()
1620 # If returned successfully, process stdout for results 1620 # If returned successfully, process stdout for results
1621 if p.returncode == 0: 1621 if p.returncode == 0:
@@ -1624,7 +1624,7 @@ def process_shlibs(pkgfiles, d):
1624 if l.startswith('path '): 1624 if l.startswith('path '):
1625 rpath.append(l.split()[1]) 1625 rpath.append(l.split()[1])
1626 1626
1627 p = subprocess.Popen([d.expand("${HOST_PREFIX}otool"), '-L', file], stdout=subprocess.PIPE, stderr=subprocess.PIPE) 1627 p = subprocess.Popen([d.expand("${HOST_PREFIX}otool"), '-L', file], stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)
1628 out, err = p.communicate() 1628 out, err = p.communicate()
1629 # If returned successfully, process stdout for results 1629 # If returned successfully, process stdout for results
1630 if p.returncode == 0: 1630 if p.returncode == 0:
@@ -1686,7 +1686,7 @@ def process_shlibs(pkgfiles, d):
1686 soname = None 1686 soname = None
1687 if cpath.islink(file): 1687 if cpath.islink(file):
1688 continue 1688 continue
1689 if hostos == "darwin" or hostos == "darwin8": 1689 if hostos.startswith("darwin"):
1690 darwin_so(file, needed, sonames, renames, pkgver) 1690 darwin_so(file, needed, sonames, renames, pkgver)
1691 elif hostos.startswith("mingw"): 1691 elif hostos.startswith("mingw"):
1692 mingw_dll(file, needed, sonames, renames, pkgver) 1692 mingw_dll(file, needed, sonames, renames, pkgver)