2021-06-04 09:07:49 +00:00
|
|
|
{ lib
|
2022-02-10 20:34:41 +00:00
|
|
|
, stdenv
|
2021-06-04 09:07:49 +00:00
|
|
|
, buildPythonPackage
|
2020-04-24 23:36:52 +00:00
|
|
|
, asn1crypto
|
|
|
|
, fetchPypi
|
|
|
|
, openssl
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "oscrypto";
|
2021-06-04 09:07:49 +00:00
|
|
|
version = "1.2.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2021-06-04 09:07:49 +00:00
|
|
|
sha256 = "1546si2bdgkqnbvv4mw1hr4mhh6bq39d9z4wxgv1m7fq6miclb3x";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
testSources = fetchPypi {
|
|
|
|
inherit version;
|
|
|
|
pname = "oscrypto_tests";
|
2021-06-04 09:07:49 +00:00
|
|
|
sha256 = "1ha68dsrbx6mlra44x0n81vscn17pajbl4yg7cqkk7mq1zfmjwks";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-06-04 09:07:49 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
asn1crypto
|
|
|
|
openssl
|
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
preCheck = ''
|
|
|
|
tar -xf ${testSources}
|
|
|
|
mv oscrypto_tests-${version} tests
|
|
|
|
|
|
|
|
# remove tests that require network
|
|
|
|
sed -e '/TLSTests/d' -e '/TrustListTests/d' -i tests/__init__.py
|
|
|
|
'';
|
|
|
|
|
2021-06-04 09:07:49 +00:00
|
|
|
pythonImportsCheck = [ "oscrypto" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-02-10 20:34:41 +00:00
|
|
|
doCheck = !stdenv.isDarwin;
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
meta = with lib; {
|
2021-06-04 09:07:49 +00:00
|
|
|
description = "Encryption library for Python";
|
|
|
|
homepage = "https://github.com/wbond/oscrypto";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
};
|
|
|
|
}
|