about summary refs log tree commit diff
path: root/pkgs/development/python-modules/curl-cffi/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/python-modules/curl-cffi/default.nix')
-rw-r--r--pkgs/development/python-modules/curl-cffi/default.nix42
1 files changed, 42 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/curl-cffi/default.nix b/pkgs/development/python-modules/curl-cffi/default.nix
new file mode 100644
index 0000000000000..76a4566cce7cb
--- /dev/null
+++ b/pkgs/development/python-modules/curl-cffi/default.nix
@@ -0,0 +1,42 @@
+{
+  lib,
+  buildPythonPackage,
+  fetchFromGitHub,
+  setuptools,
+  curl-impersonate-chrome,
+  cffi,
+  certifi,
+}:
+
+buildPythonPackage rec {
+  pname = "curl-cffi";
+  version = "0.7.0";
+
+  src = fetchFromGitHub {
+    owner = "yifeikong";
+    repo = "curl_cffi";
+    rev = "refs/tags/v${version}";
+    hash = "sha256-txrJNUzswAPeH4Iazn0iKJI0Rqk0HHRoDrtTfDHKMoo=";
+  };
+
+  patches = [ ./use-system-libs.patch ];
+  buildInputs = [ curl-impersonate-chrome ];
+
+  format = "pyproject";
+  build-system = [ setuptools ];
+
+  nativeBuildInputs = [ cffi ];
+  propagatedBuildInputs = [
+    cffi
+    certifi
+  ];
+
+  pythonImportsCheck = [ "curl_cffi" ];
+
+  meta = with lib; {
+    description = "Python binding for curl-impersonate via cffi";
+    homepage = "https://curl-cffi.readthedocs.io";
+    license = licenses.mit;
+    maintainers = with maintainers; [ chuangzhu ];
+  };
+}