curl-cffi.nix 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. {
  2. stdenv,
  3. lib,
  4. python,
  5. buildPythonPackage,
  6. fetchPypi,
  7. curl-impersonate-chrome,
  8. }:
  9. buildPythonPackage rec {
  10. pname = "curl-cffi";
  11. # version = "0.13.0"; # uses option PROXY_CREDENTIAL_NO_REUSE, unavailable in current libcurl
  12. version = "0.10.0";
  13. pyproject = true;
  14. src = fetchPypi {
  15. pname = "curl_cffi";
  16. version = version;
  17. # hash = "sha256-YuzZCjgr1QI3UONgbgqnyxo6i6QcFCcLjl4Unr9yxco="; # 0.13.0
  18. hash = "sha256-PjezUmjKWEkvVO0CCuS1DDPuDeutQUXbn3RvBO1GbrA="; # 0.10.0
  19. };
  20. patches = [ ./use-system-libs.patch ];
  21. buildInputs = [ curl-impersonate-chrome ];
  22. build-system = with python.pkgs; [
  23. cffi
  24. setuptools
  25. ];
  26. dependencies = with python.pkgs; [
  27. cffi
  28. certifi
  29. typing-extensions
  30. ];
  31. env = lib.optionalAttrs stdenv.cc.isGNU {
  32. NIX_CFLAGS_COMPILE = "-Wno-error=incompatible-pointer-types";
  33. };
  34. pythonImportsCheck = [ "curl_cffi" ];
  35. meta = with lib; {
  36. description = "Python binding for curl-impersonate via cffi";
  37. homepage = "https://curl-cffi.readthedocs.io";
  38. license = licenses.mit;
  39. maintainers = with maintainers; [ chuangzhu ];
  40. };
  41. }