From ab0a0c004e1076315c8ed910437e6cf9c2f087ff Mon Sep 17 00:00:00 2001 From: Nikolay Amiantov Date: Thu, 14 Apr 2016 18:14:28 +0300 Subject: makeSearchPathOutputs: refactor to makeSearchPathOutput --- lib/strings.nix | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'lib/strings.nix') 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 -- cgit 1.4.1