summary refs log tree commit diff
path: root/pkgs/development/libraries/gobject-introspection
diff options
context:
space:
mode:
authorTor Hedin Brønner <torhedinbronner@gmail.com>2019-04-13 16:56:12 +0200
committerFrederik Rietdijk <freddyrietdijk@fridh.nl>2019-04-27 07:09:47 +0200
commitd747f1602df46347c38facb5202ce2525bc4bfc4 (patch)
tree5f57008573b598f3b88c139891d1950404ae6026 /pkgs/development/libraries/gobject-introspection
parentee3729938de7f53af28aaeb3841a12281f0015cc (diff)
downloadnixpkgs-d747f1602df46347c38facb5202ce2525bc4bfc4.tar
nixpkgs-d747f1602df46347c38facb5202ce2525bc4bfc4.tar.gz
nixpkgs-d747f1602df46347c38facb5202ce2525bc4bfc4.tar.bz2
nixpkgs-d747f1602df46347c38facb5202ce2525bc4bfc4.tar.lz
nixpkgs-d747f1602df46347c38facb5202ce2525bc4bfc4.tar.xz
nixpkgs-d747f1602df46347c38facb5202ce2525bc4bfc4.tar.zst
nixpkgs-d747f1602df46347c38facb5202ce2525bc4bfc4.zip
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
Diffstat (limited to 'pkgs/development/libraries/gobject-introspection')
-rw-r--r--pkgs/development/libraries/gobject-introspection/absolute_shlib_path.patch50
-rw-r--r--pkgs/development/libraries/gobject-introspection/default.nix5
-rw-r--r--pkgs/development/libraries/gobject-introspection/macos-shared-library.patch36
-rw-r--r--pkgs/development/libraries/gobject-introspection/test_shlibs.patch31
4 files changed, 43 insertions, 79 deletions
diff --git a/pkgs/development/libraries/gobject-introspection/absolute_shlib_path.patch b/pkgs/development/libraries/gobject-introspection/absolute_shlib_path.patch
index e2525d833f8..6e56d3fab41 100644
--- a/pkgs/development/libraries/gobject-introspection/absolute_shlib_path.patch
+++ b/pkgs/development/libraries/gobject-introspection/absolute_shlib_path.patch
@@ -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
  
diff --git a/pkgs/development/libraries/gobject-introspection/default.nix b/pkgs/development/libraries/gobject-introspection/default.nix
index e6978d0955f..26c472930ed 100644
--- a/pkgs/development/libraries/gobject-introspection/default.nix
+++ b/pkgs/development/libraries/gobject-introspection/default.nix
@@ -9,7 +9,7 @@
 
 let
   pname = "gobject-introspection";
