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