mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-26 17:03:01 +00:00
Merge pull request #309401 from chuangzhu/curl-cffi
python3Packages.curl-cffi: init at 0.6.3
This commit is contained in:
commit
f1010e0469
49
pkgs/development/python-modules/curl-cffi/default.nix
Normal file
49
pkgs/development/python-modules/curl-cffi/default.nix
Normal file
@ -0,0 +1,49 @@
|
||||
{ lib
|
||||
, buildPythonPackage
|
||||
, fetchFromGitHub
|
||||
, setuptools
|
||||
, curl-impersonate-chrome
|
||||
, cffi
|
||||
, certifi
|
||||
}:
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "curl-cffi";
|
||||
version = "0.6.3";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "yifeikong";
|
||||
repo = "curl_cffi";
|
||||
rev = "v${version}";
|
||||
hash = "sha256-VeBh5wp/VEMDGR2YK06w34hBv9qHIyA+EiZHrhEhAGw=";
|
||||
};
|
||||
|
||||
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 ];
|
||||
};
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
diff --git a/scripts/build.py b/scripts/build.py
|
||||
index b705a0d..9bfcaab 100644
|
||||
--- a/scripts/build.py
|
||||
+++ b/scripts/build.py
|
||||
@@ -105,7 +105,6 @@ def get_curl_libraries():
|
||||
ffibuilder = FFI()
|
||||
system = platform.system()
|
||||
root_dir = Path(__file__).parent.parent
|
||||
-download_libcurl()
|
||||
|
||||
|
||||
ffibuilder.set_source(
|
||||
@@ -114,9 +113,7 @@ ffibuilder.set_source(
|
||||
#include "shim.h"
|
||||
""",
|
||||
# FIXME from `curl-impersonate`
|
||||
- libraries=get_curl_libraries(),
|
||||
- extra_objects=get_curl_archives(),
|
||||
- library_dirs=[arch["libdir"]],
|
||||
+ libraries=["curl-impersonate-chrome"],
|
||||
source_extension=".c",
|
||||
include_dirs=[
|
||||
str(root_dir / "include"),
|
@ -31,6 +31,8 @@ let
|
||||
pname = "curl-impersonate-${name}";
|
||||
version = "0.6.1";
|
||||
|
||||
outputs = [ "out" "dev" ];
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "lwthiker";
|
||||
repo = "curl-impersonate";
|
||||
@ -130,6 +132,9 @@ let
|
||||
|
||||
# Install zsh and fish completions
|
||||
installShellCompletion $TMPDIR/curl-impersonate-${name}.{zsh,fish}
|
||||
|
||||
# Install headers
|
||||
make -C curl-*/include install
|
||||
'';
|
||||
|
||||
preFixup = let
|
||||
|
@ -2636,6 +2636,8 @@ self: super: with self; {
|
||||
|
||||
curlify = callPackage ../development/python-modules/curlify { };
|
||||
|
||||
curl-cffi = callPackage ../development/python-modules/curl-cffi { };
|
||||
|
||||
curtsies = callPackage ../development/python-modules/curtsies { };
|
||||
|
||||
curve25519-donna = callPackage ../development/python-modules/curve25519-donna { };
|
||||
|
Loading…
Reference in New Issue
Block a user