Trying to get a better expression for uboot upstream, allowing normal and cross build
with proper assertions. svn path=/nixpkgs/trunk/; revision=20319
This commit is contained in:
parent
0bae3266eb
commit
eb047010f8
@ -1,9 +1,23 @@
|
||||
{stdenv, fetchurl, unzip, platform}:
|
||||
{stdenv, fetchurl, unzip}:
|
||||
|
||||
# This does not cover the case for cross-building, but we need some filtering
|
||||
# for the normal stdenv, in order to build the nixpkgs tarball
|
||||
assert (stdenv.system != "i686-linux" && stdenv.system != "x86_64-linux")
|
||||
|| (stdenv ? cross);
|
||||
let
|
||||
platform = stdenv.platform;
|
||||
configureFun = ubootConfig :
|
||||
''
|
||||
make mrproper
|
||||
make ${ubootConfig} NBOOT=1 LE=1
|
||||
'';
|
||||
|
||||
buildFun = kernelArch :
|
||||
''
|
||||
unset src
|
||||
if test -z "$crossConfig"; then
|
||||
make clean all
|
||||
else
|
||||
make clean all ARCH=${kernelArch} CROSS_COMPILE=$crossConfig-
|
||||
fi
|
||||
'';
|
||||
in
|
||||
|
||||
stdenv.mkDerivation {
|
||||
name = "uboot-2009.11";
|
||||
@ -13,26 +27,6 @@ stdenv.mkDerivation {
|
||||
sha256 = "1rld7q3ww89si84g80hqskd1z995lni5r5xc4d4322n99wqiarh6";
|
||||
};
|
||||
|
||||
# patches = [ ./gas220.patch ];
|
||||
|
||||
# Remove the cross compiler prefix, and add reiserfs support
|
||||
configurePhase = assert (platform ? ubootConfig);
|
||||
''
|
||||
make mrproper
|
||||
make ${platform.ubootConfig} NBOOT=1 LE=1
|
||||
sed -i /CROSS_COMPILE/d include/config.mk
|
||||
'';
|
||||
|
||||
buildPhase = assert (platform ? kernelArch);
|
||||
''
|
||||
unset src
|
||||
if test -z "$crossConfig"; then
|
||||
make clean all
|
||||
else
|
||||
make clean all ARCH=${platform.kernelArch} CROSS_COMPILE=$crossConfig-
|
||||
fi
|
||||
'';
|
||||
|
||||
buildNativeInputs = [ unzip ];
|
||||
|
||||
dontStrip = true;
|
||||
@ -46,4 +40,24 @@ stdenv.mkDerivation {
|
||||
ensureDir $out/bin
|
||||
cp tools/{envcrc,mkimage} $out/bin
|
||||
'';
|
||||
|
||||
configurePhase =
|
||||
assert platform ? uboot && platform.uboot != null;
|
||||
assert (platform ? ubootConfig);
|
||||
configureFun platform.ubootConfig;
|
||||
|
||||
buildPhase = assert (platform ? kernelArch);
|
||||
buildFun platform.kernelArch;
|
||||
|
||||
crossAttrs = let
|
||||
cp = stdenv.cross.platform;
|
||||
in
|
||||
assert cp ? uboot && cp.uboot != null;
|
||||
{
|
||||
configurePhase = assert (cp ? ubootConfig);
|
||||
configureFun cp.ubootConfig;
|
||||
|
||||
buildPhase = assert (cp ? kernelArch);
|
||||
buildFun cp.kernelArch;
|
||||
};
|
||||
}
|
||||
|
@ -6344,7 +6344,7 @@ let
|
||||
else throw "Unknown uboot";
|
||||
|
||||
ubootUpstream = makeOverridable (import ../misc/uboot) {
|
||||
inherit fetchurl stdenv unzip platform;
|
||||
inherit fetchurl stdenv unzip;
|
||||
};
|
||||
|
||||
ubootSheevaplug = makeOverridable (import ../misc/uboot/sheevaplug.nix) {
|
||||
|
Loading…
Reference in New Issue
Block a user