about summary refs log tree commit diff
path: root/nixpkgs/pkgs/tools/text/gawk/gawk-with-extensions.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/tools/text/gawk/gawk-with-extensions.nix')
-rw-r--r--nixpkgs/pkgs/tools/text/gawk/gawk-with-extensions.nix12
1 files changed, 12 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/tools/text/gawk/gawk-with-extensions.nix b/nixpkgs/pkgs/tools/text/gawk/gawk-with-extensions.nix
new file mode 100644
index 000000000000..751e5181bb58
--- /dev/null
+++ b/nixpkgs/pkgs/tools/text/gawk/gawk-with-extensions.nix
@@ -0,0 +1,12 @@
+{ runCommand, gawk, extensions, makeWrapper }:
+
+runCommand "gawk-with-extensions" {
+  buildInputs = [ makeWrapper gawk ] ++ extensions;
+} ''
+  mkdir -p $out/bin
+  for i in ${gawk}/bin/*; do
+    name="$(basename "$i")"
+    makeWrapper $i $out/bin/$name \
+      --prefix AWKLIBPATH : "${gawk}/lib/gawk:''${AWKLIBPATH:-}"
+  done
+''