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
|
|
|
|
, python27Packages
|
|
|
|
, installShellFiles
|
2021-09-26 12:46:18 +00:00
|
|
|
, rSrc
|
|
|
|
, version
|
|
|
|
, oildev
|
|
|
|
, binlore
|
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
|
|
|
|
2021-01-05 17:05:55 +00:00
|
|
|
python27Packages.buildPythonApplication {
|
|
|
|
pname = "resholve";
|
|
|
|
inherit version;
|
|
|
|
src = rSrc;
|
|
|
|
|
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
|
2022-01-27 00:19:43 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
oildev
|
2022-10-06 18:32:54 +00:00
|
|
|
python27Packages.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;
|
|
|
|
tests = callPackage ./test.nix { inherit rSrc binlore; };
|
|
|
|
};
|
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;
|
|
|
|
};
|
|
|
|
}
|