1{
2 stdenv,
3 lib,
4 buildPythonPackage,
5 fetchFromGitHub,
6 setuptools,
7 curl-impersonate-chrome,
8 cffi,
9 certifi,
10 typing-extensions,
11}:
12
13buildPythonPackage rec {
14 pname = "curl-cffi";
15 version = "0.7.4";
16 pyproject = true;
17
18 src = fetchFromGitHub {
19 owner = "lexiforest";
20 repo = "curl_cffi";
21 tag = "v${version}";
22 hash = "sha256-Q1VppzQ1Go+ia1D1BemTf40o9wV0miWyoGy/tY+95qE==";
23 };
24
25 patches = [ ./use-system-libs.patch ];
26 buildInputs = [ curl-impersonate-chrome ];
27
28 build-system = [
29 cffi
30 setuptools
31 ];
32
33 dependencies = [
34 cffi
35 certifi
36 typing-extensions
37 ];
38
39 env = lib.optionalAttrs stdenv.cc.isGNU {
40 NIX_CFLAGS_COMPILE = "-Wno-error=incompatible-pointer-types";
41 };
42
43 pythonImportsCheck = [ "curl_cffi" ];
44
45 meta = with lib; {
46 description = "Python binding for curl-impersonate via cffi";
47 homepage = "https://curl-cffi.readthedocs.io";
48 license = licenses.mit;
49 maintainers = with maintainers; [ chuangzhu ];
50 };
51}