mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-09 19:13:26 +03:00
mkDerivation
: support __functor
functions and clean up (#411760)
This commit is contained in:
commit
802d3df5e0
4 changed files with 8 additions and 26 deletions
|
@ -2,7 +2,6 @@
|
|||
|
||||
collectd.overrideAttrs (oldAttrs: {
|
||||
pname = "libcollectdclient";
|
||||
inherit (collectd) version;
|
||||
buildInputs = [ ];
|
||||
|
||||
configureFlags = (oldAttrs.configureFlags or [ ]) ++ [
|
||||
|
|
|
@ -439,6 +439,7 @@ assert bootstrapTools.passthru.isFromBootstrapFiles or false; # sanity check
|
|||
(superDarwin.binutils-unwrapped.override { enableManpages = false; }).overrideAttrs
|
||||
(old: {
|
||||
version = "boot";
|
||||
__intentionallyOverridingVersion = true; # to avoid a warning suggesting to provide src
|
||||
passthru = (old.passthru or { }) // {
|
||||
isFromBootstrapFiles = true;
|
||||
};
|
||||
|
|
|
@ -36,6 +36,7 @@ let
|
|||
remove
|
||||
splitString
|
||||
subtractLists
|
||||
toFunction
|
||||
unique
|
||||
zipAttrsWith
|
||||
;
|
||||
|
@ -61,12 +62,7 @@ let
|
|||
Most arguments are also passed through to the underlying call of [`builtins.derivation`](https://nixos.org/manual/nix/stable/language/derivations).
|
||||
:::
|
||||
*/
|
||||
mkDerivation =
|
||||
fnOrAttrs:
|
||||
if builtins.isFunction fnOrAttrs then
|
||||
makeDerivationExtensible fnOrAttrs
|
||||
else
|
||||
makeDerivationExtensibleConst fnOrAttrs;
|
||||
mkDerivation = fnOrAttrs: makeDerivationExtensible (toFunction fnOrAttrs);
|
||||
|
||||
checkMeta = import ./check-meta.nix {
|
||||
inherit lib config;
|
||||
|
@ -99,6 +95,10 @@ let
|
|||
thisOverlay = overlay final prev;
|
||||
warnForBadVersionOverride = (
|
||||
thisOverlay ? version
|
||||
&& prev ? version
|
||||
# We could check that the version is actually distinct, but that
|
||||
# would probably just delay the inevitable, or preserve tech debt.
|
||||
# && prev.version != thisOverlay.version
|
||||
&& !(thisOverlay ? src)
|
||||
&& !(thisOverlay.__intentionallyOverridingVersion or false)
|
||||
);
|
||||
|
@ -135,25 +135,6 @@ let
|
|||
in
|
||||
finalPackage;
|
||||
|
||||
#makeDerivationExtensibleConst = attrs: makeDerivationExtensible (_: attrs);
|
||||
# but pre-evaluated for a slight improvement in performance.
|
||||
makeDerivationExtensibleConst =
|
||||
attrs:
|
||||
mkDerivationSimple (
|
||||
f0:
|
||||
let
|
||||
f =
|
||||
self: super:
|
||||
let
|
||||
x = f0 super;
|
||||
in
|
||||
if builtins.isFunction x then f0 self super else x;
|
||||
in
|
||||
makeDerivationExtensible (
|
||||
self: attrs // (if builtins.isFunction f0 || f0 ? __functor then f self attrs else f0)
|
||||
)
|
||||
) attrs;
|
||||
|
||||
knownHardeningFlags = [
|
||||
"bindnow"
|
||||
"format"
|
||||
|
|
|
@ -15911,6 +15911,7 @@ with pkgs;
|
|||
polyml = polyml.overrideAttrs {
|
||||
pname = "polyml-for-isabelle";
|
||||
version = "2025";
|
||||
__intentionallyOverridingVersion = true; # avoid a warning, no src override
|
||||
configureFlags = [
|
||||
"--enable-intinf-as-int"
|
||||
"--with-gmp"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue