ranger: spring cleaning (#466236)
This commit is contained in:
@@ -3,6 +3,8 @@
|
||||
fetchFromGitHub,
|
||||
python3Packages,
|
||||
file,
|
||||
coreutils,
|
||||
bashNonInteractive,
|
||||
less,
|
||||
highlight,
|
||||
w3m,
|
||||
@@ -12,13 +14,13 @@
|
||||
neoVimSupport ? true,
|
||||
improvedEncodingDetection ? true,
|
||||
rightToLeftTextSupport ? false,
|
||||
unstableGitUpdater,
|
||||
nix-update-script,
|
||||
}:
|
||||
|
||||
python3Packages.buildPythonApplication {
|
||||
pname = "ranger";
|
||||
version = "1.9.3-unstable-2025-11-14";
|
||||
format = "setuptools";
|
||||
version = "1.9.4-unstable-2025-11-14";
|
||||
pyproject = true;
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "ranger";
|
||||
@@ -27,29 +29,38 @@ python3Packages.buildPythonApplication {
|
||||
hash = "sha256-vn1rAOFB2vq04Y/WAE44iH/b/zamAmvq8putUKwNqR8=";
|
||||
};
|
||||
|
||||
LC_ALL = "en_US.UTF-8";
|
||||
build-system = with python3Packages; [
|
||||
setuptools
|
||||
];
|
||||
|
||||
dependencies =
|
||||
[ ]
|
||||
++ lib.optionals imagePreviewSupport [ python3Packages.pillow ]
|
||||
++ lib.optionals neoVimSupport [ python3Packages.pynvim ]
|
||||
++ lib.optionals improvedEncodingDetection [ python3Packages.chardet ]
|
||||
++ lib.optionals rightToLeftTextSupport [ python3Packages.python-bidi ];
|
||||
|
||||
nativeCheckInputs = with python3Packages; [
|
||||
pytestCheckHook
|
||||
astroid
|
||||
pylint
|
||||
];
|
||||
propagatedBuildInputs = [
|
||||
less
|
||||
file
|
||||
]
|
||||
++ lib.optionals imagePreviewSupport [ python3Packages.pillow ]
|
||||
++ lib.optionals sixelPreviewSupport [ imagemagick ]
|
||||
++ lib.optionals neoVimSupport [ python3Packages.pynvim ]
|
||||
++ lib.optionals improvedEncodingDetection [ python3Packages.chardet ]
|
||||
++ lib.optionals rightToLeftTextSupport [ python3Packages.python-bidi ];
|
||||
|
||||
preConfigure = ''
|
||||
${lib.optionalString (highlight != null) ''
|
||||
sed -i -e 's|^\s*highlight\b|${highlight}/bin/highlight|' \
|
||||
ranger/data/scope.sh
|
||||
''}
|
||||
makeWrapperArgs = [
|
||||
"--prefix"
|
||||
"PATH"
|
||||
":"
|
||||
(lib.makeBinPath (
|
||||
[
|
||||
file
|
||||
coreutils
|
||||
bashNonInteractive
|
||||
]
|
||||
++ lib.optionals sixelPreviewSupport [ imagemagick ]
|
||||
))
|
||||
];
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace ranger/__init__.py \
|
||||
--replace "DEFAULT_PAGER = 'less'" "DEFAULT_PAGER = '${lib.getBin less}/bin/less'"
|
||||
|
||||
@@ -58,6 +69,10 @@ python3Packages.buildPythonApplication {
|
||||
--replace /usr/share $out/share \
|
||||
--replace "#set preview_script ~/.config/ranger/scope.sh" "set preview_script $out/share/doc/ranger/config/scope.sh"
|
||||
''
|
||||
+ lib.optionalString (highlight != null) ''
|
||||
sed -i -e 's|^\s*highlight\b|${highlight}/bin/highlight|' \
|
||||
ranger/data/scope.sh
|
||||
''
|
||||
+ lib.optionalString imagePreviewSupport ''
|
||||
substituteInPlace ranger/ext/img_display.py \
|
||||
--replace /usr/lib/w3m ${w3m}/libexec/w3m
|
||||
@@ -67,11 +82,13 @@ python3Packages.buildPythonApplication {
|
||||
--replace "set preview_images false" "set preview_images true"
|
||||
'';
|
||||
|
||||
passthru.updateScript = unstableGitUpdater { tagPrefix = "v"; };
|
||||
passthru.updateScript = nix-update-script {
|
||||
extraArgs = [ "--version=branch" ];
|
||||
};
|
||||
|
||||
meta = {
|
||||
description = "File manager with minimalistic curses interface";
|
||||
homepage = "https://ranger.github.io/";
|
||||
homepage = "https://ranger.fm/";
|
||||
license = lib.licenses.gpl3Only;
|
||||
platforms = lib.platforms.unix;
|
||||
maintainers = with lib.maintainers; [
|
||||
|
||||
Reference in New Issue
Block a user