forked from NixOS/nixpkgs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
emacs: stop vendoring PR NixOS#234651
Previously, we vendor PR NixOS#234651 because we want to keep the old behavior of filtering out packageRequires from the arguments we pass to the underling stdenv.mkDerivation. Doing so raises the concern about the complexity of PR NixOS#234651. Considering that passing packageRequires to stdenv.mkDerivation also works well, we stop filtering it out and stop vendoring PR NixOS#234651. Now, this PR only uses the existing interface of stdenv.mkDerivation. Even though the name of the build helper is still extendMkDerivation', it is nothing new and has been used in Nixpkgs, such as php.buildComposerProject[1]. [1]: https://github.com/NixOS/nixpkgs/blob/f3834de3782b82bfc666abf664f946d0e7d1f116/pkgs/build-support/php/builders/v1/build-composer-project.nix#L108
- Loading branch information
Showing
5 changed files
with
20 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 3 additions & 54 deletions
57
pkgs/applications/editors/emacs/build-support/lib-build-helper.nix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,56 +1,5 @@ | ||
# stolen from https://github.com/NixOS/nixpkgs/pull/234651 | ||
# TODO switch to functions in that PR once it is merged | ||
|
||
{ lib }: | ||
|
||
let | ||
inherit (lib) | ||
setFunctionArgs | ||
id | ||
functionArgs | ||
optionalAttrs | ||
toFunction | ||
; | ||
in | ||
{ | ||
|
||
extendMkDerivation = | ||
{ | ||
modify ? id, | ||
inheritFunctionArgs ? true, | ||
}: | ||
mkDerivationBase: attrsOverlay: | ||
setFunctionArgs | ||
# Adds the fixed-point style support. | ||
(fpargs: modify ((mkDerivationBase fpargs).overrideAttrs attrsOverlay)) | ||
# Add __functionArgs | ||
( | ||
# Inherit the __functionArgs from the base build helper | ||
functionArgs (attrsOverlay { }) | ||
# Recover the __functionArgs from the derived build helper | ||
// optionalAttrs inheritFunctionArgs (functionArgs mkDerivationBase) | ||
) | ||
// { | ||
# Passthru attributes attached to the result build helper. | ||
attrsOverlays = mkDerivationBase.attrsOverlays or [ ] ++ [ attrsOverlay ]; | ||
}; | ||
|
||
adaptMkDerivation = | ||
{ | ||
modify ? id, | ||
inheritFunctionArgs ? true, | ||
}: | ||
mkDerivationBase: adaptArgs: | ||
setFunctionArgs | ||
# Adds the fixed-point style support | ||
( | ||
fpargs: modify (mkDerivationBase (finalAttrs: adaptArgs finalAttrs (toFunction fpargs finalAttrs))) | ||
) | ||
# Add __functionArgs | ||
( | ||
# Inherit the __functionArgs from the base build helper | ||
optionalAttrs inheritFunctionArgs (functionArgs mkDerivationBase) | ||
# Recover the __functionArgs from the derived build helper | ||
// functionArgs (adaptArgs { }) | ||
); | ||
extendMkDerivation' = | ||
mkDerivationBase: attrsOverlay: fpargs: | ||
(mkDerivationBase fpargs).overrideAttrs attrsOverlay; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters