nixpkgs/pkgs/tools/text/goawk/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

44 lines
1.0 KiB
Nix
Raw Normal View History

{ buildGoModule, fetchFromGitHub, lib, stdenv, gawk }:
2022-04-05 21:09:08 +00:00
2022-02-05 11:15:18 +00:00
buildGoModule rec {
pname = "goawk";
2022-11-27 06:09:20 +00:00
version = "1.21.0";
2022-02-05 11:15:18 +00:00
src = fetchFromGitHub {
owner = "benhoyt";
repo = "goawk";
rev = "v${version}";
2022-11-27 06:09:20 +00:00
sha256 = "sha256-I6KmNPFD8kkYDyek8lR1ZS7biPA/LYGwJqMoA2fG7Wg=";
2022-02-05 11:15:18 +00:00
};
vendorSha256 = null;
2022-02-05 11:15:18 +00:00
nativeCheckInputs = [ gawk ];
2022-04-05 21:09:08 +00:00
postPatch = ''
2022-05-21 03:15:36 +00:00
substituteInPlace goawk_test.go \
--replace "TestCommandLine" "SkipCommandLine" \
--replace "TestDevStdout" "SkipDevStdout" \
--replace "TestFILENAME" "SkipFILENAME" \
--replace "TestWildcards" "SkipWildcards"
2022-04-05 21:09:08 +00:00
substituteInPlace interp/interp_test.go \
--replace "TestShellCommand" "SkipShellCommand"
'';
checkFlags = [
"-awk"
"${gawk}/bin/gawk"
];
2022-04-05 21:09:08 +00:00
doCheck = (stdenv.system != "aarch64-darwin");
2022-02-05 11:15:18 +00:00
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 ];
};
}