summaryrefslogtreecommitdiff
path: root/pkgs/tools/misc/moreutils/default.nix
blob: a239fee834e88261be9be9bb0d5a55626a00d33f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
{
  lib,
  stdenv,
  fetchgit,
  libxml2,
  libxslt,
  docbook-xsl,
  docbook_xml_dtd_44,
  makeWrapper,
  parallel, # for its priority
  perl, # for pod2man
  cctools,
  gitUpdater,
}:

stdenv.mkDerivation rec {
  pname = "moreutils";
  version = "0.70";

  src = fetchgit {
    url = "git://git.joeyh.name/moreutils";
    tag = version;
    hash = "sha256-71ACHzzk258U4q2L7GJ59mrMZG99M7nQkcH4gHafGP0=";
  };

  strictDeps = true;
  nativeBuildInputs = [
    makeWrapper
    perl
    libxml2
    libxslt
    docbook-xsl
    docbook_xml_dtd_44
  ];
  buildInputs = [
    (perl.withPackages (p: [
      p.IPCRun
      p.TimeDate
      p.TimeDuration
    ]))
  ]
  ++ lib.optionals stdenv.hostPlatform.isDarwin [
    cctools
  ];

  makeFlags = [
    "CC=${stdenv.cc.targetPrefix}cc"
    "DOCBOOKXSL=${docbook-xsl}/xml/xsl/docbook"
    "INSTALL_BIN=install"
    "PREFIX=${placeholder "out"}"
  ];

  passthru.updateScript = gitUpdater {
    # No nicer place to find latest release.
    url = "git://git.joeyh.name/moreutils";
  };

  meta = {
    description = "Growing collection of the unix tools that nobody thought to write long ago when unix was young";
    homepage = "https://joeyh.name/code/moreutils/";
    maintainers = with lib.maintainers; [
      koral
      pSub
    ];
    platforms = lib.platforms.all;
    license = lib.licenses.gpl2Plus;

    # If somebody explicitly installs GNU parallel, they probably want
    # its parallel executable instead of moreutils'.
    priority = (parallel.meta.priority or lib.meta.defaultPriority) + 1;
  };
}