Making the xburst-tools for the Ben Nanonote build the firmware they need to

communicate with it. This involves making a cross-compiler for mipsel.

svn path=/nixpkgs/trunk/; revision=22818
This commit is contained in:
Lluís Batlle i Rossell 2010-07-29 23:26:07 +00:00
parent 537ad15e86
commit b044e64989
2 changed files with 44 additions and 4 deletions

View File

@ -1,4 +1,5 @@
{stdenv, fetchgit, libusb, autoconf, automake, confuse}:
{stdenv, fetchgit, libusb, autoconf, automake, confuse
, gccCross ? null}:
let
version = "2010-07-29";
@ -6,19 +7,30 @@ in
stdenv.mkDerivation {
name = "xburst-tools-${version}";
patches = [ ./gcc-4.4.patch ];
src = fetchgit {
url = git://projects.qi-hardware.com/xburst-tools.git;
rev = "00be212db22643ad602eaf60b30eb943f119e78d";
sha256 = "66ea1a81b71bad599d76691f07a986f9bb2ccecf397e8486b661d8baace3460e";
};
prePatch = ''
find . -name Makefile* -exec sed -i \
-e s/mipsel-openwrt-linux-/mipsel-unknown-linux-/ {} \;
'';
patches = [ ./gcc-4.4.patch ];
preConfigure = ''
sh autogen.sh
'';
buildInputs = [ libusb autoconf automake confuse ];
configureFlags = if gccCross != null then "--enable-firmware" else "";
# Not to strip cross build binaries (this is for the gcc-cross-wrapper)
dontCrossStrip = true;
buildInputs = [ libusb autoconf automake confuse ] ++
stdenv.lib.optional (gccCross != null) gccCross;
meta = {
description = "Qi tools to access the Ben Nanonote USB_BOOT mode";

View File

@ -1948,6 +1948,34 @@ let
xbursttools = import ../tools/misc/xburst-tools {
inherit stdenv fetchgit autoconf automake libusb confuse;
# It needs a cross compiler for mipsel to build the firmware it will
# load into the Ben Nanonote
gccCross = let
pkgsCross = (import ./all-packages.nix) {
inherit system;
inherit bootStdenv noSysDirs gccWithCC gccWithProfiling config;
# Ben Nanonote system
crossSystem = {
config = "mipsel-unknown-linux";
bigEndian = true;
arch = "mips";
float = "soft";
withTLS = true;
libc = "uclibc";
platform = {
name = "ben_nanonote";
kernelMajor = "2.6";
# It's not a bcm47xx processor, but for the headers this should work
kernelHeadersBaseConfig = "bcm47xx_defconfig";
kernelArch = "mips";
};
gcc = {
arch = "mips32";
};
};
};
in
pkgsCross.gccCrossStageStatic;
};
xclip = import ../tools/misc/xclip {