1{
2 lib,
3 stdenv,
4 fetchgit,
5 libxml2,
6 libxslt,
7 docbook-xsl,
8 docbook_xml_dtd_44,
9 perlPackages,
10 makeWrapper,
11 perl, # for pod2man
12 cctools,
13 gitUpdater,
14}:
15
16stdenv.mkDerivation rec {
17 pname = "moreutils";
18 version = "0.70";
19
20 src = fetchgit {
21 url = "git://git.joeyh.name/moreutils";
22 tag = version;
23 hash = "sha256-71ACHzzk258U4q2L7GJ59mrMZG99M7nQkcH4gHafGP0=";
24 };
25
26 strictDeps = true;
27 nativeBuildInputs = [
28 makeWrapper
29 perl
30 libxml2
31 libxslt
32 docbook-xsl
33 docbook_xml_dtd_44
34 ];
35 buildInputs = [
36 (perl.withPackages (p: [
37 p.IPCRun
38 p.TimeDate
39 p.TimeDuration
40 ]))
41 ]
42 ++ lib.optionals stdenv.hostPlatform.isDarwin [
43 cctools
44 ];
45
46 makeFlags = [
47 "CC=${stdenv.cc.targetPrefix}cc"
48 "DOCBOOKXSL=${docbook-xsl}/xml/xsl/docbook"
49 "INSTALL_BIN=install"
50 "PREFIX=${placeholder "out"}"
51 ];
52
53 passthru.updateScript = gitUpdater {
54 # No nicer place to find latest release.
55 url = "git://git.joeyh.name/moreutils";
56 };
57
58 meta = with lib; {
59 description = "Growing collection of the unix tools that nobody thought to write long ago when unix was young";
60 homepage = "https://joeyh.name/code/moreutils/";
61 maintainers = with maintainers; [
62 koral
63 pSub
64 ];
65 platforms = platforms.all;
66 license = licenses.gpl2Plus;
67 };
68}