1{lib, stdenv, fetchurl}:
2
3stdenv.mkDerivation rec {
4 pname = "fxload";
5 version = "2002.04.11";
6
7 src = fetchurl {
8 url = "mirror://sourceforge/linux-hotplug/fxload-${lib.replaceStrings ["."] ["_"] version}.tar.gz";
9 sha256 = "1hql93bp3dxrv1p67nc63xsbqwljyynm997ysldrc3n9ifi6s48m";
10 };
11
12 patches = [
13 # Will be needed after linux-headers is updated to >= 2.6.21.
14 (fetchurl {
15 url = "http://sources.gentoo.org/viewcvs.py/*checkout*/gentoo-x86/sys-apps/fxload/files/fxload-20020411-linux-headers-2.6.21.patch?rev=1.1";
16 sha256 = "0ij0c8nr1rbyl5wmyv1cklhkxglvsqz32h21cjw4bjm151kgmk7p";
17 })
18 ];
19
20 preBuild = ''
21 substituteInPlace Makefile --replace /usr /
22 makeFlagsArray=(INSTALL=install prefix=$out)
23 '';
24
25 preInstall = ''
26 mkdir -p $out/sbin
27 mkdir -p $out/share/man/man8
28 mkdir -p $out/share/usb
29 '';
30
31 meta = with lib; {
32 homepage = "http://linux-hotplug.sourceforge.net/?selected=usb";
33 description = "Tool to upload firmware to Cypress EZ-USB microcontrollers";
34 license = licenses.gpl2;
35 platforms = platforms.linux;
36 };
37}