Merge pull request #28779 from vyp/deer

deer: init at 1.4
This commit is contained in:
Jörg Thalheim 2017-08-31 07:06:57 +01:00 committed by GitHub
commit 95d9a6c0aa
3 changed files with 65 additions and 0 deletions

View File

@ -0,0 +1,35 @@
{ stdenv, fetchFromGitHub, perl }:
let
version = "1.4";
name = "deer-${version}";
in stdenv.mkDerivation {
inherit name;
src = fetchFromGitHub {
owner = "Vifon";
repo = "deer";
rev = "v${version}";
sha256 = "1xnbnbi0zk2xsyn8dqsmyxqlfnl36pb1wwibnlp0dxixw6sfymyl";
};
prePatch = ''
substituteInPlace deer \
--replace " perl " " ${perl}/bin/perl "
'';
patches = [ ./realpath.patch ];
installPhase = ''
mkdir -p $out/share/zsh/site-functions/
cp deer $out/share/zsh/site-functions/
'';
meta = with stdenv.lib; {
description = "Ranger-like file navigation for zsh";
homepage = "https://github.com/Vifon/deer";
license = licenses.gpl3Plus;
maintainers = maintainers.vyp;
platforms = platforms.unix;
};
}

View File

@ -0,0 +1,28 @@
From ceadb2f11119143af4f590ea6b05a531483219b5 Mon Sep 17 00:00:00 2001
From: xd1le <elisp.vim@gmail.com>
Date: Wed, 30 Aug 2017 17:27:20 +1000
Subject: [PATCH] use realpath instead of python to calculate relative path
---
deer | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/deer b/deer
index 3d89dea..804a871 100644
--- a/deer
+++ b/deer
@@ -259,10 +259,7 @@ deer-get-relative()
{
local TMP
TMP=${1:-${DEER_DIRNAME%/}/$DEER_BASENAME[$DEER_DIRNAME]}
- TMP="`python -c '
-import sys, os
-print(os.path.relpath(sys.argv[1], sys.argv[2]))
-' $TMP ${DEER_STARTDIR:-$PWD}`"
+ TMP="`realpath --relative-to=${DEER_STARTDIR:-$PWD} $TMP`"
print -R $TMP:q
}
--
2.14.1

View File

@ -1615,6 +1615,8 @@ with pkgs;
debootstrap = callPackage ../tools/misc/debootstrap { };
deer = callPackage ../shells/zsh-deer { };
detox = callPackage ../tools/misc/detox { };
devilspie2 = callPackage ../applications/misc/devilspie2 {