Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at 20.09 908 B view raw
1{ stdenv, fetchPypi, buildPythonPackage, libusb1 }: 2 3buildPythonPackage rec { 4 pname = "pyusb"; 5 version = "1.0.2"; 6 7 src = fetchPypi { 8 inherit pname version; 9 sha256 = "0qkk2jn270jwwl1x26hmdhb14m9kkbrzzwzizdjcl1a29b6756sf"; 10 }; 11 12 # Fix the USB backend library lookup 13 postPatch = 14 '' 15 libusb=${libusb1.out}/lib/libusb-1.0${stdenv.hostPlatform.extensions.sharedLibrary} 16 test -f $libusb || { echo "ERROR: $libusb doesn't exist, please update/fix this build expression."; exit 1; } 17 sed -i -e "s|find_library=None|find_library=lambda _:\"$libusb\"|" usb/backend/libusb1.py 18 ''; 19 20 # No tests included 21 doCheck = false; 22 23 meta = with stdenv.lib; { 24 description = "Python USB access module (wraps libusb 1.0)"; # can use other backends 25 homepage = "https://pyusb.github.io/pyusb/"; 26 license = licenses.bsd3; 27 maintainers = with maintainers; [ bjornfor ]; 28 }; 29}