summary refs log tree commit diff
path: root/pkgs/tools/text
diff options
context:
space:
mode:
authorSandro <sandro.jaeckel@gmail.com>2022-10-18 21:06:49 +0200
committerGitHub <noreply@github.com>2022-10-18 21:06:49 +0200
commite08c848d0869d143c2307e774cb250f7cbba534c (patch)
tree92c2b46493b2a722397d9c06e9a981bf7332afc3 /pkgs/tools/text
parent751bd27b60c246cbd02dc230f9a430c7dc7919aa (diff)
parentfcf1534fc7ab9c2b4e62d50b722cbdd443b0bdd6 (diff)
Merge pull request #192964 from figsoda/frawk
Diffstat (limited to 'pkgs/tools/text')
-rw-r--r--pkgs/tools/text/frawk/default.nix43
1 files changed, 43 insertions, 0 deletions
diff --git a/pkgs/tools/text/frawk/default.nix b/pkgs/tools/text/frawk/default.nix
new file mode 100644
index 0000000000000..d4e0f809ebe1e
--- /dev/null
+++ b/pkgs/tools/text/frawk/default.nix
@@ -0,0 +1,43 @@
+{ lib
+, rustPlatform
+, fetchCrate
+, libxml2
+, ncurses
+, zlib
+, features ? [ "default" ]
+, llvmPackages_12
+}:
+
+rustPlatform.buildRustPackage rec {
+  pname = "frawk";
+  version = "0.4.6";
+
+  src = fetchCrate {
+    inherit pname version;
+    sha256 = "sha256-yEdfMikMcsQePxQL1+lma95O1x5z1B7aXAEf8apuGaU=";
+  };
+
+  cargoSha256 = "sha256-osi77Fx8jSfIvAIpThgPbnuJVF/Ydr2/+ROHcDG5ZbA=";
+
+  buildInputs = [ libxml2 ncurses zlib ];
+
+  buildNoDefaultFeatures = true;
+  buildFeatures = features;
+
+  preBuild = lib.optionalString (lib.elem "default" features || lib.elem "llvm_backend" features) ''
+    export LLVM_SYS_120_PREFIX=${llvmPackages_12.llvm.dev}
+  '' + lib.optionalString (lib.elem "default" features || lib.elem "unstable" features) ''
+    export RUSTC_BOOTSTRAP=1
+  '';
+
+  # depends on cpu instructions that may not be available on builders
+  doCheck = false;
+
+  meta = with lib; {
+    description = "A small programming language for writing short programs processing textual data";
+    homepage = "https://github.com/ezrosent/frawk";
+    license = with licenses; [ mit /* or */ asl20 ];
+    maintainers = with maintainers; [ figsoda ];
+    platforms = platforms.x86;
+  };
+}