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