summary refs log tree commit diff
path: root/pkgs/development/libraries/libftdi
diff options
context:
space:
mode:
authorAustin Seipp <aseipp@pobox.com>2018-02-21 01:24:36 -0600
committerAustin Seipp <aseipp@pobox.com>2018-03-02 21:20:54 -0600
commit0339dc5fae62253c3554619daf9ed01fe2fa4779 (patch)
treeebcffdf5c5a17448e03a1a0933b82c8db6f48ef6 /pkgs/development/libraries/libftdi
parentae7efee4fa9b219ed1c7a10a0dd66739798450df (diff)
downloadnixpkgs-0339dc5fae62253c3554619daf9ed01fe2fa4779.tar
nixpkgs-0339dc5fae62253c3554619daf9ed01fe2fa4779.tar.gz
nixpkgs-0339dc5fae62253c3554619daf9ed01fe2fa4779.tar.bz2
nixpkgs-0339dc5fae62253c3554619daf9ed01fe2fa4779.tar.lz
nixpkgs-0339dc5fae62253c3554619daf9ed01fe2fa4779.tar.xz
nixpkgs-0339dc5fae62253c3554619daf9ed01fe2fa4779.tar.zst
nixpkgs-0339dc5fae62253c3554619daf9ed01fe2fa4779.zip
libftdi: enable async mode
Apparently, async mode for libftdi 0.20 is allegedly disabled when using
libusb-compat wrappers, as libftdi does not really support libftdi 1.x. Because
we only ship libusb-compat, this would normally make async mode completely
unavailable.

Except distributions like Ubuntu just disable this check completely! See this
patch from Launchpad:

https://bazaar.launchpad.net/~ubuntu-branches/ubuntu/trusty/libftdi/trusty/view/head:/debian/patches/04_async_mode.diff

In the spirit of good competition (and feature parity for software that
*doesn't* support the synchronous mode, thanks to Ubuntu silently ensuring
their async-only paths work) we enable this just the same.

Signed-off-by: Austin Seipp <aseipp@pobox.com>
Diffstat (limited to 'pkgs/development/libraries/libftdi')
-rw-r--r--pkgs/development/libraries/libftdi/default.nix8
1 files changed, 8 insertions, 0 deletions
diff --git a/pkgs/development/libraries/libftdi/default.nix b/pkgs/development/libraries/libftdi/default.nix
index 2f499d3af87..fff760c5519 100644
--- a/pkgs/development/libraries/libftdi/default.nix
+++ b/pkgs/development/libraries/libftdi/default.nix
@@ -14,6 +14,14 @@ stdenv.mkDerivation rec {
 
   # Hack to avoid TMPDIR in RPATHs.
   preFixup = ''rm -rf "$(pwd)" '';
+  configureFlags = [ "--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";