Avoid top-level `with ...;` in pkgs/build-support/pkg-config-wrapper/default.nix

authored by philiptaron.tngl.sh and committed by Valentin Gagarin b7bcfbae 997e54a4

+15 -7
+15 -7
pkgs/build-support/pkg-config-wrapper/default.nix
··· 10 10 , extraPackages ? [], extraBuildCommands ? "" 11 11 }: 12 12 13 - with lib; 14 - 15 13 let 14 + inherit (lib) 15 + attrByPath 16 + getBin 17 + optional 18 + optionalAttrs 19 + optionals 20 + optionalString 21 + replaceStrings 22 + ; 23 + 16 24 stdenv = stdenvNoCC; 17 25 inherit (stdenv) hostPlatform targetPlatform; 18 26 ··· 20 28 # 21 29 # TODO(@Ericson2314) Make unconditional, or optional but always true by 22 30 # default. 23 - targetPrefix = lib.optionalString (targetPlatform != hostPlatform) 31 + targetPrefix = optionalString (targetPlatform != hostPlatform) 24 32 (targetPlatform.config + "-"); 25 33 26 34 # See description in cc-wrapper. ··· 49 57 dontUnpack = true; 50 58 51 59 # Additional flags passed to pkg-config. 52 - addFlags = lib.optional stdenv.targetPlatform.isStatic "--static"; 60 + addFlags = optional stdenv.targetPlatform.isStatic "--static"; 53 61 54 62 installPhase = 55 63 '' ··· 119 127 }; 120 128 121 129 meta = 122 - let pkg-config_ = lib.optionalAttrs (pkg-config != null) pkg-config; in 123 - (lib.optionalAttrs (pkg-config_ ? meta) (removeAttrs pkg-config.meta ["priority"])) // 130 + let pkg-config_ = optionalAttrs (pkg-config != null) pkg-config; in 131 + (optionalAttrs (pkg-config_ ? meta) (removeAttrs pkg-config.meta ["priority"])) // 124 132 { description = 125 - lib.attrByPath ["meta" "description"] "pkg-config" pkg-config_ 133 + attrByPath ["meta" "description"] "pkg-config" pkg-config_ 126 134 + " (wrapper script)"; 127 135 priority = 10; 128 136 };