1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 autoconf,
6 makeWrapper,
7 python3Packages,
8 runtimeShell,
9}:
10
11stdenv.mkDerivation (finalAttrs: {
12 pname = "argbash";
13 version = "2.11.0";
14
15 src = fetchFromGitHub {
16 owner = "matejak";
17 repo = "argbash";
18 rev = finalAttrs.version;
19 hash = "sha256-B8581sA3dxmHiJqQhmXSChiWaPIFqiLLFUMnwAlCLJs=";
20 };
21
22 postPatch = ''
23 patchShebangs .
24 substituteInPlace resources/Makefile \
25 --replace '/bin/bash' "${runtimeShell}"
26 '';
27
28 nativeBuildInputs = [
29 autoconf
30 makeWrapper
31 python3Packages.docutils
32 ];
33
34 makeFlags = [
35 "-C"
36 "resources"
37 "PREFIX=$(out)"
38 ];
39
40 postInstall = ''
41 wrapProgram $out/bin/argbash \
42 --prefix PATH : '${autoconf}/bin'
43 '';
44
45 meta = {
46 homepage = "https://argbash.dev/";
47 description = "Bash argument parsing code generator";
48 license = lib.licenses.bsd3;
49 maintainers = with lib.maintainers; [ ];
50 platforms = lib.platforms.all;
51 };
52})