summary refs log tree commit diff
path: root/pkgs/tools/misc/xburst-tools/default.nix
blob: f3fdc7e2227f73c3495a3ca6a56daf7919c65497 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
{ lib, stdenv, fetchgit, libusb-compat-0_1, libusb1, autoconf, automake, libconfuse, pkg-config
, gccCross ? null
}:

let
  version = "2011-12-26";
in
stdenv.mkDerivation {
  pname = "xburst-tools";
  inherit version;

  src = fetchgit {
    url = "git://projects.qi-hardware.com/xburst-tools.git";
    rev = "c71ce8e15db25fe49ce8702917cb17720882e341";
    sha256 = "1hzdngs1l5ivvwnxjwzc246am6w1mj1aidcf0awh9yw0crzcjnjr";
  };

  preConfigure = ''
    sh autogen.sh
  '';

  configureFlags = lib.optionals (gccCross != null) [
    "--enable-firmware"
    "CROSS_COMPILE=${gccCross.targetPrefix}"
  ];

  hardeningDisable = [ "pic" "stackprotector" ];

  # Not to strip cross build binaries (this is for the gcc-cross-wrapper)
  dontCrossStrip = true;

  nativeBuildInputs = [ autoconf automake pkg-config ];
  buildInputs = [ libusb-compat-0_1 libusb1 libconfuse ] ++
    lib.optional (gccCross != null) gccCross;

  meta = {
    description = "Qi tools to access the Ben Nanonote USB_BOOT mode";
    license = lib.licenses.gpl3;
    homepage = "http://www.linux-mtd.infradead.org/";
    maintainers = with lib.maintainers; [viric];
    platforms = lib.platforms.x86_64;
  };
}