aboutsummaryrefslogtreecommitdiff
path: root/infra/libkookie/nixpkgs/pkgs/development/tools/misc/argbash/default.nix
blob: 0c0511ec7922729d92eccdf8b4b64a9a3499b0f5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
{ stdenv, fetchFromGitHub, autoconf, runtimeShell, python3Packages, makeWrapper }:

stdenv.mkDerivation rec {
  pname = "argbash";

  version = "2.10.0";

  src = fetchFromGitHub {
    owner = "matejak";
    repo = "argbash";
    rev = "${version}";
    sha256 = "1xdhpbnc0xjv6ydcm122hhdjcl77jhiqnccjfqjp3cd1lfmzvg8v";
  };

  sourceRoot = "source/resources";

  postPatch = ''
    chmod -R +w ..
    patchShebangs ..
    substituteInPlace Makefile \
      --replace '/bin/bash' "${runtimeShell}"
  '';

  nativeBuildInputs = [ autoconf python3Packages.docutils makeWrapper ];

  makeFlags = [ "PREFIX=$(out)" ];

  postInstall = ''
    wrapProgram $out/bin/argbash \
      --prefix PATH : '${autoconf}/bin'
  '';

  meta = with stdenv.lib; {
    description = "Bash argument parsing code generator";
    homepage = "https://argbash.io/";
    license = licenses.free; # custom license.  See LICENSE in source repo.
    maintainers = with maintainers; [ rencire ];
  };
}