Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)

vifm: add vifm-full package

vifm includes some optional features what are currently no-op due
to missing dependencies. Once such example is `vifm-media`.

vimfm-media is a Linux script included with vifm which can be used to
mount/umount removable media from within vifm. However, vifm-media
has additional dependencies, namely Python, dbus, and a supported
back-end such as udisks2. While vimfm-media is currently installed,
it fails with the error "No supported backend found."

This change adds optional support for vifm-media via the new package
vifm-full; Opening for the opportunity to add whatever optional
dependencies I have not considered in this change in the future,
while not generously increasing the closure size of the original
vifm package.

For reference, vifm has a closure size of 41,164,432 while the new
vifm-full increases this to 382,642,536. Calculated with
`nix path-info -S`

Note: While vifm-media supports numerous back-ends, this change only
adds support for udisks2. In addition, vifm-media is not supported on
MacOS/OSX, for which upstream provides an alternative script.

+26 -6
+21 -6
pkgs/applications/misc/vifm/default.nix
··· 1 - { stdenv, fetchurl 1 + { stdenv, fetchurl, makeWrapper 2 2 , pkgconfig 3 3 , ncurses, libX11 4 4 , utillinux, file, which, groff 5 + 6 + # adds support for handling removable media (vifm-media). Linux only! 7 + , mediaSupport ? false, python3 ? null, udisks2 ? null, lib ? null 5 8 }: 6 9 7 - stdenv.mkDerivation rec { 8 - pname = "vifm"; 10 + let isFullPackage = mediaSupport; 11 + in stdenv.mkDerivation rec { 12 + pname = if isFullPackage then "vifm-full" else "vifm"; 9 13 version = "0.10.1"; 10 14 11 15 src = fetchurl { ··· 13 17 sha256 = "0fyhxh7ndjn8fyjhj14ymkr3pjcs3k1xbs43g7xvvq85vdb6y04r"; 14 18 }; 15 19 16 - nativeBuildInputs = [ pkgconfig ]; 20 + nativeBuildInputs = [ pkgconfig makeWrapper ]; 17 21 buildInputs = [ ncurses libX11 utillinux file which groff ]; 18 22 23 + postFixup = let 24 + path = lib.makeBinPath 25 + [ udisks2 26 + (python3.withPackages (p: [p.dbus-python])) 27 + ]; 28 + 29 + wrapVifmMedia = "wrapProgram $out/share/vifm/vifm-media --prefix PATH : ${path}"; 30 + in '' 31 + ${if mediaSupport then wrapVifmMedia else ""} 32 + ''; 33 + 19 34 meta = with stdenv.lib; { 20 - description = "A vi-like file manager"; 35 + description = ''A vi-like file manager${if isFullPackage then "; Includes support for optional features" else ""}''; 21 36 maintainers = with maintainers; [ raskin ]; 22 - platforms = platforms.unix; 37 + platforms = if mediaSupport then platforms.linux else platforms.unix; 23 38 license = licenses.gpl2; 24 39 downloadPage = "https://vifm.info/downloads.shtml"; 25 40 homepage = https://vifm.info/;
+5
pkgs/top-level/all-packages.nix
··· 6942 6942 6943 6943 vifm = callPackage ../applications/misc/vifm { }; 6944 6944 6945 + vifm-full = callPackage ../applications/misc/vifm { 6946 + mediaSupport = true; 6947 + inherit lib udisks2 python3; 6948 + }; 6949 + 6945 6950 viking = callPackage ../applications/misc/viking { 6946 6951 inherit (gnome2) scrollkeeper; 6947 6952 };