about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/misc/ranger/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/applications/misc/ranger/default.nix')
-rw-r--r--nixpkgs/pkgs/applications/misc/ranger/default.nix30
1 files changed, 8 insertions, 22 deletions
diff --git a/nixpkgs/pkgs/applications/misc/ranger/default.nix b/nixpkgs/pkgs/applications/misc/ranger/default.nix
index 8394fd4c5343..10ea22a1eca0 100644
--- a/nixpkgs/pkgs/applications/misc/ranger/default.nix
+++ b/nixpkgs/pkgs/applications/misc/ranger/default.nix
@@ -1,12 +1,8 @@
-{ stdenv, lib, fetchFromGitHub, python3Packages, file, less, highlight
-, imagePreviewSupport ? true, w3m ? null}:
-
-with lib;
-
-assert imagePreviewSupport -> w3m != null;
+{ lib, fetchFromGitHub, python3Packages, file, less, highlight
+, imagePreviewSupport ? true, w3m }:
 
 python3Packages.buildPythonApplication rec {
-  name = "ranger-${version}";
+  pname = "ranger";
   version = "1.9.3";
 
   src = fetchFromGitHub {
@@ -18,34 +14,24 @@ python3Packages.buildPythonApplication rec {
 
   LC_ALL = "en_US.UTF-8";
 
-  checkInputs = with python3Packages; [ pytest ];
+  checkInputs = with python3Packages; [ pytestCheckHook ];
   propagatedBuildInputs = [ file ]
     ++ lib.optionals (imagePreviewSupport) [ python3Packages.pillow ];
 
-  checkPhase = ''
-    py.test tests
-  '';
-
   preConfigure = ''
     ${lib.optionalString (highlight != null) ''
       sed -i -e 's|^\s*highlight\b|${highlight}/bin/highlight|' \
         ranger/data/scope.sh
     ''}
 
-    substituteInPlace ranger/data/scope.sh \
-      --replace "/bin/echo" "echo"
-
     substituteInPlace ranger/__init__.py \
       --replace "DEFAULT_PAGER = 'less'" "DEFAULT_PAGER = '${lib.getBin less}/bin/less'"
 
-    for i in ranger/config/rc.conf doc/config/rc.conf ; do
-      substituteInPlace $i --replace /usr/share $out/share
-    done
-
     # give file previews out of the box
     substituteInPlace ranger/config/rc.conf \
+      --replace /usr/share $out/share \
       --replace "#set preview_script ~/.config/ranger/scope.sh" "set preview_script $out/share/doc/ranger/config/scope.sh"
-  '' + optionalString imagePreviewSupport ''
+  '' + lib.optionalString imagePreviewSupport ''
     substituteInPlace ranger/ext/img_display.py \
       --replace /usr/lib/w3m ${w3m}/libexec/w3m
 
@@ -57,8 +43,8 @@ python3Packages.buildPythonApplication rec {
   meta =  with lib; {
     description = "File manager with minimalistic curses interface";
     homepage = "http://ranger.github.io/";
-    license = licenses.gpl3;
+    license = licenses.gpl3Only;
     platforms = platforms.unix;
-    maintainers = [ maintainers.toonn maintainers.magnetophon ];
+    maintainers = with maintainers; [ toonn magnetophon ];
   };
 }