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";
|
2021-10-17 02:12:59 +00:00
|
|
|
version = "0.12";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://github.com/vifm/vifm/releases/download/v${version}/vifm-${version}.tar.bz2";
|
2021-10-17 02:12:59 +00:00
|
|
|
sha256 = "1h5j4y704nciyzg3aaav8sl3r5h9mpwq8f28cj65nnxk6a7n3a9k";
|
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/";
|
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
|
|
|
};
|
|
|
|
}
|