diff --git a/pkgs/tools/misc/xburst-tools/default.nix b/pkgs/tools/misc/xburst-tools/default.nix index 4f4de602c6c..2408a1cd35c 100644 --- a/pkgs/tools/misc/xburst-tools/default.nix +++ b/pkgs/tools/misc/xburst-tools/default.nix @@ -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"; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 790724085a0..339278300e8 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -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 {