4 # This is essentially the same thing as `lib.makeOverridable`, except storing
5 # the override method in a method named `overridePackage` so that it's not
6 # shadowed by the `override` method added by `callPackage`
7 makePackageOverridable = f: args:
9 result = lib.makeOverridable f args;
11 copyArgs = g: lib.setFunctionArgs g (lib.functionArgs f);
14 update: args // (if lib.isFunction update then update args else update);
17 copyArgs (update: makePackageOverridable f (overrideWith update));
20 result // { inherit overridePackage; };
24 inherit makePackageOverridable;