diff options
author | Nikolay Amiantov <ab@fmap.me> | 2016-04-14 18:14:28 +0300 |
---|---|---|
committer | Nikolay Amiantov <ab@fmap.me> | 2016-04-25 13:24:39 +0300 |
commit | ab0a0c004e1076315c8ed910437e6cf9c2f087ff (patch) | |
tree | 07b55b8caf43faf9803d80e3e71b90ed226a9bd2 /lib/strings.nix | |
parent | 7d3e75827bc20d50a3b9172ed8891e5bffb30c93 (diff) |
makeSearchPathOutputs: refactor to makeSearchPathOutput
Diffstat (limited to 'lib/strings.nix')
-rw-r--r-- | lib/strings.nix | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/strings.nix b/lib/strings.nix index bda96fb32da0..0e3137f42ee5 100644 --- a/lib/strings.nix +++ b/lib/strings.nix @@ -88,15 +88,14 @@ rec { makeSearchPath = subDir: packages: concatStringsSep ":" (map (path: path + "/" + subDir) packages); - /* Construct a Unix-style search path, given trying outputs in order. + /* Construct a Unix-style search path, using given package output. If no output is found, fallback to `.out` and then to the default. Example: - makeSearchPathOutputs "bin" ["bin"] [ pkgs.openssl pkgs.zlib ] - => "/nix/store/9rz8gxhzf8sw4kf2j2f1grr49w8zx5vj-openssl-1.0.1r-bin/bin:/nix/store/wwh7mhwh269sfjkm6k5665b5kgp7jrk2-zlib-1.2.8/bin" + makeSearchPathOutput "dev" "bin" [ pkgs.openssl pkgs.zlib ] + => "/nix/store/9rz8gxhzf8sw4kf2j2f1grr49w8zx5vj-openssl-1.0.1r-dev/bin:/nix/store/wwh7mhwh269sfjkm6k5665b5kgp7jrk2-zlib-1.2.8/bin" */ - makeSearchPathOutputs = subDir: outputs: pkgs: - makeSearchPath subDir (map (pkg: if pkg.outputUnspecified or false then lib.tryAttrs (outputs ++ ["out"]) pkg else pkg) pkgs); + makeSearchPathOutput = output: subDir: pkgs: makeSearchPath subDir (map (lib.getOutput output) pkgs); /* Construct a library search path (such as RPATH) containing the libraries for a set of packages |