diff options
Diffstat (limited to 'nixpkgs/pkgs/servers/amqp')
-rw-r--r-- | nixpkgs/pkgs/servers/amqp/qpid-cpp/default.nix | 52 | ||||
-rw-r--r-- | nixpkgs/pkgs/servers/amqp/rabbitmq-server/default.nix | 96 |
2 files changed, 148 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/servers/amqp/qpid-cpp/default.nix b/nixpkgs/pkgs/servers/amqp/qpid-cpp/default.nix new file mode 100644 index 000000000000..0427f38d5f70 --- /dev/null +++ b/nixpkgs/pkgs/servers/amqp/qpid-cpp/default.nix @@ -0,0 +1,52 @@ +{ lib, stdenv +, fetchpatch +, fetchurl +, boost +, cmake +, libuuid +, python3 +, ruby +}: + +stdenv.mkDerivation rec { + pname = "qpid-cpp"; + version = "1.39.0"; + + src = fetchurl { + 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 + ''; + + env.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"; + license = licenses.asl20; + platforms = platforms.linux; + maintainers = with maintainers; [ cpages ]; + }; +} diff --git a/nixpkgs/pkgs/servers/amqp/rabbitmq-server/default.nix b/nixpkgs/pkgs/servers/amqp/rabbitmq-server/default.nix new file mode 100644 index 000000000000..b2348730ebe8 --- /dev/null +++ b/nixpkgs/pkgs/servers/amqp/rabbitmq-server/default.nix @@ -0,0 +1,96 @@ +{ lib +, stdenv +, fetchurl +, erlang +, elixir +, python3 +, libxml2 +, libxslt +, xmlto +, docbook_xml_dtd_45 +, docbook_xsl +, zip +, unzip +, rsync +, getconf +, socat +, procps +, coreutils +, gnused +, systemd +, glibcLocales +, AppKit +, Carbon +, Cocoa +, nixosTests +}: + +let + runtimePath = lib.makeBinPath ([ + erlang + getconf # for getting memory limits + socat + procps + gnused + coreutils # used by helper scripts + ] ++ lib.optionals stdenv.isLinux [ systemd ]); # for systemd unit activation check +in + +stdenv.mkDerivation rec { + pname = "rabbitmq-server"; + version = "3.12.13"; + + # when updating, consider bumping elixir version in all-packages.nix + src = fetchurl { + url = "https://github.com/rabbitmq/rabbitmq-server/releases/download/v${version}/${pname}-${version}.tar.xz"; + hash = "sha256-UjUkiS8ay66DDzeW9EXOJPQVHHxC1sXT8mCn+KVXSQ4="; + }; + + nativeBuildInputs = [ unzip xmlto docbook_xml_dtd_45 docbook_xsl zip rsync python3 ]; + + buildInputs = [ erlang elixir libxml2 libxslt glibcLocales ] + ++ lib.optionals stdenv.isDarwin [ AppKit Carbon Cocoa ]; + + outputs = [ "out" "man" "doc" ]; + + installFlags = [ + "PREFIX=${placeholder "out"}" + "RMQ_ERLAPP_DIR=${placeholder "out"}" + ]; + + installTargets = [ "install" "install-man" ]; + + preBuild = '' + export LANG=C.UTF-8 # fix elixir locale warning + ''; + + postInstall = '' + # rabbitmq-env calls to sed/coreutils, so provide everything early + sed -i $out/sbin/rabbitmq-env -e '2s|^|PATH=${runtimePath}\''${PATH:+:}\$PATH/\n|' + + # We know exactly where rabbitmq is gonna be, so we patch that into the env-script. + # By doing it early we make sure that auto-detection for this will + # never be executed (somewhere below in the script). + sed -i $out/sbin/rabbitmq-env -e "2s|^|RABBITMQ_SCRIPTS_DIR=$out/sbin\n|" + + # there’s a few stray files that belong into share + mkdir -p $doc/share/doc/rabbitmq-server + mv $out/LICENSE* $doc/share/doc/rabbitmq-server + + # and an unecessarily copied INSTALL file + rm $out/INSTALL + ''; + + passthru.tests = { + vm-test = nixosTests.rabbitmq; + }; + + meta = with lib; { + homepage = "https://www.rabbitmq.com/"; + description = "An implementation of the AMQP messaging protocol"; + changelog = "https://github.com/rabbitmq/rabbitmq-server/releases/tag/v${version}"; + license = licenses.mpl20; + platforms = platforms.unix; + maintainers = with maintainers; [ turion ]; + }; +} |