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