2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
buildPythonPackage,
|
|
|
|
isPyPy,
|
|
|
|
fetchPypi,
|
|
|
|
pythonOlder,
|
|
|
|
curl,
|
|
|
|
openssl,
|
|
|
|
bottle,
|
|
|
|
pytestCheckHook,
|
|
|
|
flaky,
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pycurl";
|
2024-04-21 15:54:59 +00:00
|
|
|
version = "7.45.3";
|
2024-01-02 11:29:13 +00:00
|
|
|
format = "setuptools";
|
2020-11-19 00:13:47 +00:00
|
|
|
disabled = isPyPy || (pythonOlder "3.5"); # https://github.com/pycurl/pycurl/issues/208
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2024-04-21 15:54:59 +00:00
|
|
|
hash = "sha256-jCRxr5B5rXmOFkXsCw09QiPbaHN50X3TanBjdEn4HWs=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
preConfigure = ''
|
|
|
|
substituteInPlace setup.py --replace '--static-libs' '--libs'
|
|
|
|
export PYCURL_SSL_LIBRARY=openssl
|
|
|
|
'';
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
buildInputs = [
|
|
|
|
curl
|
2022-04-03 18:54:34 +00:00
|
|
|
openssl
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeBuildInputs = [ curl ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-08-22 20:05:09 +00:00
|
|
|
__darwinAllowLocalNetworking = true;
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2020-04-24 23:36:52 +00:00
|
|
|
bottle
|
2021-05-20 23:08:51 +00:00
|
|
|
pytestCheckHook
|
2020-04-24 23:36:52 +00:00
|
|
|
flaky
|
|
|
|
];
|
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
pytestFlagsArray = [
|
|
|
|
# don't pick up the tests directory below examples/
|
|
|
|
"tests"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
preCheck = ''
|
|
|
|
export HOME=$TMPDIR
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
disabledTests =
|
|
|
|
[
|
|
|
|
# tests that require network access
|
|
|
|
"test_keyfunction"
|
|
|
|
"test_keyfunction_bogus_return"
|
|
|
|
# OSError: tests/fake-curl/libcurl/with_openssl.so: cannot open shared object file: No such file or directory
|
|
|
|
"test_libcurl_ssl_openssl"
|
|
|
|
# OSError: tests/fake-curl/libcurl/with_nss.so: cannot open shared object file: No such file or directory
|
|
|
|
"test_libcurl_ssl_nss"
|
|
|
|
# OSError: tests/fake-curl/libcurl/with_gnutls.so: cannot open shared object file: No such file or directory
|
|
|
|
"test_libcurl_ssl_gnutls"
|
|
|
|
# AssertionError: assert 'crypto' in ['curl']
|
|
|
|
"test_ssl_in_static_libs"
|
|
|
|
# tests that require curl with http3Support
|
|
|
|
"test_http_version_3"
|
|
|
|
# https://github.com/pycurl/pycurl/issues/819
|
|
|
|
"test_multi_socket_select"
|
|
|
|
# https://github.com/pycurl/pycurl/issues/729
|
|
|
|
"test_easy_pause_unpause"
|
|
|
|
"test_multi_socket_action"
|
|
|
|
# https://github.com/pycurl/pycurl/issues/822
|
|
|
|
"test_request_with_verifypeer"
|
|
|
|
# https://github.com/pycurl/pycurl/issues/836
|
|
|
|
"test_proxy_tlsauth"
|
|
|
|
]
|
|
|
|
++ lib.optionals (stdenv.isDarwin && stdenv.isAarch64) [
|
|
|
|
# Fatal Python error: Segmentation fault
|
|
|
|
"cadata_test"
|
|
|
|
];
|
2021-05-20 23:08:51 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
2022-03-30 09:31:56 +00:00
|
|
|
homepage = "http://pycurl.io/";
|
|
|
|
description = "Python Interface To The cURL library";
|
2024-06-05 15:53:02 +00:00
|
|
|
license = with licenses; [
|
|
|
|
lgpl2Only
|
|
|
|
mit
|
|
|
|
];
|
2023-08-04 22:07:22 +00:00
|
|
|
maintainers = with maintainers; [ ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|