diff options
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/libftdi')
-rw-r--r-- | nixpkgs/pkgs/development/libraries/libftdi/1.x.nix | 47 | ||||
-rw-r--r-- | nixpkgs/pkgs/development/libraries/libftdi/default.nix | 32 |
2 files changed, 79 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/libftdi/1.x.nix b/nixpkgs/pkgs/development/libraries/libftdi/1.x.nix new file mode 100644 index 000000000000..ae599a97529b --- /dev/null +++ b/nixpkgs/pkgs/development/libraries/libftdi/1.x.nix @@ -0,0 +1,47 @@ +{ lib, stdenv, fetchurl, cmake, pkg-config, libusb1, libconfuse +, cppSupport ? true, boost ? null +, pythonSupport ? true, python3 ? null, swig ? null +, docSupport ? true, doxygen ? null +}: + +assert cppSupport -> boost != null; +assert pythonSupport -> python3 != null && swig != null; +assert docSupport -> doxygen != null; + +stdenv.mkDerivation rec { + name = "libftdi1-1.4"; + + src = fetchurl { + url = "https://www.intra2net.com/en/developer/libftdi/download/${name}.tar.bz2"; + sha256 = "0x0vncf6i92slgrn0h7ghkskqbglbs534220qa84d0qg114zndpc"; + }; + + nativeBuildInputs = [ cmake pkg-config ]; + buildInputs = with lib; [ libconfuse ] + ++ optionals cppSupport [ boost ] + ++ optionals pythonSupport [ python3 swig ] + ++ optionals docSupport [ doxygen ]; + + preBuild = lib.optionalString docSupport '' + make doc_i + ''; + + 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/" + '' + lib.optionalString docSupport '' + mkdir -p "$out/share/libftdi/doc/" + cp -r doc/html "$out/share/libftdi/doc/" + ''; + + meta = with lib; { + description = "A library to talk to FTDI chips using libusb"; + homepage = "https://www.intra2net.com/en/developer/libftdi/"; + license = with licenses; [ lgpl2 gpl2 ]; + platforms = with platforms; linux ++ darwin; + maintainers = [ maintainers.bjornfor ]; + }; +} diff --git a/nixpkgs/pkgs/development/libraries/libftdi/default.nix b/nixpkgs/pkgs/development/libraries/libftdi/default.nix new file mode 100644 index 000000000000..0326b9c4f64f --- /dev/null +++ b/nixpkgs/pkgs/development/libraries/libftdi/default.nix @@ -0,0 +1,32 @@ +{lib, stdenv, fetchurl, libusb-compat-0_1}: + +stdenv.mkDerivation rec { + name = "libftdi-0.20"; + + src = fetchurl { + url = "https://www.intra2net.com/en/developer/libftdi/download/${name}.tar.gz"; + sha256 = "13l39f6k6gff30hsgh0wa2z422g9pyl91rh8a8zz6f34k2sxaxii"; + }; + + buildInputs = [ libusb-compat-0_1 ]; + + propagatedBuildInputs = [ libusb-compat-0_1 ]; + + # Hack to avoid TMPDIR in RPATHs. + preFixup = ''rm -rf "$(pwd)" ''; + configureFlags = lib.optional (!stdenv.isDarwin) "--with-async-mode"; + + # 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" + ''; + + meta = { + description = "A library to talk to FTDI chips using libusb"; + homepage = "https://www.intra2net.com/en/developer/libftdi/"; + license = lib.licenses.lgpl21; + platforms = lib.platforms.all; + }; +} |