buildPython*: bring back buildPython*.override

Fix `makeOverridablePythonPackage` in python-package-base.nix
and unshadow `buildPython*.override`.

This makes it possible to override the dependencies of buildPython*.
E.g., `buildPythonPackage.override { unzip = unzip-custom; }`
returns a derived version of `buildPythonPackage` with
the `unzip` package overridden with `unzip-custom`.
This commit is contained in:
Yueh-Shun Li
2024-12-20 00:30:50 +08:00
parent 55d08bb886
commit cce0f3f300

View File

@@ -38,7 +38,12 @@ let
}
else
result
);
)
// lib.optionalAttrs (f ? override) {
# Support overriding `f` itself, e.g. `buildPythonPackage.override { }`.
# Ensure `makeOverridablePythonPackage` is applied to the result.
override = lib.mirrorFunctionArgs f.override (fdrv: makeOverridablePythonPackage (f.override fdrv));
};
mkPythonDerivation =
if python.isPy3k then ./mk-python-derivation.nix else ./python2/mk-python-derivation.nix;