git.iko.soy/typeable/nixpkgs
on master help sign in
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.

commitc6588dd34103bcef573c2afaba40748076296d6f authorEmmanuel Rosa <emmanuelrosa@protonmail.com> dateMon 2 Dec 2019, 17:45 (7 years ago) parenta2f9bcd
2 files changed+26−6
pkgs/applications/misc/vifm/default.nix+21−6 pkgs/top-level/all-packages.nix+5
pkgs/applications/misc/vifm/default.nix+21−6
@@ -1,11 +1,15 @@
1−{ stdenv, fetchurl
1+{ stdenv, fetchurl, makeWrapper
22, pkgconfig
33, ncurses, libX11
44, 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
58}:
69
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";
913 version = "0.10.1";
1014
1115 src = fetchurl {
@@ -13,13 +17,24 @@ stdenv.mkDerivation rec {
1317 sha256 = "0fyhxh7ndjn8fyjhj14ymkr3pjcs3k1xbs43g7xvvq85vdb6y04r";
1418 };
1519
16− nativeBuildInputs = [ pkgconfig ];
20+ nativeBuildInputs = [ pkgconfig makeWrapper ];
1721 buildInputs = [ ncurses libX11 utillinux file which groff ];
1822
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+
1934 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 ""}'';
2136 maintainers = with maintainers; [ raskin ];
22− platforms = platforms.unix;
37+ platforms = if mediaSupport then platforms.linux else platforms.unix;
2338 license = licenses.gpl2;
2439 downloadPage = "https://vifm.info/downloads.shtml";
2540 homepage = https://vifm.info/;
pkgs/top-level/all-packages.nix+5
@@ -6942,6 +6942,11 @@ in
69426942
69436943 vifm = callPackage ../applications/misc/vifm { };
69446944
6945+ vifm-full = callPackage ../applications/misc/vifm {
6946+ mediaSupport = true;
6947+ inherit lib udisks2 python3;
6948+ };
6949+
69456950 viking = callPackage ../applications/misc/viking {
69466951 inherit (gnome2) scrollkeeper;
69476952 };