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 # Hack to avoid TMPDIR in RPATHs.
24 preFixup = ''rm -rf "$(pwd)" '';
25 configureFlags = lib.optional (!stdenv.isDarwin) "--with-async-mode";
27 # allow async mode. from ubuntu. see:
28 # https://bazaar.launchpad.net/~ubuntu-branches/ubuntu/trusty/libftdi/trusty/view/head:/debian/patches/04_async_mode.diff
30 substituteInPlace ./src/ftdi.c \
31 --replace "ifdef USB_CLASS_PTP" "if 0"
35 description = "A library to talk to FTDI chips using libusb";
36 homepage = "https://www.intra2net.com/en/developer/libftdi/";
37 license = lib.licenses.lgpl21;
38 platforms = lib.platforms.all;