mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-11-11 04:02:55 +03:00
- Removed all *NoCross expressions I dupilcated in nixpkgs, while maintaining
the cross compilation functionality. - I renamed some expected stdenv.mkDerivation parameter attributes so we can keep this branch properly updated from trunk. We agreed with Nicolas Pierron doing a massive renaming, so all current buildInputs become hostInputs (input as build for the host machine, in autotools terminology) , and then buildInputs would mean "input as for the build machine". By now, the specific "input as for the build machine" is specified through buildNativeInputs. We should fix this in the merge to trunk. - I made the generic stdenv understand the buildNativeInputs, otherwise if we start changing nixpkgs expressions so they distinguish the current buildInputs into buildInputs and buildNativeInputs, we could break even more nixpkgs for other platforms. - I changed the default result of mkDerivation so it becomes the derivation for to be run in the build machine. This allows, without any special rewriting, "fetchurl" derivations to be always results for the build machine to use them. - The change above implies that, for anyone wanting to cross-compile, has to build the hostDrv of the wanted derivation. For example, after this commit, the usual test of "nix-build -A bison.hostDrv arm.nix" works. I described the contents of this arm.nix in r18398. svn path=/nixpkgs/branches/stdenv-updates/; revision=18471
This commit is contained in:
parent
56ed820f84
commit
7ade207f6b
@ -8,7 +8,7 @@ stdenv.mkDerivation {
|
||||
url = mirror://gnu/bison/bison-2.3.tar.bz2;
|
||||
md5 = "c18640c6ec31a169d351e3117ecce3ec";
|
||||
};
|
||||
buildInputs = [m4];
|
||||
buildNativeInputs = [m4];
|
||||
|
||||
meta = {
|
||||
description = "GNU Bison, a Yacc-compatible parser generator";
|
||||
|
@ -1,6 +1,7 @@
|
||||
{stdenv, fetchurl, unzip}:
|
||||
|
||||
# assert stdenv.system == "armv5tel-linux";
|
||||
# We should enable this check once we have the cross target system information
|
||||
# assert stdenv.system == "armv5tel-linux" || crossConfig == "armv5tel-linux";
|
||||
|
||||
# All this file is made for the Marvell Sheevaplug
|
||||
|
||||
@ -37,7 +38,7 @@ stdenv.mkDerivation {
|
||||
if test -z "$crossTarget"; then
|
||||
make clean all
|
||||
else
|
||||
make clean all ARCH=arm CROSS_COMPILE=$crossTarget-
|
||||
make clean all ARCH=arm CROSS_COMPILE=$crossConfig-
|
||||
fi
|
||||
'';
|
||||
|
||||
|
@ -110,29 +110,25 @@ rec {
|
||||
# Return a modified stdenv that adds a cross compiler to the
|
||||
# builds.
|
||||
makeStdenvCross = stdenv: cross: binutilsCross: gccCross: stdenv //
|
||||
{ mkDerivation = {name, buildInputs ? [], hostInputs ? [],
|
||||
propagatedBuildInputs ? [], propagatedHostInputs ? [], ...}@args: let
|
||||
{ mkDerivation = {name, buildInputs ? [], buildNativeInputs ? [],
|
||||
propagatedBuildInputs ? [], ...}@args: let
|
||||
# propagatedBuildInputs exists temporarily as another name for
|
||||
# propagatedHostInputs.
|
||||
buildInputsDrvs = map (drv: drv.buildDrv) buildInputs;
|
||||
hostInputsDrvs = map (drv: drv.hostDrv) hostInputs;
|
||||
propagatedHostInputsDrvs = map (drv: drv.buildDrv) (propagatedBuildInputs
|
||||
++ propagatedHostInputs);
|
||||
buildDrv = stdenv.mkDerivation (args // {
|
||||
# buildInputs in the base stdenv will be named hostInputs
|
||||
buildInputs = buildInputsDrvs ++ hostInputsDrvs;
|
||||
# Should be propagatedHostInputs one day:
|
||||
propagatedBuildInputs = propagatedHostInputsDrvs;
|
||||
});
|
||||
getBuildDrv = drv : if (drv ? buildDrv) then drv.buildDrv else drv;
|
||||
buildInputsDrvs = map (getBuildDrv) buildNativeInputs;
|
||||
hostInputsDrvs = map (drv: drv.hostDrv) buildInputs;
|
||||
hostInputsDrvsAsBuildInputs = map (getBuildDrv) buildInputs;
|
||||
propagatedHostInputsDrvs = map (drv: drv.buildDrv) (propagatedBuildInputs);
|
||||
buildDrv = stdenv.mkDerivation args;
|
||||
hostDrv = if (cross == null) then buildDrv else
|
||||
stdenv.mkDerivation (args // {
|
||||
stdenv.mkDerivation (args // {
|
||||
name = name + "-" + cross.config;
|
||||
buildInputs = buildInputsDrvs
|
||||
++ [ gccCross binutilsCross ];
|
||||
|
||||
crossConfig = cross.config;
|
||||
});
|
||||
in hostDrv // {
|
||||
in buildDrv // {
|
||||
inherit hostDrv buildDrv;
|
||||
};
|
||||
} // { inherit cross; };
|
||||
|
@ -45,14 +45,20 @@ let
|
||||
mkDerivation = attrs:
|
||||
(derivation (
|
||||
(removeAttrs attrs ["meta" "passthru"])
|
||||
//
|
||||
// (let
|
||||
buildInputs = if attrs ? buildInputs then attrs.buildInputs
|
||||
else [];
|
||||
buildNativeInputs = if attrs ? buildNativeInputs then attrs.buildNativeInputs
|
||||
else [];
|
||||
in
|
||||
{
|
||||
builder = if attrs ? realBuilder then attrs.realBuilder else shell;
|
||||
args = if attrs ? args then attrs.args else
|
||||
["-e" (if attrs ? builder then attrs.builder else ./default-builder.sh)];
|
||||
stdenv = result;
|
||||
system = result.system;
|
||||
})
|
||||
buildInputs = buildInputs ++ buildNativeInputs;
|
||||
}))
|
||||
)
|
||||
# The meta attribute is passed in the resulting attribute set,
|
||||
# but it's not part of the actual derivation, i.e., it's not
|
||||
|
@ -93,7 +93,6 @@ rec {
|
||||
extraAttrs = extraAttrs // {inherit fetchurl;};
|
||||
};
|
||||
|
||||
|
||||
# Build a dummy stdenv with no GCC or working fetchurl. This is
|
||||
# because we need a stdenv to build the GCC wrapper and fetchurl.
|
||||
stdenvLinuxBoot0 = stdenvBootFun {
|
||||
|
@ -216,19 +216,18 @@ let
|
||||
|
||||
defaultStdenv = allStdenvs.stdenv;
|
||||
|
||||
stdenvNoCross =
|
||||
stdenvCross = makeStdenvCross defaultStdenv crossSystem (binutilsCross crossSystem)
|
||||
(gccCrossStageFinal crossSystem);
|
||||
|
||||
stdenv =
|
||||
if bootStdenv != null then bootStdenv else
|
||||
let changer = getConfig ["replaceStdenv"] null;
|
||||
in if changer != null then
|
||||
changer {
|
||||
stdenv = defaultStdenv;
|
||||
stdenv = stdenvCross;
|
||||
overrideSetup = overrideSetup;
|
||||
}
|
||||
else defaultStdenv;
|
||||
|
||||
stdenv = if (bootStdenv != null || crossSystem == null) then stdenvNoCross else
|
||||
makeStdenvCross stdenvNoCross crossSystem (binutilsCross crossSystem)
|
||||
(gccCrossStageFinal crossSystem);
|
||||
else stdenvCross;
|
||||
|
||||
# A stdenv capable of building 32-bit binaries. On x86_64-linux,
|
||||
# it uses GCC compiled with multilib support; on i686-linux, it's
|
||||
@ -306,8 +305,8 @@ let
|
||||
# from being built.
|
||||
fetchurl = useFromStdenv "fetchurl"
|
||||
(import ../build-support/fetchurl {
|
||||
curl = curlNoCross;
|
||||
stdenv = stdenvNoCross;
|
||||
curl = curl;
|
||||
stdenv = stdenv;
|
||||
});
|
||||
|
||||
# fetchurlBoot is used for curl and its dependencies in order to
|
||||
@ -648,12 +647,6 @@ let
|
||||
sslSupport = ! ((stdenv ? isDietLibC) || (stdenv ? isStatic));
|
||||
};
|
||||
|
||||
curlNoCross = curl.override {
|
||||
stdenv = stdenvNoCross;
|
||||
zlib = zlib.override { stdenv = stdenvNoCross; };
|
||||
openssl = opensslNoCross;
|
||||
};
|
||||
|
||||
curlftpfs = import ../tools/networking/curlftpfs {
|
||||
inherit fetchurl stdenv fuse curl pkgconfig zlib glib;
|
||||
};
|
||||
@ -1079,10 +1072,6 @@ let
|
||||
inherit fetchurl stdenv;
|
||||
};
|
||||
|
||||
lzmaNoCross = lzma.override {
|
||||
stdenv = stdenvNoCross;
|
||||
};
|
||||
|
||||
xz = import ../tools/compression/xz {
|
||||
inherit fetchurl stdenv lib;
|
||||
};
|
||||
@ -1896,17 +1885,13 @@ let
|
||||
gcc43 = useFromStdenv "gcc" gcc43_real;
|
||||
|
||||
gcc43_real = lowPrio (wrapGCC (makeOverridable (import ../development/compilers/gcc-4.3) {
|
||||
inherit fetchurl gmp mpfr noSysDirs;
|
||||
stdenv = stdenvNoCross;
|
||||
texinfo = texinfoNoCross;
|
||||
inherit stdenv fetchurl texinfo gmp mpfr noSysDirs;
|
||||
profiledCompiler = true;
|
||||
}));
|
||||
|
||||
gcc43_realCross = cross : makeOverridable (import ../development/compilers/gcc-4.3) {
|
||||
#stdenv = overrideGCC stdenv (wrapGCCWith (import ../build-support/gcc-wrapper) glibc_multi gcc);
|
||||
inherit fetchurl gmp mpfr noSysDirs cross;
|
||||
stdenv = stdenvNoCross;
|
||||
texinfo = texinfoNoCross;
|
||||
inherit stdenv fetchurl texinfo gmp mpfr noSysDirs cross;
|
||||
binutilsCross = binutilsCross cross;
|
||||
glibcCross = glibcCross cross;
|
||||
profiledCompiler = false;
|
||||
@ -2343,8 +2328,7 @@ let
|
||||
import ../build-support/gcc-cross-wrapper {
|
||||
nativeTools = false;
|
||||
nativeLibc = false;
|
||||
inherit gcc binutils libc shell name cross;
|
||||
stdenv = stdenvNoCross;
|
||||
inherit stdenv gcc binutils libc shell name cross;
|
||||
};
|
||||
|
||||
# FIXME: This is a specific hack for GCC-UPC. Eventually, we may
|
||||
@ -2454,11 +2438,6 @@ let
|
||||
|
||||
perl = if system != "i686-cygwin" then perl510 else sysPerl;
|
||||
|
||||
perlNoCross = perl.override
|
||||
{
|
||||
stdenv = stdenvNoCross;
|
||||
};
|
||||
|
||||
# FIXME: unixODBC needs patching on Darwin (see darwinports)
|
||||
phpOld = import ../development/interpreters/php {
|
||||
inherit stdenv fetchurl flex bison libxml2 apacheHttpd;
|
||||
@ -2731,8 +2710,7 @@ let
|
||||
});
|
||||
|
||||
binutilsCross = cross : import ../development/tools/misc/binutils {
|
||||
inherit fetchurl cross;
|
||||
stdenv = stdenvNoCross;
|
||||
inherit stdenv fetchurl cross;
|
||||
noSysDirs = true;
|
||||
};
|
||||
|
||||
@ -2873,10 +2851,6 @@ let
|
||||
|
||||
m4 = gnum4;
|
||||
|
||||
m4NoCross = m4.override {
|
||||
stdenv = stdenvNoCross;
|
||||
};
|
||||
|
||||
global = import ../development/tools/misc/global {
|
||||
inherit fetchurl stdenv;
|
||||
};
|
||||
@ -3077,12 +3051,6 @@ let
|
||||
inherit fetchurl stdenv ncurses lzma;
|
||||
};
|
||||
|
||||
texinfoNoCross = texinfo.override {
|
||||
stdenv = stdenvNoCross;
|
||||
ncurses = ncursesNoCross;
|
||||
lzma = lzmaNoCross;
|
||||
};
|
||||
|
||||
texi2html = import ../development/tools/misc/texi2html {
|
||||
inherit fetchurl stdenv perl;
|
||||
};
|
||||
@ -3558,8 +3526,7 @@ let
|
||||
};
|
||||
|
||||
glibc29Cross = cross : makeOverridable (import ../development/libraries/glibc-2.9) {
|
||||
inherit fetchurl cross;
|
||||
stdenv = stdenvNoCross;
|
||||
inherit stdenv fetchurl cross;
|
||||
binutilsCross = binutilsCross cross;
|
||||
gccCross = gccCrossStageStatic cross;
|
||||
kernelHeaders = kernelHeadersCross cross;
|
||||
@ -3612,9 +3579,7 @@ let
|
||||
};
|
||||
|
||||
gmp = import ../development/libraries/gmp {
|
||||
inherit fetchurl;
|
||||
stdenv = stdenvNoCross;
|
||||
m4 = m4NoCross;
|
||||
inherit stdenv fetchurl m4;
|
||||
};
|
||||
|
||||
# `gmpxx' used to mean "GMP with C++ bindings". Now `gmp' has C++ bindings
|
||||
@ -3636,8 +3601,7 @@ let
|
||||
|
||||
#GMP ex-satellite, so better keep it near gmp
|
||||
mpfr = import ../development/libraries/mpfr {
|
||||
inherit fetchurl gmp;
|
||||
stdenv = stdenvNoCross;
|
||||
inherit stdenv fetchurl gmp;
|
||||
};
|
||||
|
||||
gst_all = recurseIntoAttrs (import ../development/libraries/gstreamer {
|
||||
@ -4355,10 +4319,6 @@ let
|
||||
unicode = (system != "i686-cygwin" && ! (stdenv ? cross));
|
||||
};
|
||||
|
||||
ncursesNoCross = ncurses.override {
|
||||
stdenv = stdenvNoCross;
|
||||
};
|
||||
|
||||
neon = neon026;
|
||||
|
||||
neon026 = import ../development/libraries/neon/0.26.nix {
|
||||
@ -4443,11 +4403,6 @@ let
|
||||
inherit stdenv perl;
|
||||
};
|
||||
|
||||
opensslNoCross = openssl.override {
|
||||
stdenv = stdenvNoCross;
|
||||
perl = perlNoCross;
|
||||
};
|
||||
|
||||
ortp = import ../development/libraries/ortp {
|
||||
inherit fetchurl stdenv;
|
||||
};
|
||||
@ -5547,9 +5502,7 @@ let
|
||||
kernelHeaders = kernelHeaders_2_6_28;
|
||||
|
||||
kernelHeadersCross = cross : import ../os-specific/linux/kernel-headers/2.6.28.nix {
|
||||
inherit fetchurl cross;
|
||||
stdenv = stdenvNoCross;
|
||||
perl = perlNoCross;
|
||||
inherit stdenv fetchurl cross perl;
|
||||
};
|
||||
|
||||
kernelHeaders_2_6_18 = import ../os-specific/linux/kernel-headers/2.6.18.5.nix {
|
||||
|
Loading…
Reference in New Issue
Block a user