2020-04-24 23:36:52 +00:00
|
|
|
{ stdenv, fetchurl, makeWrapper
|
2023-02-16 17:41:37 +00:00
|
|
|
, perl # used to generate help tags
|
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
|
2023-04-12 12:48:02 +00:00
|
|
|
, gitUpdater
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
let isFullPackage = mediaSupport;
|
|
|
|
in stdenv.mkDerivation rec {
|
|
|
|
pname = if isFullPackage then "vifm-full" else "vifm";
|
2023-04-12 12:48:02 +00:00
|
|
|
version = "0.13";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://github.com/vifm/vifm/releases/download/v${version}/vifm-${version}.tar.bz2";
|
2023-04-12 12:48:02 +00:00
|
|
|
hash = "sha256-DZKTdJp5QHat6Wfs3EfRQdheRQNwWUdlORvfGpvUUHU=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-02-16 17:41:37 +00:00
|
|
|
nativeBuildInputs = [ perl 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
|
|
|
|
2023-02-16 17:41:37 +00:00
|
|
|
postPatch = ''
|
2023-04-12 12:48:02 +00:00
|
|
|
# Avoid '#!/usr/bin/env perl' references to build help.
|
2023-02-16 17:41:37 +00:00
|
|
|
patchShebangs --build src/helpztags
|
|
|
|
'';
|
|
|
|
|
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 ''
|
2023-02-16 17:41:37 +00:00
|
|
|
${lib.optionalString mediaSupport wrapVifmMedia}
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2023-04-12 12:48:02 +00:00
|
|
|
passthru.updateScript = gitUpdater {
|
|
|
|
url = "https://github.com/vifm/vifm.git";
|
|
|
|
rev-prefix = "v";
|
|
|
|
ignoredVersions = "beta";
|
|
|
|
};
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2023-02-16 17:41:37 +00:00
|
|
|
description = "A vi-like file manager${lib.optionalString isFullPackage "; Includes support for optional features"}";
|
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
|
|
|
};
|
|
|
|
}
|