Rename hostDrv -> crossDrv, buildDrv -> nativeDrv

This is for consistency with terminology in stdenv (and the terms
"hostDrv" and "buildDrv" are not very intuitive, even if they're
consistent with GNU terminology).
This commit is contained in:
Eelco Dolstra 2012-12-28 19:08:19 +01:00
parent f4ed8a3b91
commit 5be0a9acd7
38 changed files with 190 additions and 190 deletions

View file

@ -21,12 +21,12 @@ stdenv.mkDerivation rec {
'';
crossAttrs = {
propagatedBuildInputs = [ ncurses.hostDrv zlib.hostDrv openssl.hostDrv ];
propagatedBuildInputs = [ ncurses.crossDrv zlib.crossDrv openssl.crossDrv ];
configureFlags = ''
--enable-finger --enable-html-highlight
--enable-gopher --enable-cgi --enable-bittorrent --enable-nntp
--with-openssl=${openssl.hostDrv}
--with-bzip2=${bzip2.hostDrv}
--with-openssl=${openssl.crossDrv}
--with-bzip2=${bzip2.crossDrv}
'';
};

View file

@ -47,11 +47,11 @@ stdenv.mkDerivation {
else shell;
crossAttrs = {
shell = shell.hostDrv + shell.hostDrv.shellPath;
libc = libc.hostDrv;
coreutils = coreutils.hostDrv;
binutils = binutils.hostDrv;
clang = clang.hostDrv;
shell = shell.crossDrv + shell.crossDrv.shellPath;
libc = libc.crossDrv;
coreutils = coreutils.crossDrv;
binutils = binutils.crossDrv;
clang = clang.crossDrv;
#
# This is not the best way to do this. I think the reference should be
# the style in the gcc-cross-wrapper, but to keep a stable stdenv now I

View file

@ -56,11 +56,11 @@ stdenv.mkDerivation ({
else shell;
crossAttrs = {
shell = shell.hostDrv + shell.hostDrv.shellPath;
libc = libc.hostDrv;
coreutils = coreutils.hostDrv;
binutils = binutils.hostDrv;
gcc = gcc.hostDrv;
shell = shell.crossDrv + shell.crossDrv.shellPath;
libc = libc.crossDrv;
coreutils = coreutils.crossDrv;
binutils = binutils.crossDrv;
gcc = gcc.crossDrv;
#
# This is not the best way to do this. I think the reference should be
# the style in the gcc-cross-wrapper, but to keep a stable stdenv now I

View file

@ -189,13 +189,13 @@ stdenv.mkDerivation ({
configureFlags = "
${if enableMultilib then "" else "--disable-multilib"}
${if enableShared then "" else "--disable-shared"}
${if ppl != null then "--with-ppl=${ppl.hostDrv}" else ""}
${if cloogppl != null then "--with-cloog=${cloogppl.hostDrv}" else ""}
${if langJava then "--with-ecj-jar=${javaEcj.hostDrv}" else ""}
${if ppl != null then "--with-ppl=${ppl.crossDrv}" else ""}
${if cloogppl != null then "--with-cloog=${cloogppl.crossDrv}" else ""}
${if langJava then "--with-ecj-jar=${javaEcj.crossDrv}" else ""}
${if javaAwtGtk then "--enable-java-awt=gtk" else ""}
${if langJava && javaAntlr != null then "--with-antlr-jar=${javaAntlr.hostDrv}" else ""}
--with-gmp=${gmp.hostDrv}
--with-mpfr=${mpfr.hostDrv}
${if langJava && javaAntlr != null then "--with-antlr-jar=${javaAntlr.crossDrv}" else ""}
--with-gmp=${gmp.crossDrv}
--with-mpfr=${mpfr.crossDrv}
--disable-libstdcxx-pch
--without-included-gettext
--with-system-zlib

View file

@ -146,7 +146,7 @@ stdenv.mkDerivation ({
postPatch =
if (stdenv.system == "i586-pc-gnu"
|| (libcCross != null # e.g., building `gcc.hostDrv'
|| (libcCross != null # e.g., building `gcc.crossDrv'
&& libcCross ? crossConfig
&& libcCross.crossConfig == "i586-pc-gnu")
|| (cross != null && cross.config == "i586-pc-gnu"
@ -277,13 +277,13 @@ stdenv.mkDerivation ({
configureFlags = ''
${if enableMultilib then "" else "--disable-multilib"}
${if enableShared then "" else "--disable-shared"}
${if ppl != null then "--with-ppl=${ppl.hostDrv}" else ""}
${if cloogppl != null then "--with-cloog=${cloogppl.hostDrv}" else ""}
${if langJava then "--with-ecj-jar=${javaEcj.hostDrv}" else ""}
${if ppl != null then "--with-ppl=${ppl.crossDrv}" else ""}
${if cloogppl != null then "--with-cloog=${cloogppl.crossDrv}" else ""}
${if langJava then "--with-ecj-jar=${javaEcj.crossDrv}" else ""}
${if javaAwtGtk then "--enable-java-awt=gtk" else ""}
${if langJava && javaAntlr != null then "--with-antlr-jar=${javaAntlr.hostDrv}" else ""}
--with-gmp=${gmp.hostDrv}
--with-mpfr=${mpfr.hostDrv}
${if langJava && javaAntlr != null then "--with-antlr-jar=${javaAntlr.crossDrv}" else ""}
--with-gmp=${gmp.crossDrv}
--with-mpfr=${mpfr.crossDrv}
--disable-libstdcxx-pch
--without-included-gettext
--with-system-zlib
@ -391,7 +391,7 @@ stdenv.mkDerivation ({
// optionalAttrs (cross != null || libcCross != null) {
# `builder.sh' sets $CPP, which leads configure to use "gcc -E" instead of,
# say, "i586-pc-gnu-gcc -E" when building `gcc.hostDrv'.
# say, "i586-pc-gnu-gcc -E" when building `gcc.crossDrv'.
# FIXME: Fix `builder.sh' directly in the next stdenv-update.
postUnpack = "unset CPP";
}

View file

@ -174,7 +174,7 @@ stdenv.mkDerivation ({
postPatch =
if (stdenv.isGNU
|| (libcCross != null # e.g., building `gcc.hostDrv'
|| (libcCross != null # e.g., building `gcc.crossDrv'
&& libcCross ? crossConfig
&& libcCross.crossConfig == "i586-pc-gnu")
|| (crossGNU && libcCross != null))
@ -327,13 +327,13 @@ stdenv.mkDerivation ({
configureFlags = ''
${if enableMultilib then "" else "--disable-multilib"}
${if enableShared then "" else "--disable-shared"}
${if ppl != null then "--with-ppl=${ppl.hostDrv}" else ""}
${if cloog != null then "--with-cloog=${cloog.hostDrv} --enable-cloog-backend=isl" else ""}
${if langJava then "--with-ecj-jar=${javaEcj.hostDrv}" else ""}
${if ppl != null then "--with-ppl=${ppl.crossDrv}" else ""}
${if cloog != null then "--with-cloog=${cloog.crossDrv} --enable-cloog-backend=isl" else ""}
${if langJava then "--with-ecj-jar=${javaEcj.crossDrv}" else ""}
${if javaAwtGtk then "--enable-java-awt=gtk" else ""}
${if langJava && javaAntlr != null then "--with-antlr-jar=${javaAntlr.hostDrv}" else ""}
--with-gmp=${gmp.hostDrv}
--with-mpfr=${mpfr.hostDrv}
${if langJava && javaAntlr != null then "--with-antlr-jar=${javaAntlr.crossDrv}" else ""}
--with-gmp=${gmp.crossDrv}
--with-mpfr=${mpfr.crossDrv}
--disable-libstdcxx-pch
--without-included-gettext
--with-system-zlib

View file

@ -172,7 +172,7 @@ stdenv.mkDerivation ({
postPatch =
if (stdenv.isGNU
|| (libcCross != null # e.g., building `gcc.hostDrv'
|| (libcCross != null # e.g., building `gcc.crossDrv'
&& libcCross ? crossConfig
&& libcCross.crossConfig == "i586-pc-gnu")
|| (crossGNU && libcCross != null))
@ -328,13 +328,13 @@ stdenv.mkDerivation ({
configureFlags = ''
${if enableMultilib then "" else "--disable-multilib"}
${if enableShared then "" else "--disable-shared"}
${if ppl != null then "--with-ppl=${ppl.hostDrv}" else ""}
${if cloog != null then "--with-cloog=${cloog.hostDrv} --enable-cloog-backend=isl" else ""}
${if langJava then "--with-ecj-jar=${javaEcj.hostDrv}" else ""}
${if ppl != null then "--with-ppl=${ppl.crossDrv}" else ""}
${if cloog != null then "--with-cloog=${cloog.crossDrv} --enable-cloog-backend=isl" else ""}
${if langJava then "--with-ecj-jar=${javaEcj.crossDrv}" else ""}
${if javaAwtGtk then "--enable-java-awt=gtk" else ""}
${if langJava && javaAntlr != null then "--with-antlr-jar=${javaAntlr.hostDrv}" else ""}
--with-gmp=${gmp.hostDrv}
--with-mpfr=${mpfr.hostDrv}
${if langJava && javaAntlr != null then "--with-antlr-jar=${javaAntlr.crossDrv}" else ""}
--with-gmp=${gmp.crossDrv}
--with-mpfr=${mpfr.crossDrv}
--disable-libstdcxx-pch
--without-included-gettext
--with-system-zlib

View file

@ -43,7 +43,7 @@ stdenv.mkDerivation rec {
configureFlags = configureFlagsFun { inherit alsaLib; };
crossAttrs = {
configureFlags = configureFlagsFun { alsaLib = alsaLib.hostDrv; };
configureFlags = configureFlagsFun { alsaLib = alsaLib.crossDrv; };
};
passthru = {inherit openglSupport;};

View file

@ -71,7 +71,7 @@ stdenv.mkDerivation {
];
crossAttrs = rec {
buildInputs = [ expat.hostDrv zlib.hostDrv bzip2.hostDrv ];
buildInputs = [ expat.crossDrv zlib.crossDrv bzip2.crossDrv ];
# all buildInputs set previously fell into propagatedBuildInputs, as usual, so we have to
# override them.
propagatedBuildInputs = buildInputs;
@ -85,7 +85,7 @@ stdenv.mkDerivation {
cat << EOF > user-config.jam
using gcc : cross : $crossConfig-g++ ;
EOF
./bjam -j$NIX_BUILD_CORES -sEXPAT_INCLUDE=${expat.hostDrv}/include -sEXPAT_LIBPATH=${expat.hostDrv}/lib --layout=${finalLayout} --user-config=user-config.jam toolset=gcc-cross variant=${variant} threading=${threading} link=${link} ${cflags} --without-python install
./bjam -j$NIX_BUILD_CORES -sEXPAT_INCLUDE=${expat.crossDrv}/include -sEXPAT_LIBPATH=${expat.crossDrv}/lib --layout=${finalLayout} --user-config=user-config.jam toolset=gcc-cross variant=${variant} threading=${threading} link=${link} ${cflags} --without-python install
'';
};
}

View file

@ -60,7 +60,7 @@ stdenv.mkDerivation {
installPhase = ":";
crossAttrs = rec {
buildInputs = [ expat.hostDrv zlib.hostDrv bzip2.hostDrv ];
buildInputs = [ expat.crossDrv zlib.crossDrv bzip2.crossDrv ];
# all buildInputs set previously fell into propagatedBuildInputs, as usual, so we have to
# override them.
propagatedBuildInputs = buildInputs;
@ -74,7 +74,7 @@ stdenv.mkDerivation {
cat << EOF > user-config.jam
using gcc : cross : $crossConfig-g++ ;
EOF
./bjam -j$NIX_BUILD_CORES -sEXPAT_INCLUDE=${expat.hostDrv}/include -sEXPAT_LIBPATH=${expat.hostDrv}/lib --layout=${finalLayout} --user-config=user-config.jam toolset=gcc-cross variant=${variant} threading=${threading} link=${link} ${cflags} --without-python install
./bjam -j$NIX_BUILD_CORES -sEXPAT_INCLUDE=${expat.crossDrv}/include -sEXPAT_LIBPATH=${expat.crossDrv}/lib --layout=${finalLayout} --user-config=user-config.jam toolset=gcc-cross variant=${variant} threading=${threading} link=${link} ${cflags} --without-python install
'';
};
}

View file

@ -70,7 +70,7 @@ stdenv.mkDerivation {
installPhase = ":";
crossAttrs = rec {
buildInputs = [ expat.hostDrv zlib.hostDrv bzip2.hostDrv ];
buildInputs = [ expat.crossDrv zlib.crossDrv bzip2.crossDrv ];
# all buildInputs set previously fell into propagatedBuildInputs, as usual, so we have to
# override them.
propagatedBuildInputs = buildInputs;
@ -84,7 +84,7 @@ stdenv.mkDerivation {
cat << EOF > user-config.jam
using gcc : cross : $crossConfig-g++ ;
EOF
./b2 -j$NIX_BUILD_CORES -sEXPAT_INCLUDE=${expat.hostDrv}/include -sEXPAT_LIBPATH=${expat.hostDrv}/lib --layout=${finalLayout} --user-config=user-config.jam toolset=gcc-cross variant=${variant} threading=${threading} link=${link} ${cflags} --without-python install
./b2 -j$NIX_BUILD_CORES -sEXPAT_INCLUDE=${expat.crossDrv}/include -sEXPAT_LIBPATH=${expat.crossDrv}/lib --layout=${finalLayout} --user-config=user-config.jam toolset=gcc-cross variant=${variant} threading=${threading} link=${link} ${cflags} --without-python install
'';
};
}

View file

@ -71,7 +71,7 @@ stdenv.mkDerivation {
installPhase = ":";
crossAttrs = rec {
buildInputs = [ expat.hostDrv zlib.hostDrv bzip2.hostDrv ];
buildInputs = [ expat.crossDrv zlib.crossDrv bzip2.crossDrv ];
# all buildInputs set previously fell into propagatedBuildInputs, as usual, so we have to
# override them.
propagatedBuildInputs = buildInputs;
@ -85,7 +85,7 @@ stdenv.mkDerivation {
cat << EOF > user-config.jam
using gcc : cross : $crossConfig-g++ ;
EOF
./b2 -j$NIX_BUILD_CORES -sEXPAT_INCLUDE=${expat.hostDrv}/include -sEXPAT_LIBPATH=${expat.hostDrv}/lib --layout=${finalLayout} --user-config=user-config.jam toolset=gcc-cross variant=${variant} threading=${threading} link=${link} ${cflags} --without-python install
./b2 -j$NIX_BUILD_CORES -sEXPAT_INCLUDE=${expat.crossDrv}/include -sEXPAT_LIBPATH=${expat.crossDrv}/lib --layout=${finalLayout} --user-config=user-config.jam toolset=gcc-cross variant=${variant} threading=${threading} link=${link} ${cflags} --without-python install
'';
};
}

View file

@ -66,7 +66,7 @@ stdenv.mkDerivation {
installPhase = ":";
crossAttrs = rec {
buildInputs = [ expat.hostDrv zlib.hostDrv bzip2.hostDrv ];
buildInputs = [ expat.crossDrv zlib.crossDrv bzip2.crossDrv ];
# all buildInputs set previously fell into propagatedBuildInputs, as usual, so we have to
# override them.
propagatedBuildInputs = buildInputs;
@ -80,7 +80,7 @@ stdenv.mkDerivation {
cat << EOF > user-config.jam
using gcc : cross : $crossConfig-g++ ;
EOF
./b2 -j$NIX_BUILD_CORES -sEXPAT_INCLUDE=${expat.hostDrv}/include -sEXPAT_LIBPATH=${expat.hostDrv}/lib --layout=${layout} --user-config=user-config.jam toolset=gcc-cross variant=${variant} threading=${threading} link=${link} ${cflags} --without-python install
./b2 -j$NIX_BUILD_CORES -sEXPAT_INCLUDE=${expat.crossDrv}/include -sEXPAT_LIBPATH=${expat.crossDrv}/lib --layout=${layout} --user-config=user-config.jam toolset=gcc-cross variant=${variant} threading=${threading} link=${link} ${cflags} --without-python install
'';
};
}

View file

@ -71,7 +71,7 @@ stdenv.mkDerivation {
'';
crossAttrs = rec {
buildInputs = [ expat.hostDrv zlib.hostDrv bzip2.hostDrv ];
buildInputs = [ expat.crossDrv zlib.crossDrv bzip2.crossDrv ];
# all buildInputs set previously fell into propagatedBuildInputs, as usual, so we have to
# override them.
propagatedBuildInputs = buildInputs;
@ -85,7 +85,7 @@ stdenv.mkDerivation {
cat << EOF > user-config.jam
using gcc : cross : $crossConfig-g++ ;
EOF
./b2 -j$NIX_BUILD_CORES -sEXPAT_INCLUDE=${expat.hostDrv}/include -sEXPAT_LIBPATH=${expat.hostDrv}/lib --layout=${layout} --user-config=user-config.jam toolset=gcc-cross variant=${variant} threading=${threading} link=${link} ${cflags} --without-python install
./b2 -j$NIX_BUILD_CORES -sEXPAT_INCLUDE=${expat.crossDrv}/include -sEXPAT_LIBPATH=${expat.crossDrv}/lib --layout=${layout} --user-config=user-config.jam toolset=gcc-cross variant=${variant} threading=${threading} link=${link} ${cflags} --without-python install
'';
};
}

View file

@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
configureFlags = "--with-ppl=${ppl}";
crossAttrs = {
configureFlags = "--with-ppl=${ppl.hostDrv}";
configureFlags = "--with-ppl=${ppl.crossDrv}";
};
doCheck = true;

View file

@ -36,7 +36,7 @@ stdenv.mkDerivation (rec {
crossAttrs = {
buildInputs = stdenv.lib.optional (stdenv.gccCross.libc ? libiconv)
stdenv.gccCross.libc.libiconv.hostDrv;
stdenv.gccCross.libc.libiconv.crossDrv;
# Gettext fails to guess the cross compiler
configureFlags = "CXX=${stdenv.cross.config}-g++";
};

View file

@ -10,7 +10,7 @@ stdenv.mkDerivation ({
propagatedBuildInputs = [libogg libvorbis];
crossAttrs = {
propagatedBuildInputs = [libogg.hostDrv tremor.hostDrv];
propagatedBuildInputs = [libogg.crossDrv tremor.crossDrv];
configureFlags = "--disable-examples";
};
}

View file

@ -34,7 +34,7 @@ stdenv.mkDerivation rec {
crossAttrs = {
postInstall = "";
propagatedBuildInputs = [ ncurses.hostDrv ];
propagatedBuildInputs = [ ncurses.crossDrv ];
};
meta = {

View file

@ -28,7 +28,7 @@ stdenv.mkDerivation rec {
/* Having bzip2 will harm, because anything using elfutils
as buildInput cross-building, will not be able to run 'bzip2' */
propagatedBuildInputs = [ zlib.hostDrv ];
propagatedBuildInputs = [ zlib.crossDrv ];
# This program does not cross-build fine. So I only cross-build some parts
# I need for the linux perf tool.

View file

@ -11,8 +11,8 @@ let
basename = "gdb-7.5";
# Whether (cross-)building for GNU/Hurd. This is an approximation since
# having `stdenv ? cross' doesn't tell us if we're building `hostDrv' and
# `buildDrv'.
# having `stdenv ? cross' doesn't tell us if we're building `crossDrv' and
# `nativeDrv'.
isGNU =
stdenv.system == "i686-gnu"
|| (stdenv ? cross && stdenv.cross.config == "i586-pc-gnu");
@ -51,8 +51,8 @@ stdenv.mkDerivation rec {
crossAttrs = {
# Do not add --with-python here to avoid cross building it.
configureFlags =
'' --with-gmp=${gmp.hostDrv} --with-mpfr=${mpfr.hostDrv} --with-system-readline
--with-expat --with-libexpat-prefix=${expat.hostDrv} --without-python
'' --with-gmp=${gmp.crossDrv} --with-mpfr=${mpfr.crossDrv} --with-system-readline
--with-expat --with-libexpat-prefix=${expat.crossDrv} --without-python
'' + stdenv.lib.optionalString (target != null)
" --target=${target.config}";
};

View file

@ -9,7 +9,7 @@ stdenv.mkDerivation {
buildInputs = [ SDL SDL_mixer SDL_net mesa ];
crossAttrs = {
propagatedBuildInputs = [ SDL.hostDrv SDL_mixer.hostDrv SDL_net.hostDrv ];
propagatedBuildInputs = [ SDL.crossDrv SDL_mixer.crossDrv SDL_net.crossDrv ];
configureFlags = "--disable-gl --disable-cpu-opt --without-x --disable-sdltest
ac_cv_type_uid_t=yes ac_cv_type_gid_t=yes";

View file

@ -34,7 +34,7 @@ rec {
overrideDerivation = drv: f:
let
# Filter out special attributes.
drop = [ "meta" "passthru" "outPath" "drvPath" "hostDrv" "buildDrv" "type" "override" "deepOverride" "origArgs" "drvAttrs" "outputName" "all" "out" ]
drop = [ "meta" "passthru" "outPath" "drvPath" "crossDrv" "nativeDrv" "type" "override" "deepOverride" "origArgs" "drvAttrs" "outputName" "all" "out" ]
# also drop functions such as .merge .override etc
++ lib.filter (n: isFunction (getAttr n drv)) (attrNames drv);
attrs = removeAttrs drv drop;
@ -44,10 +44,10 @@ rec {
passthru = if drv ? passthru then drv.passthru else {};
}
//
(if (drv ? hostDrv && drv ? buildDrv)
(if (drv ? crossDrv && drv ? nativeDrv)
then {
hostDrv = overrideDerivation drv.hostDrv f;
buildDrv = overrideDerivation drv.buildDrv f;
crossDrv = overrideDerivation drv.crossDrv f;
nativeDrv = overrideDerivation drv.nativeDrv f;
}
else { });

View file

@ -16,7 +16,7 @@ let
inherit fetchgit stdenv autoconf libtool texinfo
glibcCross hurdPartedCross;
inherit (gnu) machHeaders mig;
libuuid = libuuid.hostDrv;
libuuid = libuuid.crossDrv;
automake = automake111x;
headersOnly = false;
cross = assert crossSystem != null; crossSystem;
@ -85,7 +85,7 @@ let
stdenv = (forceSystem "i686-linux").stdenv;
};
# XXX: Use this one for its `.hostDrv'. Using the one above from
# XXX: Use this one for its `.crossDrv'. Using the one above from
# `x86_64-linux' leads to building a different cross-toolchain because of
# the `forceSystem'.
mig_raw = callPackage ./mig {};

View file

@ -25,7 +25,7 @@ stdenv.mkDerivation {
postInstall =
# Fix the shebang to point to the cross-built shell.
'' sed -i "$out/bin/mig" \
-e 's|^#!/.*|#!${bash.hostDrv}/bin/sh|g'
-e 's|^#!/.*|#!${bash.crossDrv}/bin/sh|g'
'';
};

View file

@ -119,8 +119,8 @@ stdenv.mkDerivation {
# The substitution of crossAttrs happens *after* the stdenv cross adapter sets
# the parameters for the usual stdenv. Thus, we need to specify
# the ".hostDrv" in the buildInputs here.
buildInputs = lib.optional (cp.uboot != null) (ubootChooser cp.uboot).hostDrv;
# the ".crossDrv" in the buildInputs here.
buildInputs = lib.optional (cp.uboot != null) (ubootChooser cp.uboot).crossDrv;
};
meta = {

View file

@ -27,9 +27,9 @@ stdenv.mkDerivation {
crossAttrs = {
/* I don't want cross-python or cross-perl -
I don't know if cross-python even works */
propagatedBuildInputs = [ elfutils.hostDrv newt.hostDrv ];
propagatedBuildInputs = [ elfutils.crossDrv newt.crossDrv ];
makeFlags = "CROSS_COMPILE=${stdenv.cross.config}-";
elfutils = elfutils.hostDrv;
elfutils = elfutils.crossDrv;
};
meta = {

View file

@ -17,9 +17,9 @@ stdenv.mkDerivation rec {
crossAttrs = {
# Skip libxcrypt cross-building, as it fails for mips and arm
propagatedBuildInputs = [ flex.hostDrv cracklib.hostDrv ];
propagatedBuildInputs = [ flex.crossDrv cracklib.crossDrv ];
preConfigure = preConfigure + ''
ar x ${flex.hostDrv}/lib/libfl.a
ar x ${flex.crossDrv}/lib/libfl.a
mv libyywrap.o libyywrap-target.o
ar x ${flex}/lib/libfl.a
mv libyywrap.o libyywrap-host.o

View file

@ -22,7 +22,7 @@ stdenv.mkDerivation {
crossAttrs = {
# cmakeFlags = "-DWIN32=1 -DCMAKE_SYSTEM_NAME=Windows -DCMAKE_RC_COMPILER=${stdenv.cross.config}-windres";
QTDIR = qt48.hostDrv;
QTDIR = qt48.crossDrv;
preBuild = ''
export NIX_CROSS_CFLAGS_COMPILE=-fpermissive
'';

View file

@ -133,8 +133,8 @@ rec {
# In nixpkgs, sometimes 'null' gets in as a buildInputs element,
# and we handle that through isAttrs.
getBuildDrv = drv : if (builtins.isAttrs drv && drv ? buildDrv) then drv.buildDrv else drv;
getHostDrv = drv : if (builtins.isAttrs drv && drv ? hostDrv) then drv.hostDrv else drv;
getBuildDrv = drv : if (builtins.isAttrs drv && drv ? nativeDrv) then drv.nativeDrv else drv;
getHostDrv = drv : if (builtins.isAttrs drv && drv ? crossDrv) then drv.crossDrv else drv;
buildNativeInputsDrvs = map (getBuildDrv) buildNativeInputs;
buildInputsDrvs = map (getHostDrv) buildInputs;
buildInputsDrvsAsBuildInputs = map (getBuildDrv) buildInputs;
@ -145,27 +145,27 @@ rec {
# The base stdenv already knows that buildNativeInputs and
# buildInputs should be built with the usual gcc-wrapper
# And the same for propagatedBuildInputs.
buildDrv = stdenv.mkDerivation args;
nativeDrv = stdenv.mkDerivation args;
# Temporary expression until the cross_renaming, to handle the
# case of pkgconfig given as buildInput, but to be used as
# buildNativeInput.
hostAsBuildDrv = drv: builtins.unsafeDiscardStringContext
drv.buildDrv.drvPath == builtins.unsafeDiscardStringContext
drv.hostDrv.drvPath;
drv.nativeDrv.drvPath == builtins.unsafeDiscardStringContext
drv.crossDrv.drvPath;
buildInputsNotNull = stdenv.lib.filter
(drv: builtins.isAttrs drv && drv ? buildDrv) buildInputs;
(drv: builtins.isAttrs drv && drv ? nativeDrv) buildInputs;
nativeInputsFromBuildInputs = stdenv.lib.filter (hostAsBuildDrv) buildInputsNotNull;
# We should overwrite the input attributes in hostDrv, to overwrite
# We should overwrite the input attributes in crossDrv, to overwrite
# the defaults for only-native builds in the base stdenv
hostDrv = if (cross == null) then buildDrv else
crossDrv = if (cross == null) then nativeDrv else
stdenv.mkDerivation (args // {
name = name + "-" + cross.config;
buildNativeInputs = buildNativeInputsDrvs
++ nativeInputsFromBuildInputs
++ [ gccCross binutilsCross ] ++
stdenv.lib.optional selfBuildNativeInput buildDrv;
stdenv.lib.optional selfBuildNativeInput nativeDrv;
# Cross-linking dynamic libraries, every buildInput should
# be propagated because ld needs the -rpath-link to find
@ -178,8 +178,8 @@ rec {
crossConfig = cross.config;
} // (if args ? crossAttrs then args.crossAttrs else {}));
in buildDrv // {
inherit hostDrv buildDrv;
in nativeDrv // {
inherit crossDrv nativeDrv;
};
} // {
inherit cross gccCross binutilsCross;

View file

@ -197,7 +197,7 @@ addToCrossEnv() {
local pkg=$1
# Some programs put important build scripts (freetype-config and similar)
# into their hostDrv bin path. Intentionally these should go after
# into their crossDrv bin path. Intentionally these should go after
# the nativePkgs in PATH.
if [ -d $1/bin ]; then
addToSearchPath _PATH $1/bin

View file

@ -25,9 +25,9 @@ stdenv.mkDerivation rec {
inherit fontDirectories;
patchPhase = ''
sed -i -e 's,$(includedir)/pixman-1,${if stdenv ? cross then pixman.hostDrv else pixman}/include/pixman-1,' unix/xserver/hw/vnc/Makefile.am
sed -i -e '/^$pidFile/a$ENV{XKB_BINDIR}="${if stdenv ? cross then xkbcomp.hostDrv else xkbcomp}/bin";' unix/vncserver
sed -i -e '/^\$cmd \.= " -pn";/a$cmd .= " -xkbdir ${if stdenv ? cross then xkeyboard_config.hostDrv else xkeyboard_config}/etc/X11/xkb";' unix/vncserver
sed -i -e 's,$(includedir)/pixman-1,${if stdenv ? cross then pixman.crossDrv else pixman}/include/pixman-1,' unix/xserver/hw/vnc/Makefile.am
sed -i -e '/^$pidFile/a$ENV{XKB_BINDIR}="${if stdenv ? cross then xkbcomp.crossDrv else xkbcomp}/bin";' unix/vncserver
sed -i -e '/^\$cmd \.= " -pn";/a$cmd .= " -xkbdir ${if stdenv ? cross then xkeyboard_config.crossDrv else xkeyboard_config}/etc/X11/xkb";' unix/vncserver
fontPath=
for i in $fontDirectories; do
@ -69,7 +69,7 @@ stdenv.mkDerivation rec {
'';
crossAttrs = {
buildInputs = (map (x : x.hostDrv) (buildInputs ++ [
buildInputs = (map (x : x.crossDrv) (buildInputs ++ [
fixesproto damageproto xcmiscproto bigreqsproto randrproto renderproto
fontsproto videoproto compositeproto scrnsaverproto resourceproto
libxkbfile libXfont libpciaccess xineramaproto

View file

@ -22,11 +22,11 @@ stdenv.mkDerivation rec {
crossAttrs = ({
buildInputs = [ gmp ]
++ stdenv.lib.optional aclSupport acl.hostDrv
++ stdenv.lib.optional selinuxSupport libselinux.hostDrv
++ stdenv.lib.optional selinuxSupport libsepol.hostDrv
++ stdenv.lib.optional aclSupport acl.crossDrv
++ stdenv.lib.optional selinuxSupport libselinux.crossDrv
++ stdenv.lib.optional selinuxSupport libsepol.crossDrv
++ stdenv.lib.optional (stdenv.gccCross.libc ? libiconv)
stdenv.gccCross.libc.libiconv.hostDrv;
stdenv.gccCross.libc.libiconv.crossDrv;
# Needed for fstatfs()
# I don't know why it is not properly detected cross building with glibc.

View file

@ -45,7 +45,7 @@ stdenv.mkDerivation rec {
# We should refer to the cross built openssl
# For the 'urandom', maybe it should be a cross-system option
configureFlags = ''
${if sslSupport then "--with-ssl=${openssl.hostDrv}" else "--without-ssl"}
${if sslSupport then "--with-ssl=${openssl.crossDrv}" else "--without-ssl"}
${if linkStatic then "--enable-static --disable-shared" else ""}
--with-random /dev/urandom
'';

View file

@ -39,8 +39,8 @@ stdenv.mkDerivation rec {
crossAttrs = {
postUnpack =
'' export CPATH="${bzip2.hostDrv}/include"
export NIX_CROSS_LDFLAGS="-L${bzip2.hostDrv}/lib -rpath-link ${bzip2.hostDrv}/lib $NIX_CROSS_LDFLAGS"
'' export CPATH="${bzip2.crossDrv}/include"
export NIX_CROSS_LDFLAGS="-L${bzip2.crossDrv}/lib -rpath-link ${bzip2.crossDrv}/lib $NIX_CROSS_LDFLAGS"
'';
configureFlags =

View file

@ -39,8 +39,8 @@ stdenv.mkDerivation rec {
crossAttrs = {
postUnpack =
'' export CPATH="${bzip2.hostDrv}/include"
export NIX_CROSS_LDFLAGS="-L${bzip2.hostDrv}/lib -rpath-link ${bzip2.hostDrv}/lib $NIX_CROSS_LDFLAGS"
'' export CPATH="${bzip2.crossDrv}/include"
export NIX_CROSS_LDFLAGS="-L${bzip2.crossDrv}/lib -rpath-link ${bzip2.crossDrv}/lib $NIX_CROSS_LDFLAGS"
'';
configureFlags =

View file

@ -223,7 +223,7 @@ let
defaultStdenv;
forceBuildDrv = drv : if (crossSystem == null) then drv else
(drv // { hostDrv = drv.buildDrv; });
(drv // { crossDrv = drv.nativeDrv; });
# A stdenv capable of building 32-bit binaries. On x86_64-linux,
# it uses GCC compiled with multilib support; on i686-linux, it's
@ -1276,7 +1276,7 @@ let
gettext = null;
readline = null;
devicemapper = null;
}).hostDrv)
}).crossDrv)
{ hurd = gnu.hurdCrossIntermediate; })
else null;
@ -2045,7 +2045,7 @@ let
# http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43944
profiledCompiler = if stdenv.isArm then false else true;
# When building `gcc.hostDrv' (a "Canadian cross", with host == target
# When building `gcc.crossDrv' (a "Canadian cross", with host == target
# and host != build), `cross' must be null but the cross-libc must still
# be passed.
cross = null;
@ -2074,7 +2074,7 @@ let
# http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43944
profiledCompiler = if stdenv.isArm then false else true;
# When building `gcc.hostDrv' (a "Canadian cross", with host == target
# When building `gcc.crossDrv' (a "Canadian cross", with host == target
# and host != build), `cross' must be null but the cross-libc must still
# be passed.
cross = null;
@ -2101,7 +2101,7 @@ let
# We can enable it back some day. This makes the *gcc* builds faster now.
profiledCompiler = false;
# When building `gcc.hostDrv' (a "Canadian cross", with host == target
# When building `gcc.crossDrv' (a "Canadian cross", with host == target
# and host != build), `cross' must be null but the cross-libc must still
# be passed.
cross = null;
@ -3176,7 +3176,7 @@ let
pmccabe = callPackage ../development/tools/misc/pmccabe { };
/* Make pkgconfig always return a buildDrv, never a proper hostDrv,
/* Make pkgconfig always return a nativeDrv, never a proper crossDrv,
because most usage of pkgconfig as buildInput (inheritance of
pre-cross nixpkgs) means using it using as buildNativeInput
cross_renaming: we should make all programs use pkgconfig as
@ -3634,7 +3634,7 @@ let
machHeaders = null;
hurdHeaders = null;
gccCross = null;
}) // (if crossSystem != null then { hostDrv = glibc213Cross; } else {});
}) // (if crossSystem != null then { crossDrv = glibc213Cross; } else {});
glibc213Cross = forceBuildDrv (makeOverridable (import ../development/libraries/glibc/2.13)
(let crossGNU = crossSystem != null && crossSystem.config == "i586-pc-gnu";
@ -5583,7 +5583,7 @@ let
libuuid =
if crossSystem != null && crossSystem.config == "i586-pc-gnu"
then (utillinux // {
hostDrv = lib.overrideDerivation utillinux.hostDrv (args: {
crossDrv = lib.overrideDerivation utillinux.crossDrv (args: {
# `libblkid' fails to build on GNU/Hurd.
configureFlags = args.configureFlags
+ " --disable-libblkid --disable-mount --disable-libmount"

View file

@ -5,21 +5,21 @@ let
/* Basic list of packages to cross-build */
basicHostDrv = {
gccCrossStageFinal = nativePlatforms;
bison.hostDrv = nativePlatforms;
busybox.hostDrv = nativePlatforms;
coreutils.hostDrv = nativePlatforms;
dropbear.hostDrv = nativePlatforms;
tigervnc.hostDrv = nativePlatforms;
#openoffice.hostDrv = nativePlatforms;
wxGTK.hostDrv = nativePlatforms;
bison.crossDrv = nativePlatforms;
busybox.crossDrv = nativePlatforms;
coreutils.crossDrv = nativePlatforms;
dropbear.crossDrv = nativePlatforms;
tigervnc.crossDrv = nativePlatforms;
#openoffice.crossDrv = nativePlatforms;
wxGTK.crossDrv = nativePlatforms;
#firefox = nativePlatforms;
xorg = {
#xorgserver.hostDrv = nativePlatforms;
#xorgserver.crossDrv = nativePlatforms;
};
nixUnstable.hostDrv = nativePlatforms;
linuxPackages_3_3.kernel.hostDrv = linux;
linuxPackages_3_4.kernel.hostDrv = linux;
linuxPackages_3_6.kernel.hostDrv = linux;
nixUnstable.crossDrv = nativePlatforms;
linuxPackages_3_3.kernel.crossDrv = linux;
linuxPackages_3_4.kernel.crossDrv = linux;
linuxPackages_3_6.kernel.crossDrv = linux;
};
/* Basic list of packages to be natively built,
@ -50,7 +50,7 @@ in {
crossSheevaplugLinux = mapTestOnCross crossSystem (
basic //
{
ubootSheevaplug.hostDrv = nativePlatforms;
ubootSheevaplug.crossDrv = nativePlatforms;
});
}) // (
@ -79,7 +79,7 @@ in {
crossSheevaplugLinuxUclibc = mapTestOnCross crossSystem (
basic //
{
ubootSheevaplug.hostDrv = nativePlatforms;
ubootSheevaplug.crossDrv = nativePlatforms;
});
}) // (
@ -153,14 +153,14 @@ let
};
in {
crossMingw32 = mapTestOnCross crossSystem {
coreutils.hostDrv = nativePlatforms;
boehmgc.hostDrv = nativePlatforms;
gmp.hostDrv = nativePlatforms;
guile_1_8.hostDrv = nativePlatforms;
libffi.hostDrv = nativePlatforms;
libtool.hostDrv = nativePlatforms;
libunistring.hostDrv = nativePlatforms;
windows.wxMSW.hostDrv = nativePlatforms;
coreutils.crossDrv = nativePlatforms;
boehmgc.crossDrv = nativePlatforms;
gmp.crossDrv = nativePlatforms;
guile_1_8.crossDrv = nativePlatforms;
libffi.crossDrv = nativePlatforms;
libtool.crossDrv = nativePlatforms;
libunistring.crossDrv = nativePlatforms;
windows.wxMSW.crossDrv = nativePlatforms;
};
}) // (
@ -176,14 +176,14 @@ let
};
in {
crossMingwW64 = mapTestOnCross crossSystem {
coreutils.hostDrv = nativePlatforms;
boehmgc.hostDrv = nativePlatforms;
gmp.hostDrv = nativePlatforms;
guile_1_8.hostDrv = nativePlatforms;
libffi.hostDrv = nativePlatforms;
libtool.hostDrv = nativePlatforms;
libunistring.hostDrv = nativePlatforms;
windows.wxMSW.hostDrv = nativePlatforms;
coreutils.crossDrv = nativePlatforms;
boehmgc.crossDrv = nativePlatforms;
gmp.crossDrv = nativePlatforms;
guile_1_8.crossDrv = nativePlatforms;
libffi.crossDrv = nativePlatforms;
libtool.crossDrv = nativePlatforms;
libunistring.crossDrv = nativePlatforms;
windows.wxMSW.crossDrv = nativePlatforms;
};
}) // (
@ -202,34 +202,34 @@ let
in {
crossGNU = mapTestOnCross crossSystem {
gnu.hurdCross = nativePlatforms;
gnu.mach.hostDrv = nativePlatforms;
gnu.mach.crossDrv = nativePlatforms;
gnu.mig = nativePlatforms;
gnu.smbfs.hostDrv = nativePlatforms;
gnu.smbfs.crossDrv = nativePlatforms;
coreutils.hostDrv = nativePlatforms;
ed.hostDrv = nativePlatforms;
grub2.hostDrv = nativePlatforms;
inetutils.hostDrv = nativePlatforms;
boehmgc.hostDrv = nativePlatforms;
findutils.hostDrv = nativePlatforms;
gcc.hostDrv = nativePlatforms;
gcc46.hostDrv = nativePlatforms;
gdb.hostDrv = nativePlatforms;
gmp.hostDrv = nativePlatforms;
gnugrep.hostDrv = nativePlatforms;
gnumake.hostDrv = nativePlatforms;
gnused.hostDrv = nativePlatforms;
guile_1_8.hostDrv = nativePlatforms;
guile.hostDrv = nativePlatforms;
libffi.hostDrv = nativePlatforms;
libtool.hostDrv = nativePlatforms;
libunistring.hostDrv = nativePlatforms;
lsh.hostDrv = nativePlatforms;
nixUnstable.hostDrv = nativePlatforms;
openssl.hostDrv = nativePlatforms; # dependency of Nix
patch.hostDrv = nativePlatforms;
samba_light.hostDrv = nativePlatforms; # needed for `runInGenericVM'
zile.hostDrv = nativePlatforms;
coreutils.crossDrv = nativePlatforms;
ed.crossDrv = nativePlatforms;
grub2.crossDrv = nativePlatforms;
inetutils.crossDrv = nativePlatforms;
boehmgc.crossDrv = nativePlatforms;
findutils.crossDrv = nativePlatforms;
gcc.crossDrv = nativePlatforms;
gcc46.crossDrv = nativePlatforms;
gdb.crossDrv = nativePlatforms;
gmp.crossDrv = nativePlatforms;
gnugrep.crossDrv = nativePlatforms;
gnumake.crossDrv = nativePlatforms;
gnused.crossDrv = nativePlatforms;
guile_1_8.crossDrv = nativePlatforms;
guile.crossDrv = nativePlatforms;
libffi.crossDrv = nativePlatforms;
libtool.crossDrv = nativePlatforms;
libunistring.crossDrv = nativePlatforms;
lsh.crossDrv = nativePlatforms;
nixUnstable.crossDrv = nativePlatforms;
openssl.crossDrv = nativePlatforms; # dependency of Nix
patch.crossDrv = nativePlatforms;
samba_light.crossDrv = nativePlatforms; # needed for `runInGenericVM'
zile.crossDrv = nativePlatforms;
};
}) // (
@ -261,13 +261,13 @@ let
in {
fuloongminipc = mapTestOnCross crossSystem {
coreutils.hostDrv = nativePlatforms;
ed.hostDrv = nativePlatforms;
grub2.hostDrv = nativePlatforms;
inetutils.hostDrv = nativePlatforms;
nixUnstable.hostDrv = nativePlatforms;
patch.hostDrv = nativePlatforms;
zile.hostDrv = nativePlatforms;
coreutils.crossDrv = nativePlatforms;
ed.crossDrv = nativePlatforms;
grub2.crossDrv = nativePlatforms;
inetutils.crossDrv = nativePlatforms;
nixUnstable.crossDrv = nativePlatforms;
patch.crossDrv = nativePlatforms;
zile.crossDrv = nativePlatforms;
};
}) // (
@ -321,20 +321,20 @@ let
in {
nanonote = mapTestOnCross crossSystem {
coreutils.hostDrv = nativePlatforms;
ed.hostDrv = nativePlatforms;
inetutils.hostDrv = nativePlatforms;
nixUnstable.hostDrv = nativePlatforms;
patch.hostDrv = nativePlatforms;
zile.hostDrv = nativePlatforms;
prboom.hostDrv = nativePlatforms;
vim.hostDrv = nativePlatforms;
lynx.hostDrv = nativePlatforms;
patchelf.hostDrv = nativePlatforms;
nix.hostDrv = nativePlatforms;
fossil.hostDrv = nativePlatforms;
binutils.hostDrv = nativePlatforms;
mpg123.hostDrv = nativePlatforms;
yacas.hostDrv = nativePlatforms;
coreutils.crossDrv = nativePlatforms;
ed.crossDrv = nativePlatforms;
inetutils.crossDrv = nativePlatforms;
nixUnstable.crossDrv = nativePlatforms;
patch.crossDrv = nativePlatforms;
zile.crossDrv = nativePlatforms;
prboom.crossDrv = nativePlatforms;
vim.crossDrv = nativePlatforms;
lynx.crossDrv = nativePlatforms;
patchelf.crossDrv = nativePlatforms;
nix.crossDrv = nativePlatforms;
fossil.crossDrv = nativePlatforms;
binutils.crossDrv = nativePlatforms;
mpg123.crossDrv = nativePlatforms;
yacas.crossDrv = nativePlatforms;
};
})

View file

@ -65,7 +65,7 @@ rec {
/* Similar to the testOn function, but with an additional 'crossSystem'
* parameter for allPackages, defining the target platform for cross builds,
* and triggering the build of the host derivation (cross built - hostDrv). */
* and triggering the build of the host derivation (cross built - crossDrv). */
mapTestOnCross = crossSystem: pkgs.lib.mapAttrsRecursiveCond
(as: !(as ? type && as.type == "job"))
(path: value: