2021-02-28 13:59:34 +01:00
|
|
|
{ lib, stdenv, fetchFromGitHub, bison, buildPackages }:
|
2017-07-27 16:06:01 +02:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2020-05-07 18:01:42 +02:00
|
|
|
pname = "nawk";
|
2021-02-28 13:59:34 +01:00
|
|
|
version = "unstable-2021-02-15";
|
2017-07-27 16:06:01 +02:00
|
|
|
|
2020-05-07 18:01:42 +02:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "onetrueawk";
|
|
|
|
repo = "awk";
|
2021-02-28 13:59:34 +01:00
|
|
|
rev = "c0f4e97e4561ff42544e92512bbaf3d7d1f6a671";
|
|
|
|
sha256 = "kQCvItpSJnDJMDvlB8ruY+i0KdjmAphRDqCKw8f0m/8=";
|
2017-07-27 16:06:01 +02:00
|
|
|
};
|
|
|
|
|
2021-02-28 13:59:34 +01:00
|
|
|
depsBuildBuild = [ buildPackages.stdenv.cc ];
|
|
|
|
nativeBuildInputs = [ bison ];
|
|
|
|
makeFlags = [
|
|
|
|
"CC=${stdenv.cc.targetPrefix}cc"
|
|
|
|
"HOSTCC=${if stdenv.buildPlatform.isDarwin then "clang" else "cc"}"
|
|
|
|
];
|
2017-07-27 16:06:01 +02:00
|
|
|
|
|
|
|
installPhase = ''
|
2021-02-28 13:59:34 +01:00
|
|
|
runHook preInstall
|
2017-07-27 16:06:01 +02:00
|
|
|
install -Dm755 a.out "$out/bin/nawk"
|
|
|
|
install -Dm644 awk.1 "$out/share/man/man1/nawk.1"
|
2021-02-28 13:59:34 +01:00
|
|
|
runHook postInstall
|
2017-07-27 16:06:01 +02:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "The one, true implementation of AWK";
|
|
|
|
longDescription = ''
|
|
|
|
This is the version of awk described in "The AWK Programming
|
|
|
|
Language", by Al Aho, Brian Kernighan, and Peter Weinberger
|
|
|
|
(Addison-Wesley, 1988, ISBN 0-201-07981-X).
|
|
|
|
'';
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "https://www.cs.princeton.edu/~bwk/btl.mirror/";
|
2021-01-15 10:19:50 +01:00
|
|
|
license = lib.licenses.mit;
|
|
|
|
maintainers = [ lib.maintainers.konimex ];
|
2021-02-28 13:59:34 +01:00
|
|
|
platforms = lib.platforms.all;
|
2017-07-27 16:06:01 +02:00
|
|
|
};
|
|
|
|
}
|