1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 coreutils,
6 findutils,
7 gitMinimal,
8 gnugrep,
9 gnused,
10 makeWrapper,
11}:
12
13stdenv.mkDerivation rec {
14 pname = "helm-git";
15 version = "1.4.0";
16
17 src = fetchFromGitHub {
18 owner = "aslafy-z";
19 repo = pname;
20 rev = "v${version}";
21 sha256 = "sha256-/J/RAFNsxwG9aiCe28daJmC2D6Gz7CrPjucqkhC++y0=";
22 };
23
24 nativeBuildInputs = [ makeWrapper ];
25
26 # NOTE: helm-git is comprised of shell scripts.
27 dontBuild = true;
28
29 installPhase = ''
30 install -dm755 $out/helm-git
31 install -m644 -Dt $out/helm-git plugin.yaml
32 cp helm-git helm-git-plugin.sh $out/helm-git/
33
34 patchShebangs $out/helm-git/helm-git{,-plugin.sh}
35 wrapProgram $out/helm-git/helm-git \
36 --prefix PATH : ${
37 lib.makeBinPath [
38 coreutils
39 findutils
40 gitMinimal
41 gnugrep
42 gnused
43 ]
44 }
45
46 runHook postInstall
47 '';
48
49 meta = with lib; {
50 description = "Helm downloader plugin that provides GIT protocol support";
51 homepage = "https://github.com/aslafy-z/helm-git";
52 license = licenses.mit;
53 maintainers = with maintainers; [ flokli ];
54 };
55}