about summary refs log tree commit diff
path: root/pkgs/build-support
diff options
context:
space:
mode:
authorPhilip Taron <philip.taron@gmail.com>2024-03-14 09:59:39 -0700
committerValentin Gagarin <valentin.gagarin@tweag.io>2024-03-19 22:31:19 +0100
commitb7bcfbaeeb0cbf328441a08ccb0fea087150c67d (patch)
tree36fbe65bfadeee3f0ae88eef9b07bafc13e9ac2f /pkgs/build-support
parent997e54a4fb050e62a36865f6c3daea7125a89bf7 (diff)
Avoid top-level `with ...;` in pkgs/build-support/pkg-config-wrapper/default.nix
Diffstat (limited to 'pkgs/build-support')
-rw-r--r--pkgs/build-support/pkg-config-wrapper/default.nix22
1 files changed, 15 insertions, 7 deletions
diff --git a/pkgs/build-support/pkg-config-wrapper/default.nix b/pkgs/build-support/pkg-config-wrapper/default.nix
index f409ca3a7d4b6..c7856bd1f8765 100644
--- a/pkgs/build-support/pkg-config-wrapper/default.nix
+++ b/pkgs/build-support/pkg-config-wrapper/default.nix
@@ -10,9 +10,17 @@
 , extraPackages ? [], extraBuildCommands ? ""
 }:
 
-with lib;
-
 let
+  inherit (lib)
+    attrByPath
+    getBin
+    optional
+    optionalAttrs
+    optionals
+    optionalString
+    replaceStrings
+    ;
+
   stdenv = stdenvNoCC;
   inherit (stdenv) hostPlatform targetPlatform;
 
@@ -20,7 +28,7 @@ let
   #
   # TODO(@Ericson2314) Make unconditional, or optional but always true by
   # default.
-  targetPrefix = lib.optionalString (targetPlatform != hostPlatform)
+  targetPrefix = optionalString (targetPlatform != hostPlatform)
                                         (targetPlatform.config + "-");
 
   # See description in cc-wrapper.
@@ -49,7 +57,7 @@ stdenv.mkDerivation {
   dontUnpack = true;
 
   # Additional flags passed to pkg-config.
-  addFlags = lib.optional stdenv.targetPlatform.isStatic "--static";
+  addFlags = optional stdenv.targetPlatform.isStatic "--static";
 
   installPhase =
     ''
@@ -119,10 +127,10 @@ stdenv.mkDerivation {
   };
 
   meta =
-    let pkg-config_ = lib.optionalAttrs (pkg-config != null) pkg-config; in
-    (lib.optionalAttrs (pkg-config_ ? meta) (removeAttrs pkg-config.meta ["priority"])) //
+    let pkg-config_ = optionalAttrs (pkg-config != null) pkg-config; in
+    (optionalAttrs (pkg-config_ ? meta) (removeAttrs pkg-config.meta ["priority"])) //
     { description =
-        lib.attrByPath ["meta" "description"] "pkg-config" pkg-config_
+        attrByPath ["meta" "description"] "pkg-config" pkg-config_
         + " (wrapper script)";
       priority = 10;
   };