2021-12-06 16:07:01 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
2021-01-17 00:15:33 +00:00
|
|
|
, buildPythonPackage
|
2020-04-24 23:36:52 +00:00
|
|
|
, certifi
|
2021-12-06 16:07:01 +00:00
|
|
|
, CFNetwork
|
2020-04-24 23:36:52 +00:00
|
|
|
, cmake
|
2021-12-06 16:07:01 +00:00
|
|
|
, CoreFoundation
|
2020-04-24 23:36:52 +00:00
|
|
|
, enum34
|
2021-12-06 16:07:01 +00:00
|
|
|
, fetchpatch
|
|
|
|
, fetchPypi
|
|
|
|
, isPy3k
|
2022-08-21 13:32:41 +00:00
|
|
|
, libcxxabi
|
2020-04-24 23:36:52 +00:00
|
|
|
, openssl
|
2021-01-17 00:15:33 +00:00
|
|
|
, Security
|
2021-12-06 16:07:01 +00:00
|
|
|
, six
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "uamqp";
|
2023-01-20 10:41:00 +00:00
|
|
|
version = "1.6.3";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2023-01-20 10:41:00 +00:00
|
|
|
sha256 = "sha256-fOA+tGANKKHeq0uGbzd9Tq5/yc3Gfj6I94jV8daD3IY=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
patches = lib.optionals (stdenv.isDarwin && stdenv.isx86_64) [
|
|
|
|
./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
|
|
|
|
'';
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = lib.optionals stdenv.isDarwin [
|
|
|
|
CoreFoundation
|
|
|
|
CFNetwork
|
|
|
|
Security
|
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
certifi
|
|
|
|
openssl
|
|
|
|
six
|
|
|
|
] ++ lib.optionals (!isPy3k) [
|
|
|
|
enum34
|
|
|
|
];
|
|
|
|
|
2022-08-21 13:32:41 +00:00
|
|
|
LDFLAGS = lib.optionals stdenv.isDarwin [
|
|
|
|
"-L${lib.getLib libcxxabi}/lib"
|
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
dontUseCmakeConfigure = true;
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
# Project has no tests
|
2020-04-24 23:36:52 +00:00
|
|
|
doCheck = false;
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"uamqp"
|
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "An AMQP 1.0 client library for Python";
|
|
|
|
homepage = "https://github.com/Azure/azure-uamqp-python";
|
|
|
|
license = licenses.mit;
|
2020-11-19 00:13:47 +00:00
|
|
|
maintainers = with maintainers; [ maxwilson ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|