argbash: refactor

Also, take maintenace to myself.
This commit is contained in:
Anderson Torres 2023-03-31 23:12:17 -03:00
parent 71a398f0e8
commit 1a250d7b10

View file

@ -1,39 +1,50 @@
{ lib, stdenv, fetchFromGitHub, autoconf, runtimeShell, python3Packages, makeWrapper }:
{ lib
, stdenv
, fetchFromGitHub
, autoconf
, makeWrapper
, python3Packages
, runtimeShell
}:
stdenv.mkDerivation rec {
stdenv.mkDerivation (self: {
pname = "argbash";
version = "2.10.0";
src = fetchFromGitHub {
owner = "matejak";
repo = "argbash";
rev = version;
sha256 = "1xdhpbnc0xjv6ydcm122hhdjcl77jhiqnccjfqjp3cd1lfmzvg8v";
rev = self.version;
hash = "sha256-G739q6OhsXEldpIxiyOU51AmG4RChMqaN1t2wOy6sPU=";
};
sourceRoot = "source/resources";
postPatch = ''
chmod -R +w ..
patchShebangs ..
substituteInPlace Makefile \
patchShebangs .
substituteInPlace resources/Makefile \
--replace '/bin/bash' "${runtimeShell}"
'';
nativeBuildInputs = [ autoconf python3Packages.docutils makeWrapper ];
nativeBuildInputs = [
autoconf
makeWrapper
python3Packages.docutils
];
makeFlags = [ "PREFIX=$(out)" ];
makeFlags = [
"-C" "resources"
"PREFIX=$(out)"
];
postInstall = ''
wrapProgram $out/bin/argbash \
--prefix PATH : '${autoconf}/bin'
'';
meta = with lib; {
description = "Bash argument parsing code generator";
meta = {
homepage = "https://argbash.io/";
license = licenses.free; # custom license. See LICENSE in source repo.
maintainers = with maintainers; [ rencire ];
description = "Bash argument parsing code generator";
license = lib.licenses.bsd3;
maintainers = with lib.maintainers; [ AndersonTorres ];
platforms = lib.platforms.all;
};
}
})