Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)

gobjectIntrospection: 1.56.0 → 1.58.1

Upstream now strips absolute paths to their basename on all platforms apart from
Darwin: https://gitlab.gnome.org/GNOME/gobject-introspection/commit/a41abe1868a693387cd5cf85567cf2e0fd6c62df

To get around this without modifying the basename test we simply pass in
`basename=False` when normally generating gir files.

+62 -47
+3 -3
pkgs/development/libraries/gobject-introspection/absolute_gir_path.patch
··· 2 +++ b/gir/cairo-1.0.gir.in 3 @@ -5,7 +5,7 @@ 4 xmlns:glib="http://www.gtk.org/introspection/glib/1.0"> 5 - <package name="%CAIRO_GIR_PACKAGE%"/> 6 <namespace name="cairo" version="1.0" 7 - - shared-library="%CAIRO_SHARED_LIBRARY%" 8 - + shared-library="@cairoLib@/%CAIRO_SHARED_LIBRARY%" 9 c:identifier-prefixes="cairo" 10 c:symbol-prefixes="cairo"> 11 <record name="Context" c:type="cairo_t" foreign="1"
··· 2 +++ b/gir/cairo-1.0.gir.in 3 @@ -5,7 +5,7 @@ 4 xmlns:glib="http://www.gtk.org/introspection/glib/1.0"> 5 + <package name="@CAIRO_GIR_PACKAGE@"/> 6 <namespace name="cairo" version="1.0" 7 + - shared-library="@CAIRO_SHARED_LIBRARY@" 8 + + shared-library="@cairoLib@/@CAIRO_SHARED_LIBRARY@" 9 c:identifier-prefixes="cairo" 10 c:symbol-prefixes="cairo"> 11 <record name="Context" c:type="cairo_t" foreign="1"
+41 -26
pkgs/development/libraries/gobject-introspection/absolute_shlib_path.patch
··· 1 --- a/giscanner/scannermain.py 2 +++ b/giscanner/scannermain.py 3 - @@ -100,6 +100,39 @@ 4 return group 5 6 ··· 8 + # Newer multiple-output-optimized stdenv has an environment variable 9 + # $outputLib which in turn specifies another variable which then is used as 10 + # the destination for the library contents (${!outputLib}/lib). 11 - + store_path = os.environ.get(os.environ.get("outputLib")) 12 + if store_path is None: 13 + outputs = os.environ.get("outputs", "out").split() 14 + if "lib" in outputs: ··· 38 + 39 + 40 def _get_option_parser(): 41 - parser = optparse.OptionParser('%prog [options] sources') 42 - parser.add_option('', "--quiet", 43 - @@ -209,6 +242,10 @@ 44 parser.add_option("", "--filelist", 45 action="store", dest="filelist", default=[], 46 help="file containing headers and sources to be scanned") ··· 53 parser.add_option_group(group) 54 --- a/giscanner/shlibs.py 55 +++ b/giscanner/shlibs.py 56 - @@ -63,6 +63,11 @@ 57 - pattern = "([^\s]*lib*%s[^A-Za-z0-9_-][^\s\(\)]*)" 58 - return re.compile(pattern % re.escape(library_name)) 59 60 +def _ldd_library_nix_pattern(library_name): 61 + nix_store_dir = re.escape('@nixStoreDir@'.rstrip('/')) 62 + pattern = r'(%s(?:/[^/]*)+lib%s[^A-Za-z0-9_-][^\s\(\)]*)' 63 + return re.compile(pattern % (nix_store_dir, re.escape(library_name))) 64 + 65 - 66 # This is a what we do for non-la files. We assume that we are on an 67 # ELF-like system where ldd exists and the soname extracted with ldd is 68 - @@ -112,7 +117,7 @@ 69 - proc = subprocess.Popen(args, stdout=subprocess.PIPE) 70 - patterns = {} 71 - for library in libraries: 72 - patterns[library] = _ldd_library_pattern(library) 73 + patterns[library] = (_ldd_library_pattern(library), _ldd_library_nix_pattern(library)) 74 75 - shlibs = [] 76 - for line in proc.stdout: 77 - @@ -122,11 +127,14 @@ 78 - # possible for the name of the binary to match _ldd_library_pattern. 79 - if line == binary.args[0] + ':\n': 80 - continue 81 - for library, pattern in patterns.items(): 82 - - m = pattern.search(line) 83 + for library, (pattern, nix_pattern) in patterns.items(): 84 + if line.find('@nixStoreDir@') != -1: 85 - + m = nix_pattern.search(line) 86 + else: 87 - + m = pattern.search(line) 88 if m: 89 del patterns[library] 90 - - shlibs.append(_sanitize_install_name(m.group(1))) 91 - + shlibs.append(os.path.join(options.fallback_libpath, _sanitize_install_name(m.group(1)))) 92 break 93 94 - if len(patterns) > 0: 95 --- a/giscanner/utils.py 96 +++ b/giscanner/utils.py 97 - @@ -113,17 +113,11 @@ 98 if dlname is None: 99 return None 100
··· 1 --- a/giscanner/scannermain.py 2 +++ b/giscanner/scannermain.py 3 + @@ -101,6 +101,39 @@ 4 return group 5 6 ··· 8 + # Newer multiple-output-optimized stdenv has an environment variable 9 + # $outputLib which in turn specifies another variable which then is used as 10 + # the destination for the library contents (${!outputLib}/lib). 11 + + store_path = os.environ.get(os.environ.get("outputLib")) if "outputLib" in os.environ else None 12 + if store_path is None: 13 + outputs = os.environ.get("outputs", "out").split() 14 + if "lib" in outputs: ··· 38 + 39 + 40 def _get_option_parser(): 41 + parser = optparse.OptionParser('%prog [options] sources', 42 + version='%prog ' + giscanner.__version__) 43 + @@ -211,6 +244,10 @@ 44 parser.add_option("", "--filelist", 45 action="store", dest="filelist", default=[], 46 help="file containing headers and sources to be scanned") ··· 53 parser.add_option_group(group) 54 --- a/giscanner/shlibs.py 55 +++ b/giscanner/shlibs.py 56 + @@ -62,6 +62,12 @@ 57 + $""" % re.escape(library_name), re.VERBOSE) 58 + 59 60 +def _ldd_library_nix_pattern(library_name): 61 + nix_store_dir = re.escape('@nixStoreDir@'.rstrip('/')) 62 + pattern = r'(%s(?:/[^/]*)+lib%s[^A-Za-z0-9_-][^\s\(\)]*)' 63 + return re.compile(pattern % (nix_store_dir, re.escape(library_name))) 64 + 65 + + 66 # This is a what we do for non-la files. We assume that we are on an 67 # ELF-like system where ldd exists and the soname extracted with ldd is 68 + # a filename that can be opened with dlopen(). 69 + @@ -110,17 +116,16 @@ def _resolve_non_libtool(options, binary, libraries): 70 + if isinstance(output, bytes): 71 + output = output.decode("utf-8", "replace") 72 + 73 + - # Use absolute paths on OS X to conform to how libraries are usually 74 + - # referenced on OS X systems, and file names everywhere else. 75 + - basename = platform.system() != 'Darwin' 76 + - return resolve_from_ldd_output(libraries, output, basename=basename) 77 + + # Never strip away absolute paths in Nix 78 + + basename = False 79 + + return resolve_from_ldd_output(libraries, output, basename=basename, fallback_libpath=options.fallback_libpath) 80 + 81 + 82 + -def resolve_from_ldd_output(libraries, output, basename=False): 83 + +def resolve_from_ldd_output(libraries, output, basename=False, fallback_libpath=""): 84 + patterns = {} 85 + for library in libraries: 86 + if not os.path.isfile(library): 87 - patterns[library] = _ldd_library_pattern(library) 88 + patterns[library] = (_ldd_library_pattern(library), _ldd_library_nix_pattern(library)) 89 + if len(patterns) == 0: 90 + return [] 91 92 + @@ -129,11 +134,14 @@ def resolve_from_ldd_output(libraries, output, basename=False): 93 + if line.endswith(':'): 94 + continue 95 + for word in line.split(): 96 - for library, pattern in patterns.items(): 97 + - m = pattern.match(word) 98 + for library, (pattern, nix_pattern) in patterns.items(): 99 + if line.find('@nixStoreDir@') != -1: 100 + + m = nix_pattern.match(word) 101 + else: 102 + + m = pattern.match(word) 103 if m: 104 del patterns[library] 105 + - shlibs.append(_sanitize_install_name(m.group())) 106 + + shlibs.append(os.path.join(fallback_libpath, _sanitize_install_name(m.group()))) 107 break 108 109 + if len(patterns) > 0: 110 --- a/giscanner/utils.py 111 +++ b/giscanner/utils.py 112 + @@ -116,17 +116,11 @@ 113 if dlname is None: 114 return None 115
+13 -12
pkgs/development/libraries/gobject-introspection/default.nix
··· 1 - { stdenv, fetchurl, glib, flex, bison, pkgconfig, libffi, python 2 - , libintl, cctools, cairo, gnome3 3 , substituteAll, nixStoreDir ? builtins.storeDir 4 , x11Support ? true 5 }: ··· 9 10 let 11 pname = "gobject-introspection"; 12 - version = "1.56.0"; 13 in 14 with stdenv.lib; 15 stdenv.mkDerivation rec { ··· 17 18 src = fetchurl { 19 url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${name}.tar.xz"; 20 - sha256 = "1y50pbn5qqbcv2h9rkz96wvv5jls2gma9bkqjq6wapmaszx5jw0d"; 21 }; 22 23 - outputs = [ "out" "dev" ]; 24 outputBin = "dev"; 25 - outputMan = "dev"; # tiny pages 26 27 - nativeBuildInputs = [ pkgconfig libintl ]; 28 - buildInputs = [ flex bison python setupHook/*move .gir*/ ] 29 ++ stdenv.lib.optional stdenv.isDarwin cctools; 30 propagatedBuildInputs = [ libffi glib ]; 31 32 - preConfigure = '' 33 - sed 's|/usr/bin/env ||' -i tools/g-ir-tool-template.in 34 - ''; 35 36 # outputs TODO: share/gobject-introspection-1.0/tests is needed during build 37 # by pygobject3 (and maybe others), but it's only searched in $out ··· 50 cairoLib = "${getLib cairo}/lib"; 51 }); 52 53 - doCheck = false; # fails 54 55 passthru = { 56 updateScript = gnome3.updateScript {
··· 1 + { stdenv, fetchurl, glib, flex, bison, meson, ninja, pkgconfig, libffi, python3 2 + , libintl, cctools, cairo, gnome3, glibcLocales, fetchpatch 3 , substituteAll, nixStoreDir ? builtins.storeDir 4 , x11Support ? true 5 }: ··· 9 10 let 11 pname = "gobject-introspection"; 12 + version = "1.58.1"; 13 in 14 with stdenv.lib; 15 stdenv.mkDerivation rec { ··· 17 18 src = fetchurl { 19 url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${name}.tar.xz"; 20 + sha256 = "12fzs3044047icdfs7cb2lsmnfi6w6fyhkci3m2rbvf5llgnhm29"; 21 }; 22 23 + outputs = [ "out" "dev" "man" ]; 24 outputBin = "dev"; 25 + 26 + LC_ALL = "en_US.UTF-8"; # for tests 27 28 + nativeBuildInputs = [ meson ninja pkgconfig libintl glibcLocales ]; 29 + buildInputs = [ flex bison python3 setupHook/*move .gir*/ ] 30 ++ stdenv.lib.optional stdenv.isDarwin cctools; 31 propagatedBuildInputs = [ libffi glib ]; 32 33 + mesonFlags = [ 34 + "--datadir=${placeholder "dev"}/share" 35 + ]; 36 37 # outputs TODO: share/gobject-introspection-1.0/tests is needed during build 38 # by pygobject3 (and maybe others), but it's only searched in $out ··· 51 cairoLib = "${getLib cairo}/lib"; 52 }); 53 54 + doCheck = true; 55 56 passthru = { 57 updateScript = gnome3.updateScript {
+5 -5
pkgs/development/libraries/gobject-introspection/macos-shared-library.patch
··· 25 26 # Assume ldd output is something vaguely like 27 # 28 - @@ -121,7 +137,7 @@ def _resolve_non_libtool(options, binary, libraries): 29 - m = pattern.search(line) 30 if m: 31 del patterns[library] 32 - - shlibs.append(m.group(1)) 33 - + shlibs.append(_sanitize_install_name(m.group(1))) 34 break 35 36 - if len(patterns) > 0:
··· 25 26 # Assume ldd output is something vaguely like 27 # 28 + @@ -136,7 +152,7 @@ def resolve_from_ldd_output(libraries, output, basename=False): 29 + m = pattern.match(word) 30 if m: 31 del patterns[library] 32 + - shlibs.append(m.group()) 33 + + shlibs.append(_sanitize_install_name(m.group())) 34 break 35 36 + if len(patterns) > 0:
-1
pkgs/top-level/all-packages.nix
··· 9901 gobjectIntrospection = callPackage ../development/libraries/gobject-introspection { 9902 nixStoreDir = config.nix.storeDir or builtins.storeDir; 9903 inherit (darwin) cctools; 9904 - python = python2; 9905 }; 9906 9907 goocanvas = callPackage ../development/libraries/goocanvas { };
··· 9901 gobjectIntrospection = callPackage ../development/libraries/gobject-introspection { 9902 nixStoreDir = config.nix.storeDir or builtins.storeDir; 9903 inherit (darwin) cctools; 9904 }; 9905 9906 goocanvas = callPackage ../development/libraries/goocanvas { };