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
|
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;
|
|
|
|
format = "other";
|
2021-09-26 12:46:18 +00:00
|
|
|
dontBuild = true;
|
2021-01-05 17:05:55 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
|
2022-01-27 00:19:43 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
oildev
|
|
|
|
/*
|
|
|
|
Disable configargparse's tests on aarch64-darwin.
|
|
|
|
Several of py27 scandir's tests fail on aarch64-darwin. Chain:
|
|
|
|
configargparse -> pytest-check-hook -> pytest -> pathlib2 -> scandir
|
|
|
|
TODO: drop if https://github.com/NixOS/nixpkgs/issues/156807 resolves?
|
|
|
|
*/
|
|
|
|
(python27Packages.configargparse.overridePythonAttrs (old: {
|
|
|
|
doCheck = stdenv.hostPlatform.system != "aarch64-darwin";
|
|
|
|
}))
|
|
|
|
];
|
2021-01-05 17:05:55 +00:00
|
|
|
|
|
|
|
patchPhase = ''
|
|
|
|
for file in resholve; do
|
|
|
|
substituteInPlace $file --subst-var-by version ${version}
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
install -Dm755 resholve $out/bin/resholve
|
|
|
|
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
|
|
|
|
'';
|
|
|
|
|
2021-09-26 12:46:18 +00:00
|
|
|
passthru.tests = callPackage ./test.nix { inherit rSrc; inherit binlore; };
|
|
|
|
|
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;
|
|
|
|
};
|
|
|
|
}
|