-  version = "1.60.0";
+  version = "1.60.1";
 in
 with stdenv.lib;
 stdenv.mkDerivation rec {
@@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
 
   src = fetchurl {
     url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${name}.tar.xz";
-    sha256 = "0pgk9lcvz3i79m6g2ynlp00ghws7g0p0d5qyf0k72warrf841zly";
+    sha256 = "1cr4r3lh5alrks9q2ycs1kn2crnkhrhn2wrmibng6dndkr4x2i6q";
   };
 
   outputs = [ "out" "dev" "man" ];
@@ -40,7 +40,6 @@ stdenv.mkDerivation rec {
   setupHook = ./setup-hook.sh;
 
   patches = [
-    ./macos-shared-library.patch
     (substituteAll {
       src = ./test_shlibs.patch;
       inherit nixStoreDir;
diff --git a/pkgs/development/libraries/gobject-introspection/macos-shared-library.patch b/pkgs/development/libraries/gobject-introspection/macos-shared-library.patch
deleted file mode 100644
index 9941878c427..00000000000
--- a/pkgs/development/libraries/gobject-introspection/macos-shared-library.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-diff --git a/giscanner/shlibs.py b/giscanner/shlibs.py
-index c93d20c..4d4915d 100644
---- a/giscanner/shlibs.py
-+++ b/giscanner/shlibs.py
-@@ -43,6 +43,22 @@ def _resolve_libtool(options, binary, libraries):
- 
-     return shlibs
- 
-+def _sanitize_install_name(install_name):
-+    '''
-+    On macOS, the dylib can be built with install_name as @rpath/libfoo.so
-+    instead of the absolute path to the library, so handle that. The name
-+    can also be @loader_path or @executable_path.
-+    '''
-+    if not install_name.startswith('@'):
-+        return install_name
-+    if install_name.startswith('@rpath/'):
-+        return install_name[7:]
-+    if install_name.startswith('@loader_path/'):
-+        return install_name[13:]
-+    if install_name.startswith('@executable_path/'):
-+        return install_name[17:]
-+    raise RuntimeError('Unknown install_name {!r}'.format(install_name))
-+
- 
- # Assume ldd output is something vaguely like
- #
-@@ -136,7 +152,7 @@ def resolve_from_ldd_output(libraries, output, basename=False):
-                 m = pattern.match(word)
-                 if m:
-                     del patterns[library]
--                    shlibs.append(m.group())
-+                    shlibs.append(_sanitize_install_name(m.group()))
-                     break
- 
-     if len(patterns) > 0:
diff --git a/pkgs/development/libraries/gobject-introspection/test_shlibs.patch b/pkgs/development/libraries/gobject-introspection/test_shlibs.patch
index c3152982d19..65b5a1a13b9 100644
--- a/pkgs/development/libraries/gobject-introspection/test_shlibs.patch
+++ b/pkgs/development/libraries/gobject-introspection/test_shlibs.patch
@@ -1,6 +1,6 @@
 --- a/tests/scanner/test_shlibs.py
 +++ b/tests/scanner/test_shlibs.py
-@@ -10,6 +10,46 @@ from giscanner.shlibs import resolve_from_ldd_output
+@@ -7,6 +7,30 @@ from giscanner.shlibs import resolve_from_ldd_output, sanitize_shlib_path
  
  class TestLddParser(unittest.TestCase):
  
@@ -26,25 +26,18 @@
 +        self.assertEqual(
 +            ['@nixStoreDir@/gmrf09y7sfxrr0mcx90dba7w41jj2kzk-glib-2.58.1/lib/libglib-2.0.so.0',
 +             '@nixStoreDir@/gmrf09y7sfxrr0mcx90dba7w41jj2kzk-glib-2.58.1/lib/libgio-2.0.so.0'],
-+            resolve_from_ldd_output(libraries, output, basename=False))
-+
-+    def test_resolve_from_ldd_output_macos(self):
-+        output = '''\
-+            @rpath/libatk-1.0.0.dylib
-+            @rpath/libgstreamer-1.0.0.dylib (compatibility version 0.0.0, current version 0.0.0)
-+            /Volumes/USB_SSD/cerbero/build/dist/darwin_x86_64/lib/libglib-2.0.0.dylib (compatibility version 0.0.0, current version 0.0.0)
-+            /Volumes/USB_SSD/cerbero/build/dist/darwin_x86_64/lib/libintl.dylib (compatibility version 0.0.0, current version 0.0.0)
-+            /Volumes/USB_SSD/cerbero/build/dist/darwin_x86_64/lib/libgobject-2.0.0.dylib (compatibility version 0.0.0, current version 0.0.0)
-+            /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.50.4)
-+        '''
-+        libraries = ['atk-1.0']
-+        fallback_libpath = '@nixStoreDir@/1ynd5b01z87c1nw75k5iy7sq49hpkw53-atk-2.30.0/lib'
-+
-+        self.assertEqual(
-+            [ '%s/libatk-1.0.0.dylib' % fallback_libpath ],
-+            resolve_from_ldd_output(libraries, output, basename=False, fallback_libpath=fallback_libpath))
++            resolve_from_ldd_output(libraries, output))
 +
      def test_resolve_from_ldd_output(self):
          output = '''\
              libglib-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007fbe12d68000)
-
+@@ -40,7 +64,8 @@ class TestLddParser(unittest.TestCase):
+ 
+         self.assertEqual(
+             sanitize_shlib_path('/foo/bar'),
+-            '/foo/bar' if sys.platform == 'darwin' else 'bar')
++            # NixOS always want the absolute path
++            '/foo/bar')
+ 
+     def test_unresolved_library(self):
+         output = ''