13 buildPythonPackage rec {
16 format = "setuptools";
18 disabled = pythonOlder "3.7";
20 src = fetchFromGitHub {
24 hash = "sha256-CmDypmlc/kb6ONCUggjT1Iqd29xNSLRaGh5Hz36dvOw=";
28 ./support-openssl-3.0.10.patch
31 # backport removal of imp module usage
32 url = "https://github.com/wbond/oscrypto/commit/3865f5d528740aa1205d16ddbee84c5b48aeb078.patch";
33 hash = "sha256-lQGoPM7EicwCPWapEDkqWEqMqXk4tijiImxndcDFqY4=";
38 for file in oscrypto/_openssl/_lib{crypto,ssl}_c{ffi,types}.py; do
39 substituteInPlace $file \
40 --replace "get_library('crypto', 'libcrypto.dylib', '42')" "'${openssl.out}/lib/libcrypto${stdenv.hostPlatform.extensions.sharedLibrary}'" \
41 --replace "get_library('ssl', 'libssl', '44')" "'${openssl.out}/lib/libssl${stdenv.hostPlatform.extensions.sharedLibrary}'"
45 propagatedBuildInputs = [ asn1crypto ];
47 nativeCheckInputs = [ pytestCheckHook ];
49 pythonImportsCheck = [ "oscrypto" ];
51 doCheck = !stdenv.hostPlatform.isDarwin;
54 # Tests require network access
60 description = "Encryption library for Python";
61 homepage = "https://github.com/wbond/oscrypto";
62 license = licenses.mit;