python3Packages.oscrypto: patch ctypes call

The ctypes call did not work, because it requires binutils.bintools to
be available in every downstream dependency.

Fixes #176917.
This commit is contained in:
Simon Bruder 2022-08-04 16:58:14 +02:00
parent 3820a02714
commit c400724f94
No known key found for this signature in database
GPG Key ID: 8D3C82F9F309F8EC

View File

@ -22,9 +22,16 @@ buildPythonPackage rec {
hash = "sha256-CmDypmlc/kb6ONCUggjT1Iqd29xNSLRaGh5Hz36dvOw=";
};
postPatch = ''
for file in oscrypto/_openssl/_lib{crypto,ssl}_c{ffi,types}.py; do
substituteInPlace $file \
--replace "get_library('crypto', 'libcrypto.dylib', '42')" "'${openssl.out}/lib/libcrypto${stdenv.hostPlatform.extensions.sharedLibrary}'" \
--replace "get_library('ssl', 'libssl', '44')" "'${openssl.out}/lib/libssl${stdenv.hostPlatform.extensions.sharedLibrary}'"
done
'';
propagatedBuildInputs = [
asn1crypto
openssl
];
checkInputs = [