mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-11-11 04:02:55 +03:00
Adding a new special attribute for mkDerivation: crossAttrs. It sits next to
"meta" and "passthru", and these attributes will be appended to the usual mkDerivation attributes only if the package is cross built. This allows putting some of the cross-building logic in the mkDerivation nix parameters, and not only in the final builder script, as it was until now. svn path=/nixpkgs/trunk/; revision=20272
This commit is contained in:
parent
5ca75ac276
commit
fca769846a
@ -10,6 +10,15 @@ stdenv.mkDerivation rec {
|
||||
|
||||
buildInputs = [ ncurses lzma ];
|
||||
|
||||
# !!! This should be set as usual attributes - we set them as
|
||||
# crossAttrs only not to change the usual stdenv hash
|
||||
# (in the normal stdenv, these get mapped all to buildNativeInputs,
|
||||
# but unfortunately in the opposite order, thus getting a new hash)
|
||||
crossAttrs = {
|
||||
buildNativeInputs = [ lzma ];
|
||||
buildInputs = [ ncurses ];
|
||||
};
|
||||
|
||||
# Disabled because we don't have zdiff in the stdenv bootstrap.
|
||||
#doCheck = true;
|
||||
|
||||
|
@ -170,7 +170,7 @@ rec {
|
||||
propagatedBuildNativeInputs = propagatedBuildNativeInputsDrvs;
|
||||
|
||||
crossConfig = cross.config;
|
||||
});
|
||||
} // (if args ? crossAttrs then args.crossAttrs else {}));
|
||||
in buildDrv // {
|
||||
inherit hostDrv buildDrv;
|
||||
};
|
||||
|
@ -44,7 +44,7 @@ let
|
||||
# stdenv and its shell.
|
||||
mkDerivation = attrs:
|
||||
(derivation (
|
||||
(removeAttrs attrs ["meta" "passthru"])
|
||||
(removeAttrs attrs ["meta" "passthru" "crossAttrs"])
|
||||
// (let
|
||||
buildInputs = if attrs ? buildInputs then attrs.buildInputs
|
||||
else [];
|
||||
|
Loading…
Reference in New Issue
Block a user