From 1a250d7b10feba79bbd35e14b0f639dc580123e3 Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Fri, 31 Mar 2023 23:12:17 -0300 Subject: [PATCH] argbash: refactor Also, take maintenace to myself. --- .../tools/misc/argbash/default.nix | 45 ++++++++++++------- 1 file changed, 28 insertions(+), 17 deletions(-) diff --git a/pkgs/development/tools/misc/argbash/default.nix b/pkgs/development/tools/misc/argbash/default.nix index 571050508146..1b157702b299 100644 --- a/pkgs/development/tools/misc/argbash/default.nix +++ b/pkgs/development/tools/misc/argbash/default.nix @@ -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; }; -} +})