about summary refs log tree commit diff
path: root/pkgs/servers/amqp
diff options
context:
space:
mode:
authordavidak <davidak@users.noreply.github.com>2022-05-09 09:33:16 +0200
committerGitHub <noreply@github.com>2022-05-09 09:33:16 +0200
commit2df966594a8092199639ffd65015361097bed479 (patch)
tree66f5753137285691869563acbeacb8265d16b5ff /pkgs/servers/amqp
parent6cdced0eb35300d9a6f58e53a904c5b558e87375 (diff)
parent127f8ef97e4c15ecc34122a3a1aba8c0ad3cbb4b (diff)
Merge pull request #169816 from armeenm/qpid-cpp-python3
qpid-cpp: switch to python3
Diffstat (limited to 'pkgs/servers/amqp')
-rw-r--r--pkgs/servers/amqp/qpid-cpp/default.nix81
1 files changed, 38 insertions, 43 deletions
diff --git a/pkgs/servers/amqp/qpid-cpp/default.nix b/pkgs/servers/amqp/qpid-cpp/default.nix
index c6d66427ab20f..d3647264becc2 100644
--- a/pkgs/servers/amqp/qpid-cpp/default.nix
+++ b/pkgs/servers/amqp/qpid-cpp/default.nix
@@ -1,15 +1,47 @@
-{ lib, stdenv, fetchurl, cmake, python2, boost, libuuid, ruby, buildEnv, buildPythonPackage, qpid-python }:
-
-let
+{ lib, stdenv
+, fetchpatch
+, fetchurl
+, boost
+, cmake
+, libuuid
+, python3
+, ruby
+}:
+
+stdenv.mkDerivation rec {
   pname = "qpid-cpp";
-  name = "${pname}-${version}";
   version = "1.39.0";
 
   src = fetchurl {
-    url = "mirror://apache/qpid/cpp/${version}/${name}.tar.gz";
-    sha256 = "088dx1l6myrksbhpr15bs09j6qm8vdliqwjp2ja5amym47md103r";
+    url = "mirror://apache/qpid/cpp/${version}/${pname}-${version}.tar.gz";
+    hash = "sha256-eYDQ6iHVV1WUFFdyHGnbqGIjE9CrhHzh0jP7amjoDSE=";
   };
 
+  nativeBuildInputs = [ cmake python3 ];
+  buildInputs = [ boost libuuid ruby ];
+
+  patches = [
+    (fetchpatch {
+      name = "python3-managementgen";
+      url = "https://github.com/apache/qpid-cpp/commit/0e558866e90ef3d5becbd2f6d5630a6a6dc43a5d.patch";
+      hash = "sha256-pV6xx8Nrys/ZxIO0Z/fARH0ELqcSdTXLPsVXYUd3f70=";
+    })
+  ];
+
+  # the subdir managementgen wants to install python stuff in ${python} and
+  # the installation tries to create some folders in /var
+  postPatch = ''
+    sed -i '/managementgen/d' CMakeLists.txt
+    sed -i '/ENV/d' src/CMakeLists.txt
+    sed -i '/management/d' CMakeLists.txt
+  '';
+
+  NIX_CFLAGS_COMPILE = toString ([
+    "-Wno-error=maybe-uninitialized"
+  ] ++ lib.optionals stdenv.cc.isGNU [
+    "-Wno-error=deprecated-copy"
+  ]);
+
   meta = with lib; {
     homepage = "https://qpid.apache.org";
     description = "An AMQP message broker and a C++ messaging API";
@@ -17,41 +49,4 @@ let
     platforms = platforms.linux;
     maintainers = with maintainers; [ cpages ];
   };
-
-  qpid-cpp = stdenv.mkDerivation {
-    inherit src meta pname version;
-
-    nativeBuildInputs = [ cmake ];
-    buildInputs = [ boost libuuid ruby python2 ];
-
-    # the subdir managementgen wants to install python stuff in ${python} and
-    # the installation tries to create some folders in /var
-    postPatch = ''
-      sed -i '/managementgen/d' CMakeLists.txt
-      sed -i '/ENV/d' src/CMakeLists.txt
-      sed -i '/management/d' CMakeLists.txt
-    '';
-
-    NIX_CFLAGS_COMPILE = toString ([
-      "-Wno-error=deprecated-declarations"
-      "-Wno-error=int-in-bool-context"
-      "-Wno-error=maybe-uninitialized"
-      "-Wno-error=unused-function"
-      "-Wno-error=ignored-qualifiers"
-      "-Wno-error=catch-value"
-    ] ++ lib.optionals stdenv.cc.isGNU [
-      "-Wno-error=deprecated-copy"
-    ]);
-  };
-
-  python-frontend = buildPythonPackage {
-    inherit pname version meta src;
-
-    sourceRoot = "${name}/management/python";
-
-    propagatedBuildInputs = [ qpid-python ];
-  };
-in buildEnv {
-  name = "${name}-env";
-  paths = [ qpid-cpp python-frontend ];
 }