3
0
Fork 0
forked from mirrors/nixpkgs

Merge pull request #206427 from deejayem/add-fzf-git-sh

This commit is contained in:
Sandro 2022-12-21 20:36:51 +01:00 committed by GitHub
commit 95e7c264d9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 66 additions and 0 deletions

View file

@ -0,0 +1,64 @@
{ stdenv
, lib
, bash
, bat
, coreutils
, fetchFromGitHub
, findutils
, fzf
, gawk
, git
, gnugrep
, gnused
, tmux
, util-linux
, xdg-utils
}:
stdenv.mkDerivation rec {
pname = "fzf-git-sh";
version = "unstable-2022-09-30";
src = fetchFromGitHub {
owner = "junegunn";
repo = "fzf-git.sh";
rev = "9190e1bf7273d85f435fa759a5c3b20e588e9f7e";
sha256 = "sha256-2CGjk1oTXip+eAJMuOk/X3e2KTwfwzcKTcGToA2xPd4=";
};
dontBuild = true;
postPatch = ''
sed -i \
-e "s,\bawk\b,${gawk}/bin/awk," \
-e "s,\bbash\b,${bash}/bin/bash," \
-e "s,\bbat\b,${bat}/bin/bat," \
-e "s,\bcat\b,${coreutils}/bin/cat," \
-e "s,\bcut\b,${coreutils}/bin/cut," \
-e "s,\bhead\b,${coreutils}/bin/head," \
-e "s,\buniq\b,${coreutils}/bin/uniq," \
-e "s,\bcolumn\b,${util-linux}/bin/column," \
-e "s,\bfzf-tmux\b,${fzf}/bin/fzf-tmux," \
-e "/display-message/!s,\bgit\b,${git}/bin/git,g" \
-e "s,\bgrep\b,${gnugrep}/bin/grep," \
-e "s,\bsed\b,${gnused}/bin/sed," \
-e "/fzf-tmux/!s,\btmux\b,${tmux}/bin/tmux," \
-e "s,\bxargs\b,${findutils}/bin/xargs," \
-e "s,\bxdg-open\b,${xdg-utils}/bin/xdg-open," \
-e "s,__fzf_git=.*BASH_SOURCE.*,__fzf_git=$out/share/${pname}/fzf-git.sh," \
-e "/__fzf_git=.*readlink.*/d" \
fzf-git.sh
'';
installPhase = ''
install -D fzf-git.sh $out/share/${pname}/fzf-git.sh
'';
meta = with lib; {
homepage = "https://github.com/junegunn/fzf-git.sh";
description = "Bash and zsh key bindings for Git objects, powered by fzf";
license = licenses.mit;
maintainers = with maintainers; [ deejayem ];
platforms = platforms.all;
};
}

View file

@ -13568,6 +13568,8 @@ with pkgs;
fishPlugins = recurseIntoAttrs (callPackage ../shells/fish/plugins { });
fzf-git-sh = callPackage ../shells/fzf-git-sh {};
ion = callPackage ../shells/ion {
inherit (darwin) Security;
};