2021-01-19 06:50:56 +00:00
|
|
|
{ stdenv, fetchurl, cmake, pkg-config, libusb1, libconfuse
|
2014-05-31 12:10:41 +01:00
|
|
|
, cppSupport ? true, boost ? null
|
2019-11-28 11:50:30 +00:00
|
|
|
, pythonSupport ? true, python3 ? null, swig ? null
|
2014-05-31 12:10:41 +01:00
|
|
|
, docSupport ? true, doxygen ? null
|
|
|
|
}:
|
|
|
|
|
|
|
|
assert cppSupport -> boost != null;
|
2019-11-28 11:50:30 +00:00
|
|
|
assert pythonSupport -> python3 != null && swig != null;
|
2014-05-31 12:10:41 +01:00
|
|
|
assert docSupport -> doxygen != null;
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2017-11-25 21:17:03 +00:00
|
|
|
name = "libftdi1-1.4";
|
2017-06-20 06:43:38 +01:00
|
|
|
|
2014-05-31 12:10:41 +01:00
|
|
|
src = fetchurl {
|
2018-06-28 19:43:35 +01:00
|
|
|
url = "https://www.intra2net.com/en/developer/libftdi/download/${name}.tar.bz2";
|
2017-11-25 21:17:03 +00:00
|
|
|
sha256 = "0x0vncf6i92slgrn0h7ghkskqbglbs534220qa84d0qg114zndpc";
|
2014-05-31 12:10:41 +01:00
|
|
|
};
|
|
|
|
|
2021-01-19 06:50:56 +00:00
|
|
|
nativeBuildInputs = [ cmake pkg-config ];
|
2018-11-25 17:20:42 +00:00
|
|
|
buildInputs = with stdenv.lib; [ libconfuse ]
|
2014-05-31 12:10:41 +01:00
|
|
|
++ optionals cppSupport [ boost ]
|
2019-11-28 11:50:30 +00:00
|
|
|
++ optionals pythonSupport [ python3 swig ]
|
2014-05-31 12:10:41 +01:00
|
|
|
++ optionals docSupport [ doxygen ];
|
|
|
|
|
2018-05-27 21:41:06 +01:00
|
|
|
preBuild = stdenv.lib.optionalString docSupport ''
|
|
|
|
make doc_i
|
|
|
|
'';
|
|
|
|
|
2014-05-31 12:10:41 +01:00
|
|
|
propagatedBuildInputs = [ libusb1 ];
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
mkdir -p "$out/etc/udev/rules.d/"
|
|
|
|
cp ../packages/99-libftdi.rules "$out/etc/udev/rules.d/"
|
|
|
|
cp -r doc/man "$out/share/"
|
|
|
|
'' + stdenv.lib.optionalString docSupport ''
|
|
|
|
mkdir -p "$out/share/libftdi/doc/"
|
|
|
|
cp -r doc/html "$out/share/libftdi/doc/"
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
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/";
|
2014-05-31 12:10:41 +01:00
|
|
|
license = with licenses; [ lgpl2 gpl2 ];
|
2018-03-22 16:05:48 +00:00
|
|
|
platforms = with platforms; linux ++ darwin;
|
2014-05-31 12:10:41 +01:00
|
|
|
maintainers = [ maintainers.bjornfor ];
|
|
|
|
};
|
|
|
|
}
|