hy: fix passthru.withPackages

In the previous version it was adding the extra packages as
`propagatedBuildInputs`. This meant that this package would be rebuild
for no reason (it is not like the package will actually depend on the
extra inputs) and also cause the strange side-effect of creating a hy
package without its console entry-points (e.g.: no `$out/bin` contents).

Now we are reusing the `python.withPackages` that will avoid the
unnecessary rebuild, fixing both issues.
This commit is contained in:
Thiago Kenji Okada 2022-10-07 10:10:24 +01:00
parent e265a79d17
commit 450d420811
2 changed files with 6 additions and 11 deletions

View File

@ -10,8 +10,6 @@
, pythonOlder
, rply
, testers
, toPythonApplication
, hyDefinedPythonPackages ? python-packages: [ ] /* Packages like with python.withPackages */
}:
buildPythonPackage rec {
@ -37,10 +35,7 @@ buildPythonPackage rec {
] ++
lib.optionals (pythonOlder "3.9") [
astor
] ++
# for backwards compatibility with removed pkgs/development/interpreters/hy
# See: https://github.com/NixOS/nixpkgs/issues/171428
(hyDefinedPythonPackages python.pkgs);
];
checkInputs = [
pytestCheckHook
@ -63,10 +58,10 @@ buildPythonPackage rec {
package = hy;
command = "hy -v";
};
# also for backwards compatibility with removed pkgs/development/interpreters/hy
withPackages = python-packages: (toPythonApplication hy).override {
hyDefinedPythonPackages = python-packages;
};
# For backwards compatibility with removed pkgs/development/interpreters/hy
# Example usage:
# hy.withPackages (ps: with ps; [ hyrule requests ])
withPackages = python-packages: python.withPackages (ps: (python-packages ps) ++ [ ps.hy ]);
};
meta = with lib; {

View File

@ -37099,7 +37099,7 @@ with pkgs;
simplenote = callPackage ../applications/misc/simplenote { };
hy = python3Packages.hy.withPackages (python-packages: [ ]);
hy = with python3Packages; toPythonApplication hy;
wmic-bin = callPackage ../servers/monitoring/plugins/wmic-bin.nix { };