From 740b30b937ee42a3ae3596e6c9ba0a08742db5d9 Mon Sep 17 00:00:00 2001 From: aszlig Date: Sat, 23 Jan 2016 16:24:03 +0100 Subject: [PATCH] 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 --- .../absolute_shlib_path.patch | 29 +++++++++++-------- 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/pkgs/development/libraries/gobject-introspection/absolute_shlib_path.patch b/pkgs/development/libraries/gobject-introspection/absolute_shlib_path.patch index 1cec9c1e1a5..49e059befdb 100644 --- a/pkgs/development/libraries/gobject-introspection/absolute_shlib_path.patch +++ b/pkgs/development/libraries/gobject-introspection/absolute_shlib_path.patch @@ -1,21 +1,26 @@ 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(): -+ 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". -+ store_path = os.environ.get("out") ++ # 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". ++ store_path = os.environ.get("out") + + if store_path is not None: + # Even if we have a $lib as output, there still should be a $lib/lib @@ -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")