From 6c8f4fd0ef26f2b999b01feec0cf90e88dc92f59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Forsman?= Date: Sat, 31 May 2014 13:10:41 +0200 Subject: [PATCH] libftdi1: new package This is the 1.x version of libftdi, as opposed to our existing libftdi 0.20 package. (AVRDUDE is an (optional) dependee of libftdi1.) --- pkgs/development/libraries/libftdi/1.x.nix | 42 ++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 ++ 2 files changed, 44 insertions(+) create mode 100644 pkgs/development/libraries/libftdi/1.x.nix diff --git a/pkgs/development/libraries/libftdi/1.x.nix b/pkgs/development/libraries/libftdi/1.x.nix new file mode 100644 index 000000000000..273bdb3136e0 --- /dev/null +++ b/pkgs/development/libraries/libftdi/1.x.nix @@ -0,0 +1,42 @@ +{ stdenv, fetchurl, cmake, pkgconfig, libusb1, confuse +, cppSupport ? true, boost ? null +, pythonSupport ? true, python ? null, swig ? null +, docSupport ? true, doxygen ? null +}: + +assert cppSupport -> boost != null; +assert pythonSupport -> python != null && swig != null; +assert docSupport -> doxygen != null; + +stdenv.mkDerivation rec { + name = "libftdi1-1.1"; + + src = fetchurl { + url = "http://www.intra2net.com/en/developer/libftdi/download/${name}.tar.bz2"; + sha256 = "088yh8pxd6q53ssqndydcw1dkq51cjqyahc03lm6iip22cdazcf0"; + }; + + buildInputs = with stdenv.lib; [ cmake pkgconfig confuse ] + ++ optionals cppSupport [ boost ] + ++ optionals pythonSupport [ python swig ] + ++ optionals docSupport [ doxygen ]; + + 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"; + homepage = http://www.intra2net.com/en/developer/libftdi/; + license = with licenses; [ lgpl2 gpl2 ]; + platforms = platforms.linux; + maintainers = [ maintainers.bjornfor ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index d02161501c34..d3f302f5d22e 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -5085,6 +5085,8 @@ let libftdi = callPackage ../development/libraries/libftdi { }; + libftdi1 = callPackage ../development/libraries/libftdi/1.x.nix { }; + libgcrypt = callPackage ../development/libraries/libgcrypt { }; libgcrypt_1_6 = lowPrio (callPackage ../development/libraries/libgcrypt/1.6.nix { });