2020-04-24 23:36:52 +00:00
|
|
|
{ stdenv, fetchurl, makeWrapper
|
2021-02-05 17:12:51 +00:00
|
|
|
, pkg-config
|
2020-04-24 23:36:52 +00:00
|
|
|
, ncurses, libX11
|
2020-11-24 20:58:05 +00:00
|
|
|
, util-linux, file, which, groff
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
# adds support for handling removable media (vifm-media). Linux only!
|
2020-10-07 09:15:18 +00:00
|
|
|
, mediaSupport ? false, python3 ? null, udisks2 ? null, lib ? null
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
let isFullPackage = mediaSupport;
|
|
|
|
in stdenv.mkDerivation rec {
|
|
|
|
pname = if isFullPackage then "vifm-full" else "vifm";
|
2020-10-07 09:15:18 +00:00
|
|
|
version = "0.11";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://github.com/vifm/vifm/releases/download/v${version}/vifm-${version}.tar.bz2";
|
2020-10-07 09:15:18 +00:00
|
|
|
sha256 = "0rqyd424y0g5b5basw2ybb60r9gar4f40d1xgzr3c2dsy4jpwvyh";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
nativeBuildInputs = [ pkg-config makeWrapper ];
|
2020-11-24 20:58:05 +00:00
|
|
|
buildInputs = [ ncurses libX11 util-linux file which groff ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
postFixup = let
|
2020-10-07 09:15:18 +00:00
|
|
|
path = lib.makeBinPath
|
|
|
|
[ udisks2
|
2020-04-24 23:36:52 +00:00
|
|
|
(python3.withPackages (p: [p.dbus-python]))
|
|
|
|
];
|
|
|
|
|
|
|
|
wrapVifmMedia = "wrapProgram $out/share/vifm/vifm-media --prefix PATH : ${path}";
|
|
|
|
in ''
|
|
|
|
${if mediaSupport then wrapVifmMedia else ""}
|
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2021-01-17 00:15:33 +00:00
|
|
|
description = "A vi-like file manager${if isFullPackage then "; Includes support for optional features" else ""}";
|
2020-04-24 23:36:52 +00:00
|
|
|
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;
|
2021-04-05 15:23:46 +00:00
|
|
|
changelog = "https://github.com/vifm/vifm/blob/v${version}/ChangeLog";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|