Skip to content

Commit

Permalink
nawk: refactor
Browse files Browse the repository at this point in the history
- Align lists
- Rename manpage (to avoid clash)
- Convert to rec-less overlay-style overridable recursive attributes (operative
  since #119942)
  • Loading branch information
AndersonTorres committed Sep 12, 2023
1 parent 35d219e commit f3f0a4d
Showing 1 changed file with 24 additions and 11 deletions.
35 changes: 24 additions & 11 deletions pkgs/by-name/na/nawk/package.nix
Original file line number Diff line number Diff line change
@@ -1,18 +1,29 @@
{ lib, stdenv, fetchFromGitHub, bison, buildPackages, installShellFiles }:
{ lib
, stdenv
, fetchFromGitHub
, bison
, buildPackages
, installShellFiles
}:

stdenv.mkDerivation rec {
stdenv.mkDerivation (finalAttrs: {
pname = "nawk";
version = "20230909";

src = fetchFromGitHub {
owner = "onetrueawk";
repo = "awk";
rev = version;
rev = finalAttrs.version;
hash = "sha256-sBJ+ToFkhU5Ei84nqzbS0bUbsa+60iLSz2oeV5+PXEk=";
};

depsBuildBuild = [ buildPackages.stdenv.cc ];
nativeBuildInputs = [ bison installShellFiles ];

nativeBuildInputs = [
bison
installShellFiles
];

makeFlags = [
"CC=${stdenv.cc.targetPrefix}cc"
"HOSTCC=${if stdenv.buildPlatform.isDarwin then "clang" else "cc"}"
Expand All @@ -21,20 +32,22 @@ stdenv.mkDerivation rec {
installPhase = ''
runHook preInstall
install -Dm755 a.out "$out/bin/nawk"
installManPage awk.1
mv awk.1 nawk.1
installManPage nawk.1
runHook postInstall
'';

meta = {
homepage = "https://github.com/onetrueawk/awk";
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).
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).
'';
homepage = "https://www.cs.princeton.edu/~bwk/btl.mirror/";
changelog = "https://github.com/onetrueawk/awk/blob/${finalAttrs.src.rev}/ChangeLog";
license = lib.licenses.mit;
maintainers = [ lib.maintainers.konimex ];
maintainers = with lib.maintainers; [ AndersonTorres konimex ];
platforms = lib.platforms.all;
};
}
})

0 comments on commit f3f0a4d

Please sign in to comment.