1
0
mirror of https://git.yoctoproject.org/poky synced 2026-06-09 03:40:18 +00:00

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>
This commit is contained in:
Etienne Cordonnier
2024-01-12 16:20:30 +01:00
committed by Richard Purdie
parent fc2d534e38
commit 5031cf42ff
+3 -3
View File
@@ -1615,7 +1615,7 @@ def process_shlibs(pkgfiles, d):
sonames.add(prov)
if file.endswith('.dylib') or file.endswith('.so'):
rpath = []
p = subprocess.Popen([d.expand("${HOST_PREFIX}otool"), '-l', file], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
p = subprocess.Popen([d.expand("${HOST_PREFIX}otool"), '-l', file], stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)
out, err = p.communicate()
# If returned successfully, process stdout for results
if p.returncode == 0:
@@ -1624,7 +1624,7 @@ def process_shlibs(pkgfiles, d):
if l.startswith('path '):
rpath.append(l.split()[1])
p = subprocess.Popen([d.expand("${HOST_PREFIX}otool"), '-L', file], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
p = subprocess.Popen([d.expand("${HOST_PREFIX}otool"), '-L', file], stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)
out, err = p.communicate()
# If returned successfully, process stdout for results
if p.returncode == 0:
@@ -1686,7 +1686,7 @@ def process_shlibs(pkgfiles, d):
soname = None
if cpath.islink(file):
continue
if hostos == "darwin" or hostos == "darwin8":
if hostos.startswith("darwin"):
darwin_so(file, needed, sonames, renames, pkgver)
elif hostos.startswith("mingw"):
mingw_dll(file, needed, sonames, renames, pkgver)