about summary refs log tree commit diff
path: root/pkgs/development/python-modules/uamqp/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/python-modules/uamqp/default.nix')
-rw-r--r--pkgs/development/python-modules/uamqp/default.nix94
1 files changed, 40 insertions, 54 deletions
diff --git a/pkgs/development/python-modules/uamqp/default.nix b/pkgs/development/python-modules/uamqp/default.nix
index 2881c8ef0d6b..122ecccb046b 100644
--- a/pkgs/development/python-modules/uamqp/default.nix
+++ b/pkgs/development/python-modules/uamqp/default.nix
@@ -1,56 +1,42 @@
-{ lib
-, stdenv
-, buildPythonPackage
-, fetchFromGitHub
-, fetchpatch
-, cython_0
-, certifi
-, CFNetwork
-, cmake
-, CoreFoundation
-, openssl
-, Security
-, pytestCheckHook
-, pytest-asyncio
+{
+  lib,
+  stdenv,
+  buildPythonPackage,
+  fetchFromGitHub,
+  fetchpatch2,
+  setuptools,
+  cython,
+  certifi,
+  CFNetwork,
+  cmake,
+  CoreFoundation,
+  openssl,
+  Security,
+  pytestCheckHook,
+  pytest-asyncio,
 }:
 
 buildPythonPackage rec {
   pname = "uamqp";
-  version = "1.6.8";
-  format = "setuptools";
+  version = "1.6.11";
+  pyproject = true;
 
   src = fetchFromGitHub {
     owner = "Azure";
     repo = "azure-uamqp-python";
     rev = "refs/tags/v${version}";
-    hash = "sha256-L4E7nnsVZ/VrOM0t4KtztU9ALmtGfi1vDzUi0ogtZOc=";
+    hash = "sha256-HTIOHheCrvyI7DwA/UcUXk/fbesd29lvUvJ9TAeG3CE=";
   };
 
-  patches = lib.optionals (stdenv.isDarwin && stdenv.isx86_64) [
-    ./darwin-azure-c-shared-utility-corefoundation.patch
-  ] ++ [
-    (fetchpatch {
-      name = "CVE-2024-25110.patch";
-      url = "https://github.com/Azure/azure-uamqp-c/commit/30865c9ccedaa32ddb036e87a8ebb52c3f18f695.patch";
-      stripLen = 1;
-      extraPrefix = "src/vendor/azure-uamqp-c/";
-      hash = "sha256-igzZqTLUUyuNcpCUbYHI4RXmWxg+7EC/yyD4DBurR2M=";
+  patches = [
+    (fetchpatch2 {
+      name = "fix-clang16-compatibility.patch";
+      url = "https://github.com/Azure/azure-uamqp-python/commit/bd6d9ef5a8bca3873e1e66218fd09ca787b8064e.patch";
+      hash = "sha256-xtnIVjB71EPJp/QjLQWctcSDds5s6n4ut+gnvp3VMlM=";
     })
-    (fetchpatch {
-      name = "CVE-2024-27099.patch";
-      url = "https://github.com/Azure/azure-uamqp-c/commit/2ca42b6e4e098af2d17e487814a91d05f6ae4987.patch";
-      stripLen = 1;
-      extraPrefix = "src/vendor/azure-uamqp-c/";
-      # other files are just tests which aren't run from the python
-      # builder anyway
-      includes = [ "src/vendor/azure-uamqp-c/src/link.c" ];
-      hash = "sha256-EqDfG1xAz5CG8MssSSrz8Yrje5qwF8ri1Kdw+UUu5ms=";
-    })
-    # Fix incompatible function pointer conversion error with clang 16.
-    ./clang-fix-incompatible-function-pointer-conversion.patch
   ];
 
-  postPatch = lib.optionalString (stdenv.isDarwin && !stdenv.isx86_64) ''
+  postPatch = lib.optionalString (stdenv.hostPlatform.isDarwin && !stdenv.hostPlatform.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 \
@@ -66,22 +52,24 @@ buildPythonPackage rec {
       src/vendor/azure-uamqp-c/deps/azure-c-shared-utility/CMakeLists.txt
   '';
 
+  build-system = [
+    cython
+    setuptools
+  ];
+
   nativeBuildInputs = [
     cmake
-    cython_0
   ];
 
-  buildInputs = [
-    openssl
-  ] ++ lib.optionals stdenv.isDarwin [
-    CoreFoundation
-    CFNetwork
-    Security
-  ];
+  buildInputs =
+    [ openssl ]
+    ++ lib.optionals stdenv.hostPlatform.isDarwin [
+      CoreFoundation
+      CFNetwork
+      Security
+    ];
 
-  propagatedBuildInputs = [
-    certifi
-  ];
+  dependencies = [ certifi ];
 
   dontUseCmakeConfigure = true;
 
@@ -95,12 +83,10 @@ buildPythonPackage rec {
     pytest-asyncio
   ];
 
-  pythonImportsCheck = [
-    "uamqp"
-  ];
+  pythonImportsCheck = [ "uamqp" ];
 
   meta = with lib; {
-    description = "An AMQP 1.0 client library for Python";
+    description = "AMQP 1.0 client library for Python";
     homepage = "https://github.com/Azure/azure-uamqp-python";
     license = licenses.mit;
     maintainers = with maintainers; [ maxwilson ];