10 stdenv.mkDerivation rec {
15 url = "https://www.intra2net.com/en/developer/libftdi/download/${pname}-${version}.tar.gz";
16 sha256 = "13l39f6k6gff30hsgh0wa2z422g9pyl91rh8a8zz6f34k2sxaxii";
19 buildInputs = [ libusb-compat-0_1 ] ++ lib.optionals stdenv.isDarwin [ libobjc Security IOKit ];
21 propagatedBuildInputs = [ libusb-compat-0_1 ];
23 configureFlags = lib.optional (!stdenv.isDarwin) "--with-async-mode";
25 # allow async mode. from ubuntu. see:
26 # https://bazaar.launchpad.net/~ubuntu-branches/ubuntu/trusty/libftdi/trusty/view/head:/debian/patches/04_async_mode.diff
28 substituteInPlace ./src/ftdi.c \
29 --replace "ifdef USB_CLASS_PTP" "if 0"
32 # remove forbidden references to $TMPDIR
33 preFixup = lib.optionalString stdenv.isLinux ''
34 for f in "$out"/bin/*; do
36 patchelf --shrink-rpath --allowed-rpath-prefixes "$NIX_STORE" "$f"
42 description = "A library to talk to FTDI chips using libusb";
43 homepage = "https://www.intra2net.com/en/developer/libftdi/";
44 license = lib.licenses.lgpl21;
45 platforms = lib.platforms.all;