2021-02-05 17:12:51 +00:00
|
|
|
{ lib
|
2022-01-27 00:19:43 +00:00
|
|
|
, stdenv
|
2021-01-05 17:05:55 +00:00
|
|
|
, callPackage
|
2022-12-17 10:02:37 +00:00
|
|
|
, python27
|
2021-01-05 17:05:55 +00:00
|
|
|
, installShellFiles
|
2021-09-26 12:46:18 +00:00
|
|
|
, rSrc
|
|
|
|
, version
|
|
|
|
, oildev
|
2022-12-17 10:02:37 +00:00
|
|
|
, configargparse
|
2021-09-26 12:46:18 +00:00
|
|
|
, binlore
|
2023-01-20 10:41:00 +00:00
|
|
|
, resholve
|
2022-04-15 01:41:22 +00:00
|
|
|
, resholve-utils
|
2021-01-05 17:05:55 +00:00
|
|
|
}:
|
2021-09-26 12:46:18 +00:00
|
|
|
|
2022-12-17 10:02:37 +00:00
|
|
|
python27.pkgs.buildPythonApplication {
|
2021-01-05 17:05:55 +00:00
|
|
|
pname = "resholve";
|
|
|
|
inherit version;
|
|
|
|
src = rSrc;
|
|
|
|
|
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
|
2022-01-27 00:19:43 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
oildev
|
2022-12-17 10:02:37 +00:00
|
|
|
configargparse
|
2022-01-27 00:19:43 +00:00
|
|
|
];
|
2021-01-05 17:05:55 +00:00
|
|
|
|
2022-10-06 18:32:54 +00:00
|
|
|
postPatch = ''
|
2022-04-15 01:41:22 +00:00
|
|
|
for file in setup.cfg _resholve/version.py; do
|
2021-01-05 17:05:55 +00:00
|
|
|
substituteInPlace $file --subst-var-by version ${version}
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
2022-10-06 18:32:54 +00:00
|
|
|
postInstall = ''
|
2021-01-05 17:05:55 +00:00
|
|
|
installManPage resholve.1
|
|
|
|
'';
|
|
|
|
|
2021-02-05 17:12:51 +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-15 01:41:22 +00:00
|
|
|
passthru = {
|
|
|
|
inherit (resholve-utils) mkDerivation phraseSolution writeScript writeScriptBin;
|
2023-01-20 10:41:00 +00:00
|
|
|
tests = callPackage ./test.nix { inherit rSrc binlore python27 resholve; };
|
2022-04-15 01:41:22 +00:00
|
|
|
};
|
2021-09-26 12:46:18 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2021-01-05 17:05:55 +00:00
|
|
|
description = "Resolve external shell-script dependencies";
|
|
|
|
homepage = "https://github.com/abathur/resholve";
|
|
|
|
license = with licenses; [ mit ];
|
|
|
|
maintainers = with maintainers; [ abathur ];
|
|
|
|
platforms = platforms.all;
|
2023-01-20 10:41:00 +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 17:05:55 +00:00
|
|
|
};
|
|
|
|
}
|