mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-11 04:05:40 +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: {
|
collectd.overrideAttrs (oldAttrs: {
|
||||||
pname = "libcollectdclient";
|
pname = "libcollectdclient";
|
||||||
inherit (collectd) version;
|
|
||||||
buildInputs = [ ];
|
buildInputs = [ ];
|
||||||
|
|
||||||
configureFlags = (oldAttrs.configureFlags or [ ]) ++ [
|
configureFlags = (oldAttrs.configureFlags or [ ]) ++ [
|
||||||
|
|
|
@ -439,6 +439,7 @@ assert bootstrapTools.passthru.isFromBootstrapFiles or false; # sanity check
|
||||||
(superDarwin.binutils-unwrapped.override { enableManpages = false; }).overrideAttrs
|
(superDarwin.binutils-unwrapped.override { enableManpages = false; }).overrideAttrs
|
||||||
(old: {
|
(old: {
|
||||||
version = "boot";
|
version = "boot";
|
||||||
|
__intentionallyOverridingVersion = true; # to avoid a warning suggesting to provide src
|
||||||
passthru = (old.passthru or { }) // {
|
passthru = (old.passthru or { }) // {
|
||||||
isFromBootstrapFiles = true;
|
isFromBootstrapFiles = true;
|
||||||
};
|
};
|
||||||
|
|
|
@ -36,6 +36,7 @@ let
|
||||||
remove
|
remove
|
||||||
splitString
|
splitString
|
||||||
subtractLists
|
subtractLists
|
||||||
|
toFunction
|
||||||
unique
|
unique
|
||||||
zipAttrsWith
|
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).
|
Most arguments are also passed through to the underlying call of [`builtins.derivation`](https://nixos.org/manual/nix/stable/language/derivations).
|
||||||
:::
|
:::
|
||||||
*/
|
*/
|
||||||
mkDerivation =
|
mkDerivation = fnOrAttrs: makeDerivationExtensible (toFunction fnOrAttrs);
|
||||||
fnOrAttrs:
|
|
||||||
if builtins.isFunction fnOrAttrs then
|
|
||||||
makeDerivationExtensible fnOrAttrs
|
|
||||||
else
|
|
||||||
makeDerivationExtensibleConst fnOrAttrs;
|
|
||||||
|
|
||||||
checkMeta = import ./check-meta.nix {
|
checkMeta = import ./check-meta.nix {
|
||||||
inherit lib config;
|
inherit lib config;
|
||||||
|
@ -99,6 +95,10 @@ let
|
||||||
thisOverlay = overlay final prev;
|
thisOverlay = overlay final prev;
|
||||||
warnForBadVersionOverride = (
|
warnForBadVersionOverride = (
|
||||||
thisOverlay ? version
|
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 ? src)
|
||||||
&& !(thisOverlay.__intentionallyOverridingVersion or false)
|
&& !(thisOverlay.__intentionallyOverridingVersion or false)
|
||||||
);
|
);
|
||||||
|
@ -135,25 +135,6 @@ let
|
||||||
in
|
in
|
||||||
finalPackage;
|
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 = [
|
knownHardeningFlags = [
|
||||||
"bindnow"
|
"bindnow"
|
||||||
"format"
|
"format"
|
||||||
|
|
|
@ -15911,6 +15911,7 @@ with pkgs;
|
||||||
polyml = polyml.overrideAttrs {
|
polyml = polyml.overrideAttrs {
|
||||||
pname = "polyml-for-isabelle";
|
pname = "polyml-for-isabelle";
|
||||||
version = "2025";
|
version = "2025";
|
||||||
|
__intentionallyOverridingVersion = true; # avoid a warning, no src override
|
||||||
configureFlags = [
|
configureFlags = [
|
||||||
"--enable-intinf-as-int"
|
"--enable-intinf-as-int"
|
||||||
"--with-gmp"
|
"--with-gmp"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue