depot/third_party/nixpkgs/pkgs/tools/text/goawk/default.nix
Default email 94427deb9d Project import generated by Copybara.
GitOrigin-RevId: f91ee3065de91a3531329a674a45ddcb3467a650
2023-05-24 16:37:59 +03:00

43 lines
1 KiB
Nix

{ buildGoModule, fetchFromGitHub, lib, stdenv, gawk }:
buildGoModule rec {
pname = "goawk";
version = "1.23.1";
src = fetchFromGitHub {
owner = "benhoyt";
repo = "goawk";
rev = "v${version}";
sha256 = "sha256-U7fJq9BiWHhyM/I8gVX+PjrGZKanhBgWQWIn9ynOvQI=";
};
vendorHash = null;
nativeCheckInputs = [ gawk ];
postPatch = ''
substituteInPlace goawk_test.go \
--replace "TestCommandLine" "SkipCommandLine" \
--replace "TestDevStdout" "SkipDevStdout" \
--replace "TestFILENAME" "SkipFILENAME" \
--replace "TestWildcards" "SkipWildcards"
substituteInPlace interp/interp_test.go \
--replace "TestShellCommand" "SkipShellCommand"
'';
checkFlags = [
"-awk"
"${gawk}/bin/gawk"
];
doCheck = (stdenv.system != "aarch64-darwin");
meta = with lib; {
description = "A POSIX-compliant AWK interpreter written in Go";
homepage = "https://benhoyt.com/writings/goawk/";
license = licenses.mit;
mainProgram = "goawk";
maintainers = with maintainers; [ abbe ];
};
}