python-pyusb: new package

PyUSB is a Python module that wraps libusb 1.0. (It can wrap other USB
libraries too, but I've hardcoded it for libusb as it seems the most
appropriate.)
This commit is contained in:
Bjørn Forsman 2014-05-13 22:51:54 +02:00
parent 8967d2d3b3
commit bc847600a9

View File

@ -8783,6 +8783,31 @@ rec {
};
};
pyusb = buildPythonPackage rec {
name = "pyusb-1.0.0b1";
src = fetchurl {
url = "https://pypi.python.org/packages/source/p/pyusb/${name}.tar.gz";
md5 = "5cc9c7dd77b4d12fcc22fee3b39844bc";
};
# Fix the USB backend library lookup
postPatch = ''
libusb=${pkgs.libusb1}/lib/libusb-1.0.so
test -f $libusb || { echo "ERROR: $libusb doesn't exist, please update/fix this build expression."; exit 1; }
sed -i -e "s|libname = .*|libname = \"$libusb\"|" usb/backend/libusb1.py
'';
meta = with stdenv.lib; {
description = "Python USB access module (wraps libusb 1.0)"; # can use other backends
homepage = http://pyusb.sourceforge.net/;
license = "BSD";
maintainers = [ maintainers.bjornfor ];
};
};
txamqp = buildPythonPackage rec {
name = "txamqp-${version}";
version = "0.3";