about summary refs log tree commit diff
path: root/pkgs/by-name/yt/ytree/package.nix
blob: e61a5f2b971d496956e383ee0c73b32c94993c83 (plain) (blame)
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
{ lib
, stdenv
, fetchurl
, ncurses
, readline
}:

stdenv.mkDerivation (finalAttrs: {
  pname = "ytree";
  version = "2.06";

  src = fetchurl {
    url = "https://han.de/~werner/ytree-${finalAttrs.version}.tar.gz";
    hash = "sha256-QRqI779ZnnytVUC7A7Zt0zyWexRwBnp+CVQcNvnvWeY=";
  };

  patches = [
    # Two fixups (because diff files can't be smaller):
    # - Create PREFIX instead of using DESTDIR
    # - use gzip without timestamp, to improve reproducibility
    ./0001-use-prefix-and-gzip-n.diff
  ];

  buildInputs = [
    ncurses
    readline
  ];

  makeFlags = [ "CC=${stdenv.cc.targetPrefix}cc" ];

  installFlags = [ "PREFIX=${placeholder "out"}" ];

  preInstall = ''
    mkdir -p $out/bin $out/share/man/man1
  '';

  meta = {
    homepage = "https://www.han.de/~werner/ytree.html";
    description = "Curses-based file manager similar to DOS Xtree(TM)";
    license = with lib.licenses; [ gpl2Plus ];
    mainProgram = "ytree";
    maintainers = with lib.maintainers; [ AndersonTorres ];
    platforms = lib.platforms.unix;
  };
})
# TODO: X11 support