pythonPackages.pyusb: move to python-modules/

This commit is contained in:
Bjørn Forsman 2017-10-29 15:49:20 +01:00
parent 086ad07ed6
commit aaa3608b4b
2 changed files with 31 additions and 29 deletions

View File

@ -0,0 +1,30 @@
{ stdenv, fetchurl, buildPythonPackage, libusb, libusb1 }:
buildPythonPackage rec {
name = "pyusb-1.0.0";
src = fetchurl {
url = "https://pypi.python.org/packages/8a/19/66fb48a4905e472f5dfeda3a1bafac369fbf6d6fc5cf55b780864962652d/PyUSB-1.0.0.tar.gz";
sha256 = "0s2k4z06fapd5vp1gnrlf8a9sjpc03p9974lzw5k6ky39akzyd2v";
};
# Fix the USB backend library lookup
postPatch =
''
libusb=${libusb1.out}/lib/libusb-1.0${stdenv.hostPlatform.extensions.sharedLibrary}
test -f $libusb || { echo "ERROR: $libusb doesn't exist, please update/fix this build expression."; exit 1; }
sed -i -e "s|find_library=None|find_library=lambda _:\"$libusb\"|" usb/backend/libusb1.py
'';
propagatedBuildInputs = [ libusb ];
# No tests included
doCheck = false;
meta = with stdenv.lib; {
description = "Python USB access module (wraps libusb 1.0)"; # can use other backends
homepage = http://pyusb.sourceforge.net/;
license = licenses.bsd3;
maintainers = with maintainers; [ bjornfor ];
};
}

View File

@ -22812,35 +22812,7 @@ EOF
unidecode = callPackage ../development/python-modules/unidecode {}; unidecode = callPackage ../development/python-modules/unidecode {};
pyusb = buildPythonPackage rec { pyusb = callPackage ../development/python-modules/pyusb {};
name = "pyusb-1.0.0";
src = pkgs.fetchurl {
url = "https://pypi.python.org/packages/8a/19/66fb48a4905e472f5dfeda3a1bafac369fbf6d6fc5cf55b780864962652d/PyUSB-1.0.0.tar.gz";
sha256 = "0s2k4z06fapd5vp1gnrlf8a9sjpc03p9974lzw5k6ky39akzyd2v";
};
# Fix the USB backend library lookup
postPatch =
''
libusb=${pkgs.libusb1.out}/lib/libusb-1.0${stdenv.hostPlatform.extensions.sharedLibrary}
test -f $libusb || { echo "ERROR: $libusb doesn't exist, please update/fix this build expression."; exit 1; }
sed -i -e "s|find_library=None|find_library=lambda _:\"$libusb\"|" usb/backend/libusb1.py
'';
propagatedBuildInputs = [ pkgs.libusb ];
# No tests included
doCheck = false;
meta = {
description = "Python USB access module (wraps libusb 1.0)"; # can use other backends
homepage = http://pyusb.sourceforge.net/;
license = licenses.bsd3;
maintainers = with maintainers; [ bjornfor ];
};
};
BlinkStick = buildPythonPackage rec { BlinkStick = buildPythonPackage rec {
name = "BlinkStick-${version}"; name = "BlinkStick-${version}";