2021-05-20 23:08:51 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
2020-04-24 23:36:52 +00:00
|
|
|
, isPyPy
|
|
|
|
, fetchPypi
|
2020-11-19 00:13:47 +00:00
|
|
|
, pythonOlder
|
2020-04-24 23:36:52 +00:00
|
|
|
, curl
|
|
|
|
, openssl
|
|
|
|
, bottle
|
2021-05-20 23:08:51 +00:00
|
|
|
, pytestCheckHook
|
2020-04-24 23:36:52 +00:00
|
|
|
, nose
|
|
|
|
, flaky
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pycurl";
|
2021-08-25 08:27:29 +00:00
|
|
|
version = "7.44.1";
|
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;
|
2021-08-25 08:27:29 +00:00
|
|
|
sha256 = "5bcef4d988b74b99653602101e17d8401338d596b9234d263c728a0c3df003e8";
|
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
|
|
|
|
openssl.out
|
|
|
|
];
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
curl
|
|
|
|
];
|
|
|
|
|
|
|
|
checkInputs = [
|
|
|
|
bottle
|
2021-05-20 23:08:51 +00:00
|
|
|
pytestCheckHook
|
2020-04-24 23:36:52 +00:00
|
|
|
nose
|
|
|
|
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
|
|
|
'';
|
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
disabledTests = [
|
|
|
|
# libcurl stopped passing the reason phrase from the HTTP status line
|
|
|
|
# https://github.com/pycurl/pycurl/issues/679
|
|
|
|
"test_failonerror"
|
|
|
|
"test_failonerror_status_line_invalid_utf8_python3"
|
|
|
|
# bottle>=0.12.17 escapes utf8 properly, so these test don't work anymore
|
|
|
|
# https://github.com/pycurl/pycurl/issues/669
|
|
|
|
"test_getinfo_content_type_invalid_utf8_python3"
|
|
|
|
"test_getinfo_cookie_invalid_utf8_python3"
|
|
|
|
"test_getinfo_raw_content_type_invalid_utf8"
|
|
|
|
"test_getinfo_raw_cookie_invalid_utf8"
|
|
|
|
# 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"
|
|
|
|
];
|
|
|
|
|
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "http://pycurl.sourceforge.net/";
|
|
|
|
description = "Python wrapper for libcurl";
|
2021-05-20 23:08:51 +00:00
|
|
|
license = licenses.lgpl2Only;
|
|
|
|
maintainers = with maintainers; [];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|