2022-08-12 12:06:08 +00:00
|
|
|
{ buildGoModule, fetchFromGitHub, lib, stdenv, gawk }:
|
2022-04-15 01:41:22 +00:00
|
|
|
|
2022-02-20 05:27:41 +00:00
|
|
|
buildGoModule rec {
|
|
|
|
pname = "goawk";
|
2024-04-21 15:54:59 +00:00
|
|
|
version = "1.27.0";
|
2022-02-20 05:27:41 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "benhoyt";
|
|
|
|
repo = "goawk";
|
|
|
|
rev = "v${version}";
|
2024-04-21 15:54:59 +00:00
|
|
|
hash = "sha256-KB9N345xkgsPfI4DQYFag7qSdFv/JSU18YG8IPFrcQA=";
|
2022-02-20 05:27:41 +00:00
|
|
|
};
|
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
vendorHash = null;
|
2022-02-20 05:27:41 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [ gawk ];
|
2022-08-12 12:06:08 +00:00
|
|
|
|
2022-04-15 01:41:22 +00:00
|
|
|
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"
|
|
|
|
'';
|
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
checkFlags = [
|
|
|
|
"-awk"
|
|
|
|
"${gawk}/bin/gawk"
|
|
|
|
];
|
|
|
|
|
2022-04-15 01:41:22 +00:00
|
|
|
doCheck = (stdenv.system != "aarch64-darwin");
|
2022-02-20 05:27:41 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "POSIX-compliant AWK interpreter written in Go";
|
2022-02-20 05:27:41 +00:00
|
|
|
homepage = "https://benhoyt.com/writings/goawk/";
|
|
|
|
license = licenses.mit;
|
|
|
|
mainProgram = "goawk";
|
|
|
|
maintainers = with maintainers; [ abbe ];
|
|
|
|
};
|
|
|
|
}
|