gobject-introspection: Deal with $outputLib

Once #7701 gets merged, we have another environment variable called
$outputLib, which then points to another environment variable which is
the final library output.

This was brought up in discussion with @lethalman and @vcunat in:

https://github.com/NixOS/nixpkgs/pull/12558#discussion_r50599813

The closure-size branch is not yet merged into master, so this is only
a preparation and we're still falling back to $out and $lib whenever
$outputLib isn't available.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
This commit is contained in:
aszlig 2016-01-23 16:24:03 +01:00
parent b3b444a79e
commit 740b30b937
No known key found for this signature in database
GPG Key ID: D0EBD0EC8C2DC961

View File

@ -1,20 +1,25 @@
diff --git a/giscanner/scannermain.py b/giscanner/scannermain.py
index 89ec193..8ee92c3 100755
index 89ec193..54f1d2e 100755
--- a/giscanner/scannermain.py
+++ b/giscanner/scannermain.py
@@ -94,6 +94,34 @@ def get_windows_option_group(parser):
@@ -94,6 +94,39 @@ def get_windows_option_group(parser):
return group
+def _get_default_fallback_libpath():
+ # 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"))
+ if store_path is None:
+ outputs = os.environ.get("outputs", "out").split()
+ if "lib" in outputs:
+ # For multiple output derivations let's try whether there is a $lib
+ # environment variable and use that as the base store path.
+ store_path = os.environ.get("lib")
+ elif "out" in outputs:
+ # Otherwise we have a single output derivation, so the libraries most
+ # certainly will end up in "$out/lib".
+ # Otherwise we have a single output derivation, so the libraries
+ # most certainly will end up in "$out/lib".
+ store_path = os.environ.get("out")
+
+ if store_path is not None:
@ -37,7 +42,7 @@ index 89ec193..8ee92c3 100755
def _get_option_parser():
parser = optparse.OptionParser('%prog [options] sources')
parser.add_option('', "--quiet",
@@ -200,6 +228,10 @@ match the namespace prefix.""")
@@ -200,6 +233,10 @@ match the namespace prefix.""")
parser.add_option("", "--filelist",
action="store", dest="filelist", default=[],
help="file containing headers and sources to be scanned")