uboot: (firmwareOdroidC2/C4) don't invoke patch tool, use patches = [] instead
https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/setup.sh#L948 this can do it nicely. Signed-off-by: Anton Arapov <anton@deadbeef.mx>
This commit is contained in:
commit
56de2bcd43
30691 changed files with 3076956 additions and 0 deletions
|
|
@ -0,0 +1,60 @@
|
|||
From b36083efafec5a3c1c5864cd0b62367ddf3856ae Mon Sep 17 00:00:00 2001
|
||||
From: Keshav Kini <keshav.kini@gmail.com>
|
||||
Date: Sun, 16 May 2021 20:35:24 -0700
|
||||
Subject: [PATCH] Prefer NixOS/Nix default CA bundles over certifi
|
||||
|
||||
Normally, requests gets its default CA bundle from the certifi
|
||||
package. On NixOS and when using Nix on non-NixOS platforms, we would
|
||||
rather default to using our own certificate bundles controlled by the
|
||||
Nix/NixOS user.
|
||||
|
||||
This commit overrides requests.certs.where(), which previously was
|
||||
just aliased to certifi.where(), so that now it does the following:
|
||||
|
||||
- When run by Nix on non-NixOS, the environment variable
|
||||
$NIX_SSL_CERT_FILE will point to the CA bundle we're using, so we
|
||||
use that.
|
||||
|
||||
- When running on NixOS, the CA bundle we're using has the static path
|
||||
/etc/ssl/certs/ca-certificates.crt , so we use that.
|
||||
|
||||
- Otherwise, we fall back to the original behavior of using certifi's
|
||||
CA bundle. Higher in the call stack, users of requests can also
|
||||
explicitly specify a CA bundle to use, which overrides all this
|
||||
logic.
|
||||
---
|
||||
requests/certs.py | 18 +++++++++++++++++-
|
||||
1 file changed, 17 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/requests/certs.py b/requests/certs.py
|
||||
index d1a378d7..faf462b7 100644
|
||||
--- a/requests/certs.py
|
||||
+++ b/requests/certs.py
|
||||
@@ -12,7 +12,23 @@ If you are packaging Requests, e.g., for a Linux distribution or a managed
|
||||
environment, you can change the definition of where() to return a separately
|
||||
packaged CA bundle.
|
||||
"""
|
||||
-from certifi import where
|
||||
+
|
||||
+import os
|
||||
+
|
||||
+import certifi
|
||||
+
|
||||
+
|
||||
+def where():
|
||||
+ nix_ssl_cert_file = os.getenv("NIX_SSL_CERT_FILE")
|
||||
+ if nix_ssl_cert_file and os.path.exists(nix_ssl_cert_file):
|
||||
+ return nix_ssl_cert_file
|
||||
+
|
||||
+ nixos_ca_bundle = "/etc/ssl/certs/ca-certificates.crt"
|
||||
+ if os.path.exists(nixos_ca_bundle):
|
||||
+ return nixos_ca_bundle
|
||||
+
|
||||
+ return certifi.where()
|
||||
+
|
||||
|
||||
if __name__ == '__main__':
|
||||
print(where())
|
||||
--
|
||||
2.31.1
|
||||
|
||||
91
pkgs/development/python-modules/requests/default.nix
Normal file
91
pkgs/development/python-modules/requests/default.nix
Normal file
|
|
@ -0,0 +1,91 @@
|
|||
{ lib
|
||||
, stdenv
|
||||
, brotli
|
||||
, brotlicffi
|
||||
, buildPythonPackage
|
||||
, certifi
|
||||
, chardet
|
||||
, charset-normalizer
|
||||
, fetchPypi
|
||||
, idna
|
||||
, isPy27
|
||||
, isPy3k
|
||||
, pysocks
|
||||
, pytest-mock
|
||||
, pytest-xdist
|
||||
, pytestCheckHook
|
||||
, urllib3
|
||||
}:
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "requests";
|
||||
version = "2.27.1";
|
||||
|
||||
src = fetchPypi {
|
||||
inherit pname version;
|
||||
hash = "sha256-aNfFb9WomZiHco7zBKbRLtx7508c+kdxT8i0FFJcmmE=";
|
||||
};
|
||||
|
||||
patches = [
|
||||
# Use the default NixOS CA bundle from the certifi package
|
||||
./0001-Prefer-NixOS-Nix-default-CA-bundles-over-certifi.patch
|
||||
];
|
||||
|
||||
propagatedBuildInputs = [
|
||||
certifi
|
||||
idna
|
||||
urllib3
|
||||
chardet
|
||||
] ++ lib.optionals isPy3k [
|
||||
brotlicffi
|
||||
charset-normalizer
|
||||
] ++ lib.optionals isPy27 [
|
||||
brotli
|
||||
];
|
||||
|
||||
checkInputs = [
|
||||
pysocks
|
||||
pytest-mock
|
||||
pytest-xdist
|
||||
pytestCheckHook
|
||||
];
|
||||
|
||||
# AttributeError: 'KeywordMapping' object has no attribute 'get'
|
||||
doCheck = !isPy27;
|
||||
|
||||
disabledTests = [
|
||||
# Disable tests that require network access and use httpbin
|
||||
"requests.api.request"
|
||||
"requests.models.PreparedRequest"
|
||||
"requests.sessions.Session"
|
||||
"requests"
|
||||
"test_redirecting_to_bad_url"
|
||||
"test_requests_are_updated_each_time"
|
||||
"test_should_bypass_proxies_pass_only_hostname"
|
||||
"test_urllib3_pool_connection_closed"
|
||||
"test_urllib3_retries"
|
||||
"test_use_proxy_from_environment"
|
||||
"TestRequests"
|
||||
"TestTimeout"
|
||||
] ++ lib.optionals (stdenv.isDarwin && stdenv.isAarch64) [
|
||||
# Fatal Python error: Aborted
|
||||
"test_basic_response"
|
||||
"test_text_response"
|
||||
];
|
||||
|
||||
disabledTestPaths = lib.optionals (stdenv.isDarwin && stdenv.isAarch64) [
|
||||
# Fatal Python error: Aborted
|
||||
"tests/test_lowlevel.py"
|
||||
];
|
||||
|
||||
pythonImportsCheck = [
|
||||
"requests"
|
||||
];
|
||||
|
||||
meta = with lib; {
|
||||
description = "HTTP library for Python";
|
||||
homepage = "http://docs.python-requests.org/";
|
||||
license = licenses.asl20;
|
||||
maintainers = with maintainers; [ fab ];
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue