summary refs log tree commit diff
path: root/pkgs/applications/misc/vifm/default.nix
blob: 531c108cdbf93780427cc59a59b5185344007711 (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
{ stdenv, fetchurl, makeWrapper
, pkg-config
, ncurses, libX11
, util-linux, file, which, groff

  # adds support for handling removable media (vifm-media). Linux only!
, mediaSupport ? false, python3 ? null, udisks2 ? null, lib ? null
}:

let isFullPackage = mediaSupport;
in stdenv.mkDerivation rec {
  pname = if isFullPackage then "vifm-full" else "vifm";
  version = "0.11";

  src = fetchurl {
    url = "https://github.com/vifm/vifm/releases/download/v${version}/vifm-${version}.tar.bz2";
    sha256 = "0rqyd424y0g5b5basw2ybb60r9gar4f40d1xgzr3c2dsy4jpwvyh";
  };

  nativeBuildInputs = [ pkg-config makeWrapper ];
  buildInputs = [ ncurses libX11 util-linux file which groff ];

  postFixup = let
    path = lib.makeBinPath
      [ udisks2
        (python3.withPackages (p: [p.dbus-python]))
      ];

    wrapVifmMedia = "wrapProgram $out/share/vifm/vifm-media --prefix PATH : ${path}";
  in ''
    ${if mediaSupport then wrapVifmMedia else ""}
  '';

  meta = with lib; {
    description = "A vi-like file manager${if isFullPackage then "; Includes support for optional features" else ""}";
    maintainers = with maintainers; [ raskin ];
    platforms = if mediaSupport then platforms.linux else platforms.unix;
    license = licenses.gpl2;
    downloadPage = "https://vifm.info/downloads.shtml";
    homepage = "https://vifm.info/";
    updateWalker = true;
    changelog = "https://github.com/vifm/vifm/blob/v${version}/ChangeLog";
  };
}