2023-09-12 01:30:44 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, bison
|
|
|
|
, buildPackages
|
|
|
|
, installShellFiles
|
|
|
|
}:
|
2017-07-27 14:06:01 +00:00
|
|
|
|
2023-09-12 01:30:44 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2020-05-07 16:01:42 +00:00
|
|
|
pname = "nawk";
|
2023-09-19 19:29:42 +00:00
|
|
|
version = "20230911";
|
2017-07-27 14:06:01 +00:00
|
|
|
|
2020-05-07 16:01:42 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "onetrueawk";
|
|
|
|
repo = "awk";
|
2023-09-19 19:29:42 +00:00
|
|
|
rev = "2ndEdition";
|
|
|
|
hash = "sha256-9SxeYsTFrsJ+Cg43QjQihi2Ij0qdJvTnyGGhUHJHjuU=";
|
2017-07-27 14:06:01 +00:00
|
|
|
};
|
|
|
|
|
2021-02-28 12:59:34 +00:00
|
|
|
depsBuildBuild = [ buildPackages.stdenv.cc ];
|
2023-09-12 01:30:44 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
bison
|
|
|
|
installShellFiles
|
|
|
|
];
|
|
|
|
|
|
|
|
outputs = [ "out" "man" ];
|
|
|
|
|
2021-02-28 12:59:34 +00:00
|
|
|
makeFlags = [
|
|
|
|
"CC=${stdenv.cc.targetPrefix}cc"
|
|
|
|
"HOSTCC=${if stdenv.buildPlatform.isDarwin then "clang" else "cc"}"
|
|
|
|
];
|
2017-07-27 14:06:01 +00:00
|
|
|
|
|
|
|
installPhase = ''
|
2021-02-28 12:59:34 +00:00
|
|
|
runHook preInstall
|
2017-07-27 14:06:01 +00:00
|
|
|
install -Dm755 a.out "$out/bin/nawk"
|
2023-09-12 01:30:44 +00:00
|
|
|
mv awk.1 nawk.1
|
|
|
|
installManPage nawk.1
|
2021-02-28 12:59:34 +00:00
|
|
|
runHook postInstall
|
2017-07-27 14:06:01 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
2023-09-20 08:10:28 +00:00
|
|
|
homepage = "https://awk.dev";
|
2017-07-27 14:06:01 +00:00
|
|
|
description = "The one, true implementation of AWK";
|
|
|
|
longDescription = ''
|
2023-09-19 19:29:42 +00:00
|
|
|
This is the version of awk described in "The AWK Programming Language",
|
|
|
|
Second Edition, by Al Aho, Brian Kernighan, and Peter Weinberger
|
|
|
|
(Addison-Wesley, 2023, ISBN 0-13-826972-6).
|
2017-07-27 14:06:01 +00:00
|
|
|
'';
|
2023-09-12 01:30:44 +00:00
|
|
|
changelog = "https://github.com/onetrueawk/awk/blob/${finalAttrs.src.rev}/ChangeLog";
|
2021-01-15 09:19:50 +00:00
|
|
|
license = lib.licenses.mit;
|
2023-09-12 01:30:44 +00:00
|
|
|
mainProgram = "nawk";
|
|
|
|
maintainers = with lib.maintainers; [ AndersonTorres konimex ];
|
2021-02-28 12:59:34 +00:00
|
|
|
platforms = lib.platforms.all;
|
2017-07-27 14:06:01 +00:00
|
|
|
};
|
2023-09-12 01:30:44 +00:00
|
|
|
})
|