evcc: 0.131.4 -> 0.131.5
[NixPkgs.git] / pkgs / by-name / fz / fzf-git-sh / package.nix
blobe9cda521fb1db31e4536e74893fd89cd85b79886
1 { stdenv
2 , lib
3 , bash
4 , bat
5 , coreutils
6 , fetchFromGitHub
7 , findutils
8 , fzf
9 , gawk
10 , git
11 , gnugrep
12 , gnused
13 , tmux
14 , util-linux
15 , xdg-utils
18 stdenv.mkDerivation rec {
19   pname = "fzf-git-sh";
20   version = "0-unstable-2024-03-17";
22   src = fetchFromGitHub {
23     owner = "junegunn";
24     repo = "fzf-git.sh";
25     rev = "e4cba1fcf8aed9a2348e47b0ba64299122b81709";
26     hash = "sha256-glI+TldLGGiXyI5ZghaEgjc+2DJCMdmBnho/Z7IgJoE=";
27   };
29   dontBuild = true;
31   postPatch = ''
32     sed -i \
33       -e "s,\bawk\b,${gawk}/bin/awk," \
34       -e "s,\bbash\b,${bash}/bin/bash," \
35       -e "s,\bbat\b,${bat}/bin/bat," \
36       -e "s,\bcat\b,${coreutils}/bin/cat," \
37       -e "s,\bcut\b,${coreutils}/bin/cut," \
38       -e "s,\bhead\b,${coreutils}/bin/head," \
39       -e "s,\buniq\b,${coreutils}/bin/uniq," \
40       -e "s,\bcolumn\b,${util-linux}/bin/column," \
41       -e "s,\bfzf-tmux\b,${fzf}/bin/fzf-tmux," \
42       -e "s,\bgrep\b,${gnugrep}/bin/grep," \
43       -e "s,\bsed\b,${gnused}/bin/sed," \
44       -e "/fzf-tmux/!s,\btmux\b,${tmux}/bin/tmux," \
45       -e "s,\bxargs\b,${findutils}/bin/xargs," \
46       -e "s,\bxdg-open\b,${xdg-utils}/bin/xdg-open," \
47       -e "/display-message\|fzf-git-\$o-widget\|\burl=\|\$remote_url =~ /!s,\bgit\b,${git}/bin/git,g" \
48       -e "s,__fzf_git=.*BASH_SOURCE.*,__fzf_git=$out/share/${pname}/fzf-git.sh," \
49       -e "/__fzf_git=.*readlink.*/d" \
50       fzf-git.sh
51   '';
53   installPhase = ''
54     install -D fzf-git.sh $out/share/${pname}/fzf-git.sh
55   '';
57   meta = with lib; {
58     homepage = "https://github.com/junegunn/fzf-git.sh";
59     description = "Bash and zsh key bindings for Git objects, powered by fzf";
60     license = licenses.mit;
61     maintainers = with maintainers; [ deejayem ];
62     platforms = platforms.all;
63   };