2021-01-27 10:21:31 +00:00
|
|
|
{lib, stdenv, fetchurl, libusb-compat-0_1}:
|
2009-09-24 22:28:27 +01:00
|
|
|
|
2021-01-27 10:21:31 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2021-06-22 14:21:29 +01:00
|
|
|
pname = "libftdi";
|
|
|
|
version = "0.20";
|
2018-03-19 23:01:52 +00:00
|
|
|
|
2009-09-24 22:28:27 +01:00
|
|
|
src = fetchurl {
|
2021-06-22 14:21:29 +01:00
|
|
|
url = "https://www.intra2net.com/en/developer/libftdi/download/${pname}-${version}.tar.gz";
|
2013-05-10 12:34:59 +01:00
|
|
|
sha256 = "13l39f6k6gff30hsgh0wa2z422g9pyl91rh8a8zz6f34k2sxaxii";
|
2009-09-24 22:28:27 +01:00
|
|
|
};
|
|
|
|
|
2020-04-28 04:29:39 +01:00
|
|
|
buildInputs = [ libusb-compat-0_1 ];
|
2009-09-24 22:28:27 +01:00
|
|
|
|
2020-04-28 04:29:39 +01:00
|
|
|
propagatedBuildInputs = [ libusb-compat-0_1 ];
|
2009-09-24 22:28:27 +01:00
|
|
|
|
2017-05-16 15:35:52 +01:00
|
|
|
# Hack to avoid TMPDIR in RPATHs.
|
|
|
|
preFixup = ''rm -rf "$(pwd)" '';
|
2021-01-27 10:21:31 +00:00
|
|
|
configureFlags = lib.optional (!stdenv.isDarwin) "--with-async-mode";
|
2018-02-21 07:24:36 +00:00
|
|
|
|
|
|
|
# allow async mode. from ubuntu. see:
|
|
|
|
# https://bazaar.launchpad.net/~ubuntu-branches/ubuntu/trusty/libftdi/trusty/view/head:/debian/patches/04_async_mode.diff
|
|
|
|
patchPhase = ''
|
|
|
|
substituteInPlace ./src/ftdi.c \
|
|
|
|
--replace "ifdef USB_CLASS_PTP" "if 0"
|
|
|
|
'';
|
2017-05-16 15:35:52 +01:00
|
|
|
|
2009-09-24 22:28:27 +01:00
|
|
|
meta = {
|
|
|
|
description = "A library to talk to FTDI chips using libusb";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://www.intra2net.com/en/developer/libftdi/";
|
2019-08-20 18:56:45 +01:00
|
|
|
license = lib.licenses.lgpl21;
|
|
|
|
platforms = lib.platforms.all;
|
2009-09-24 22:28:27 +01:00
|
|
|
};
|
|
|
|
}
|