mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-12-26 21:33:03 +03:00
gobjectIntrospection: 1.56.0 → 1.58.1
Upstream now strips absolute paths to their basename on all platforms apart from
Darwin: a41abe1868
To get around this without modifying the basename test we simply pass in
`basename=False` when normally generating gir files.
This commit is contained in:
parent
b2f1c63364
commit
fe4b53b8c3
@ -2,10 +2,10 @@
|
||||
+++ b/gir/cairo-1.0.gir.in
|
||||
@@ -5,7 +5,7 @@
|
||||
xmlns:glib="http://www.gtk.org/introspection/glib/1.0">
|
||||
<package name="%CAIRO_GIR_PACKAGE%"/>
|
||||
<package name="@CAIRO_GIR_PACKAGE@"/>
|
||||
<namespace name="cairo" version="1.0"
|
||||
- shared-library="%CAIRO_SHARED_LIBRARY%"
|
||||
+ shared-library="@cairoLib@/%CAIRO_SHARED_LIBRARY%"
|
||||
- shared-library="@CAIRO_SHARED_LIBRARY@"
|
||||
+ shared-library="@cairoLib@/@CAIRO_SHARED_LIBRARY@"
|
||||
c:identifier-prefixes="cairo"
|
||||
c:symbol-prefixes="cairo">
|
||||
<record name="Context" c:type="cairo_t" foreign="1"
|
||||
|
@ -1,6 +1,6 @@
|
||||
--- a/giscanner/scannermain.py
|
||||
+++ b/giscanner/scannermain.py
|
||||
@@ -100,6 +100,39 @@
|
||||
@@ -101,6 +101,39 @@
|
||||
return group
|
||||
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
+ # Newer multiple-output-optimized stdenv has an environment variable
|
||||
+ # $outputLib which in turn specifies another variable which then is used as
|
||||
+ # the destination for the library contents (${!outputLib}/lib).
|
||||
+ store_path = os.environ.get(os.environ.get("outputLib"))
|
||||
+ store_path = os.environ.get(os.environ.get("outputLib")) if "outputLib" in os.environ else None
|
||||
+ if store_path is None:
|
||||
+ outputs = os.environ.get("outputs", "out").split()
|
||||
+ if "lib" in outputs:
|
||||
@ -38,9 +38,9 @@
|
||||
+
|
||||
+
|
||||
def _get_option_parser():
|
||||
parser = optparse.OptionParser('%prog [options] sources')
|
||||
parser.add_option('', "--quiet",
|
||||
@@ -209,6 +242,10 @@
|
||||
parser = optparse.OptionParser('%prog [options] sources',
|
||||
version='%prog ' + giscanner.__version__)
|
||||
@@ -211,6 +244,10 @@
|
||||
parser.add_option("", "--filelist",
|
||||
action="store", dest="filelist", default=[],
|
||||
help="file containing headers and sources to be scanned")
|
||||
@ -53,48 +53,63 @@
|
||||
parser.add_option_group(group)
|
||||
--- a/giscanner/shlibs.py
|
||||
+++ b/giscanner/shlibs.py
|
||||
@@ -63,6 +63,11 @@
|
||||
pattern = "([^\s]*lib*%s[^A-Za-z0-9_-][^\s\(\)]*)"
|
||||
return re.compile(pattern % re.escape(library_name))
|
||||
@@ -62,6 +62,12 @@
|
||||
$""" % re.escape(library_name), re.VERBOSE)
|
||||
|
||||
|
||||
+def _ldd_library_nix_pattern(library_name):
|
||||
+ nix_store_dir = re.escape('@nixStoreDir@'.rstrip('/'))
|
||||
+ pattern = r'(%s(?:/[^/]*)+lib%s[^A-Za-z0-9_-][^\s\(\)]*)'
|
||||
+ return re.compile(pattern % (nix_store_dir, re.escape(library_name)))
|
||||
+
|
||||
|
||||
+
|
||||
# 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
|
||||
@@ -112,7 +117,7 @@
|
||||
proc = subprocess.Popen(args, stdout=subprocess.PIPE)
|
||||
patterns = {}
|
||||
for library in libraries:
|
||||
# a filename that can be opened with dlopen().
|
||||
@@ -110,17 +116,16 @@ def _resolve_non_libtool(options, binary, libraries):
|
||||
if isinstance(output, bytes):
|
||||
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)
|
||||
|
||||
|
||||
-def resolve_from_ldd_output(libraries, output, basename=False):
|
||||
+def resolve_from_ldd_output(libraries, output, basename=False, fallback_libpath=""):
|
||||
patterns = {}
|
||||
for library in libraries:
|
||||
if not os.path.isfile(library):
|
||||
- patterns[library] = _ldd_library_pattern(library)
|
||||
+ patterns[library] = (_ldd_library_pattern(library), _ldd_library_nix_pattern(library))
|
||||
if len(patterns) == 0:
|
||||
return []
|
||||
|
||||
shlibs = []
|
||||
for line in proc.stdout:
|
||||
@@ -122,11 +127,14 @@
|
||||
# possible for the name of the binary to match _ldd_library_pattern.
|
||||
if line == binary.args[0] + ':\n':
|
||||
continue
|
||||
@@ -129,11 +134,14 @@ def resolve_from_ldd_output(libraries, output, basename=False):
|
||||
if line.endswith(':'):
|
||||
continue
|
||||
for word in line.split():
|
||||
- for library, pattern in patterns.items():
|
||||
- m = pattern.search(line)
|
||||
- m = pattern.match(word)
|
||||
+ for library, (pattern, nix_pattern) in patterns.items():
|
||||
+ if line.find('@nixStoreDir@') != -1:
|
||||
+ m = nix_pattern.search(line)
|
||||
+ m = nix_pattern.match(word)
|
||||
+ else:
|
||||
+ m = pattern.search(line)
|
||||
+ m = pattern.match(word)
|
||||
if m:
|
||||
del patterns[library]
|
||||
- shlibs.append(_sanitize_install_name(m.group(1)))
|
||||
+ shlibs.append(os.path.join(options.fallback_libpath, _sanitize_install_name(m.group(1))))
|
||||
- shlibs.append(_sanitize_install_name(m.group()))
|
||||
+ shlibs.append(os.path.join(fallback_libpath, _sanitize_install_name(m.group())))
|
||||
break
|
||||
|
||||
if len(patterns) > 0:
|
||||
if len(patterns) > 0:
|
||||
--- a/giscanner/utils.py
|
||||
+++ b/giscanner/utils.py
|
||||
@@ -113,17 +113,11 @@
|
||||
@@ -116,17 +116,11 @@
|
||||
if dlname is None:
|
||||
return None
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
{ stdenv, fetchurl, glib, flex, bison, pkgconfig, libffi, python
|
||||
, libintl, cctools, cairo, gnome3
|
||||
{ stdenv, fetchurl, glib, flex, bison, meson, ninja, pkgconfig, libffi, python3
|
||||
, libintl, cctools, cairo, gnome3, glibcLocales, fetchpatch
|
||||
, substituteAll, nixStoreDir ? builtins.storeDir
|
||||
, x11Support ? true
|
||||
}:
|
||||
@ -9,7 +9,7 @@
|
||||
|
||||
let
|
||||
pname = "gobject-introspection";
|
||||
version = "1.56.0";
|
||||
version = "1.58.1";
|
||||
in
|
||||
with stdenv.lib;
|
||||
stdenv.mkDerivation rec {
|
||||
@ -17,21 +17,22 @@ stdenv.mkDerivation rec {
|
||||
|
||||
src = fetchurl {
|
||||
url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${name}.tar.xz";
|
||||
sha256 = "1y50pbn5qqbcv2h9rkz96wvv5jls2gma9bkqjq6wapmaszx5jw0d";
|
||||
sha256 = "12fzs3044047icdfs7cb2lsmnfi6w6fyhkci3m2rbvf5llgnhm29";
|
||||
};
|
||||
|
||||
outputs = [ "out" "dev" ];
|
||||
outputs = [ "out" "dev" "man" ];
|
||||
outputBin = "dev";
|
||||
outputMan = "dev"; # tiny pages
|
||||
|
||||
nativeBuildInputs = [ pkgconfig libintl ];
|
||||
buildInputs = [ flex bison python setupHook/*move .gir*/ ]
|
||||
LC_ALL = "en_US.UTF-8"; # for tests
|
||||
|
||||
nativeBuildInputs = [ meson ninja pkgconfig libintl glibcLocales ];
|
||||
buildInputs = [ flex bison python3 setupHook/*move .gir*/ ]
|
||||
++ stdenv.lib.optional stdenv.isDarwin cctools;
|
||||
propagatedBuildInputs = [ libffi glib ];
|
||||
|
||||
preConfigure = ''
|
||||
sed 's|/usr/bin/env ||' -i tools/g-ir-tool-template.in
|
||||
'';
|
||||
mesonFlags = [
|
||||
"--datadir=${placeholder "dev"}/share"
|
||||
];
|
||||
|
||||
# outputs TODO: share/gobject-introspection-1.0/tests is needed during build
|
||||
# by pygobject3 (and maybe others), but it's only searched in $out
|
||||
@ -50,7 +51,7 @@ stdenv.mkDerivation rec {
|
||||
cairoLib = "${getLib cairo}/lib";
|
||||
});
|
||||
|
||||
doCheck = false; # fails
|
||||
doCheck = true;
|
||||
|
||||
passthru = {
|
||||
updateScript = gnome3.updateScript {
|
||||
|
@ -25,12 +25,12 @@ index c93d20c..4d4915d 100644
|
||||
|
||||
# Assume ldd output is something vaguely like
|
||||
#
|
||||
@@ -121,7 +137,7 @@ def _resolve_non_libtool(options, binary, libraries):
|
||||
m = pattern.search(line)
|
||||
@@ -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(1))
|
||||
+ shlibs.append(_sanitize_install_name(m.group(1)))
|
||||
- shlibs.append(m.group())
|
||||
+ shlibs.append(_sanitize_install_name(m.group()))
|
||||
break
|
||||
|
||||
if len(patterns) > 0:
|
||||
if len(patterns) > 0:
|
||||
|
@ -9901,7 +9901,6 @@ with pkgs;
|
||||
gobjectIntrospection = callPackage ../development/libraries/gobject-introspection {
|
||||
nixStoreDir = config.nix.storeDir or builtins.storeDir;
|
||||
inherit (darwin) cctools;
|
||||
python = python2;
|
||||
};
|
||||
|
||||
goocanvas = callPackage ../development/libraries/goocanvas { };
|
||||
|
Loading…
Reference in New Issue
Block a user