2021-01-12 00:50:37 +00:00
|
|
|
{ lib
|
2021-01-05 16:56:59 +00:00
|
|
|
, callPackage
|
2022-12-01 23:10:14 +00:00
|
|
|
, python27
|
2024-03-06 04:09:07 +00:00
|
|
|
, fetchFromGitHub
|
2021-01-05 16:56:59 +00:00
|
|
|
, installShellFiles
|
2021-09-16 00:58:49 +00:00
|
|
|
, rSrc
|
|
|
|
, version
|
|
|
|
, oildev
|
2022-12-09 23:11:59 +00:00
|
|
|
, configargparse
|
2024-03-06 04:09:07 +00:00
|
|
|
, gawk
|
2021-09-16 00:58:49 +00:00
|
|
|
, binlore
|
2023-01-10 21:50:29 +00:00
|
|
|
, resholve
|
2022-04-08 06:45:09 +00:00
|
|
|
, resholve-utils
|
2021-01-05 16:56:59 +00:00
|
|
|
}:
|
2021-09-16 00:58:49 +00:00
|
|
|
|
2024-03-06 04:09:07 +00:00
|
|
|
let
|
|
|
|
sedparse = python27.pkgs.buildPythonPackage rec {
|
|
|
|
pname = "sedparse";
|
|
|
|
version = "0.1.2";
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "aureliojargas";
|
|
|
|
repo = "sedparse";
|
|
|
|
rev = "0.1.2";
|
|
|
|
hash = "sha256-Q17A/oJ3GZbdSK55hPaMdw85g43WhTW9tuAuJtDfHHU=";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
in python27.pkgs.buildPythonApplication {
|
2021-01-05 16:56:59 +00:00
|
|
|
pname = "resholve";
|
|
|
|
inherit version;
|
|
|
|
src = rSrc;
|
|
|
|
|
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
|
2022-01-27 01:37:34 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
oildev
|
2022-12-09 23:11:59 +00:00
|
|
|
configargparse
|
2024-03-06 04:09:07 +00:00
|
|
|
sedparse
|
|
|
|
];
|
|
|
|
|
|
|
|
makeWrapperArgs = [
|
|
|
|
"--prefix PATH : ${lib.makeBinPath [ gawk ]}"
|
2022-01-27 01:37:34 +00:00
|
|
|
];
|
2021-01-05 16:56:59 +00:00
|
|
|
|
2022-10-04 11:41:56 +00:00
|
|
|
postPatch = ''
|
2022-04-08 06:45:09 +00:00
|
|
|
for file in setup.cfg _resholve/version.py; do
|
2021-01-05 16:56:59 +00:00
|
|
|
substituteInPlace $file --subst-var-by version ${version}
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
2022-10-04 11:41:56 +00:00
|
|
|
postInstall = ''
|
2021-01-05 16:56:59 +00:00
|
|
|
installManPage resholve.1
|
|
|
|
'';
|
|
|
|
|
2021-01-12 00:50:37 +00:00
|
|
|
# Do not propagate Python; may be obsoleted by nixos/nixpkgs#102613
|
|
|
|
# for context on why, see abathur/resholve#20
|
|
|
|
postFixup = ''
|
|
|
|
rm $out/nix-support/propagated-build-inputs
|
|
|
|
'';
|
|
|
|
|
2022-04-08 06:45:09 +00:00
|
|
|
passthru = {
|
|
|
|
inherit (resholve-utils) mkDerivation phraseSolution writeScript writeScriptBin;
|
2023-01-10 21:50:29 +00:00
|
|
|
tests = callPackage ./test.nix { inherit rSrc binlore python27 resholve; };
|
2022-04-08 06:45:09 +00:00
|
|
|
};
|
2021-09-16 00:58:49 +00:00
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2021-01-05 16:56:59 +00:00
|
|
|
description = "Resolve external shell-script dependencies";
|
|
|
|
homepage = "https://github.com/abathur/resholve";
|
2024-10-04 19:35:12 +00:00
|
|
|
changelog = "https://github.com/abathur/resholve/blob/v${version}/CHANGELOG.md";
|
2021-01-05 16:56:59 +00:00
|
|
|
license = with licenses; [ mit ];
|
|
|
|
maintainers = with maintainers; [ abathur ];
|
|
|
|
platforms = platforms.all;
|
2023-01-10 18:21:04 +00:00
|
|
|
knownVulnerabilities = [ ''
|
|
|
|
resholve depends on python27 (EOL). While it's safe to
|
|
|
|
run on trusted input in the build sandbox, you should
|
|
|
|
avoid running it on untrusted input.
|
|
|
|
'' ];
|
2021-01-05 16:56:59 +00:00
|
|
|
};
|
|
|
|
}
|