nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{stdenv, fetchurl, libusb}:
2
3stdenv.mkDerivation rec {
4 name = "libftdi-0.20";
5
6 src = fetchurl {
7 url = "https://www.intra2net.com/en/developer/libftdi/download/${name}.tar.gz";
8 sha256 = "13l39f6k6gff30hsgh0wa2z422g9pyl91rh8a8zz6f34k2sxaxii";
9 };
10
11 buildInputs = [ libusb ];
12
13 propagatedBuildInputs = [ libusb ];
14
15 # Hack to avoid TMPDIR in RPATHs.
16 preFixup = ''rm -rf "$(pwd)" '';
17 configureFlags = [ "--with-async-mode" ];
18
19 # allow async mode. from ubuntu. see:
20 # https://bazaar.launchpad.net/~ubuntu-branches/ubuntu/trusty/libftdi/trusty/view/head:/debian/patches/04_async_mode.diff
21 patchPhase = ''
22 substituteInPlace ./src/ftdi.c \
23 --replace "ifdef USB_CLASS_PTP" "if 0"
24 '';
25
26 meta = {
27 description = "A library to talk to FTDI chips using libusb";
28 homepage = https://www.intra2net.com/en/developer/libftdi/;
29 license = stdenv.lib.licenses.lgpl21;
30 platforms = stdenv.lib.platforms.linux;
31 };
32}