gobject-introspection: 1.60.0 -> 1.60.1
Updated the shlib patches: - Upstream now forces basename in sanitize_shlib_path(lib) if the system isn't darwin. We patch the function to always prefer absolute paths - Due to the above we no longer need the macos patch - `sanitize_shlib_path` is applied after `resolve_from_ldd_output` so we need to apply `fallback_libpath` afterwards too (else we get stuff like `/nix/store/...@rpath/foo.dylib` on darwin) - Note that the `fallback_path` no longer have any unit tests https://gitlab.gnome.org/GNOME/gobject-introspection/blob/1.60.1/NEWS
This commit is contained in:
committed by
Frederik Rietdijk
parent
ee3729938d
commit
d747f1602d
@@ -1,6 +1,6 @@
|
||||
--- a/giscanner/scannermain.py
|
||||
+++ b/giscanner/scannermain.py
|
||||
@@ -101,6 +101,39 @@
|
||||
@@ -95,6 +95,39 @@ def get_windows_option_group(parser):
|
||||
return group
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
def _get_option_parser():
|
||||
parser = optparse.OptionParser('%prog [options] sources',
|
||||
version='%prog ' + giscanner.__version__)
|
||||
@@ -211,6 +244,10 @@
|
||||
@@ -205,6 +238,10 @@ match the namespace prefix.""")
|
||||
parser.add_option("", "--filelist",
|
||||
action="store", dest="filelist", default=[],
|
||||
help="file containing headers and sources to be scanned")
|
||||
@@ -53,7 +53,7 @@
|
||||
parser.add_option_group(group)
|
||||
--- a/giscanner/shlibs.py
|
||||
+++ b/giscanner/shlibs.py
|
||||
@@ -62,6 +62,12 @@
|
||||
@@ -57,6 +57,12 @@ def _ldd_library_pattern(library_name):
|
||||
$""" % re.escape(library_name), re.VERBOSE)
|
||||
|
||||
|
||||
@@ -66,21 +66,33 @@
|
||||
# This is a what we do for non-la files. We assume that we are on an
|
||||
# ELF-like system where ldd exists and the soname extracted with ldd is
|
||||
# a filename that can be opened with dlopen().
|
||||
@@ -110,17 +116,16 @@ def _resolve_non_libtool(options, binary, libraries):
|
||||
if isinstance(output, bytes):
|
||||
@@ -106,7 +112,8 @@ def _resolve_non_libtool(options, binary, libraries):
|
||||
output = output.decode("utf-8", "replace")
|
||||
|
||||
- # Use absolute paths on OS X to conform to how libraries are usually
|
||||
- # referenced on OS X systems, and file names everywhere else.
|
||||
- basename = platform.system() != 'Darwin'
|
||||
- return resolve_from_ldd_output(libraries, output, basename=basename)
|
||||
+ # Never strip away absolute paths in Nix
|
||||
+ basename = False
|
||||
+ return resolve_from_ldd_output(libraries, output, basename=basename, fallback_libpath=options.fallback_libpath)
|
||||
shlibs = resolve_from_ldd_output(libraries, output)
|
||||
- return list(map(sanitize_shlib_path, shlibs))
|
||||
+ fallback_libpath = options.fallback_libpath or "";
|
||||
+ return list(map(lambda p: os.path.join(fallback_libpath, p), map(sanitize_shlib_path, shlibs)))
|
||||
|
||||
|
||||
-def resolve_from_ldd_output(libraries, output, basename=False):
|
||||
+def resolve_from_ldd_output(libraries, output, basename=False, fallback_libpath=""):
|
||||
def sanitize_shlib_path(lib):
|
||||
@@ -115,19 +122,18 @@ def sanitize_shlib_path(lib):
|
||||
# In case we get relative paths on macOS (like @rpath) then we fall
|
||||
# back to the basename as well:
|
||||
# https://gitlab.gnome.org/GNOME/gobject-introspection/issues/222
|
||||
- if sys.platform == "darwin":
|
||||
- if not os.path.isabs(lib):
|
||||
- return os.path.basename(lib)
|
||||
- return lib
|
||||
- else:
|
||||
+
|
||||
+ # Always use absolute paths if available
|
||||
+ if not os.path.isabs(lib):
|
||||
return os.path.basename(lib)
|
||||
+ return lib
|
||||
|
||||
|
||||
def resolve_from_ldd_output(libraries, output):
|
||||
patterns = {}
|
||||
for library in libraries:
|
||||
if not os.path.isfile(library):
|
||||
@@ -89,7 +101,7 @@
|
||||
if len(patterns) == 0:
|
||||
return []
|
||||
|
||||
@@ -129,11 +134,14 @@ def resolve_from_ldd_output(libraries, output, basename=False):
|
||||
@@ -139,8 +145,11 @@ def resolve_from_ldd_output(libraries, output):
|
||||
if line.endswith(':'):
|
||||
continue
|
||||
for word in line.split():
|
||||
@@ -102,14 +114,10 @@
|
||||
+ m = pattern.match(word)
|
||||
if m:
|
||||
del patterns[library]
|
||||
- shlibs.append(_sanitize_install_name(m.group()))
|
||||
+ shlibs.append(os.path.join(fallback_libpath, _sanitize_install_name(m.group())))
|
||||
break
|
||||
|
||||
if len(patterns) > 0:
|
||||
shlibs.append(m.group())
|
||||
--- a/giscanner/utils.py
|
||||
+++ b/giscanner/utils.py
|
||||
@@ -116,17 +116,11 @@
|
||||
@@ -111,17 +111,11 @@ def extract_libtool_shlib(la_file):
|
||||
if dlname is None:
|
||||
return None
|
||||
|
||||
|
||||
Reference in New Issue
Block a user