From b6927692f1ce9ca0002627d330e973957e70cbdc Mon Sep 17 00:00:00 2001 From: Robert Scott Date: Sat, 28 May 2022 17:39:01 +0100 Subject: [PATCH] python3Packages.uamqp: use openssl on darwin-aarch64 azure's libraries aren't happy enough with our macos sdk on aarch64 to let us use applessl (cherry picked from commit 6f7557f8c6f2727a0398786c1100a9c232bf2f5d) --- pkgs/development/python-modules/uamqp/default.nix | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/pkgs/development/python-modules/uamqp/default.nix b/pkgs/development/python-modules/uamqp/default.nix index 61979da58d4c3..261e50b9afab6 100644 --- a/pkgs/development/python-modules/uamqp/default.nix +++ b/pkgs/development/python-modules/uamqp/default.nix @@ -27,6 +27,19 @@ buildPythonPackage rec { ./darwin-azure-c-shared-utility-corefoundation.patch ]; + postPatch = lib.optionalString (stdenv.isDarwin && !stdenv.isx86_64) '' + # force darwin aarch64 to use openssl instead of applessl, removing + # some quirks upstream thinks they need to use openssl on macos + sed -i \ + -e '/^use_openssl =/cuse_openssl = True' \ + -e 's/\bazssl\b/ssl/' \ + -e 's/\bazcrypto\b/crypto/' \ + setup.py + sed -i \ + -e '/#define EVP_PKEY_id/d' \ + src/vendor/azure-uamqp-c/deps/azure-c-shared-utility/adapters/x509_openssl.c + ''; + nativeBuildInputs = [ cmake ];