2021-08-02 16:13:30 +02:00
|
|
|
|
{ lib
|
|
|
|
|
, stdenv
|
|
|
|
|
, fetchurl
|
|
|
|
|
, erlang
|
|
|
|
|
, elixir
|
2022-01-12 00:40:02 +01:00
|
|
|
|
, python2
|
2021-08-02 16:13:30 +02:00
|
|
|
|
, libxml2
|
|
|
|
|
, libxslt
|
|
|
|
|
, xmlto
|
|
|
|
|
, docbook_xml_dtd_45
|
|
|
|
|
, docbook_xsl
|
|
|
|
|
, zip
|
|
|
|
|
, unzip
|
|
|
|
|
, rsync
|
|
|
|
|
, getconf
|
|
|
|
|
, socat
|
|
|
|
|
, procps
|
|
|
|
|
, coreutils
|
|
|
|
|
, gnused
|
|
|
|
|
, systemd
|
|
|
|
|
, glibcLocales
|
|
|
|
|
, AppKit
|
|
|
|
|
, Carbon
|
|
|
|
|
, Cocoa
|
2020-03-10 14:01:02 +01:00
|
|
|
|
, nixosTests
|
2015-10-25 13:37:31 +01:00
|
|
|
|
}:
|
2011-03-31 13:09:20 +02:00
|
|
|
|
|
2018-04-11 01:54:11 +02:00
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 14:41:18 +02:00
|
|
|
|
pname = "rabbitmq-server";
|
2022-03-24 03:05:08 +01:00
|
|
|
|
version = "3.9.14";
|
2011-03-31 13:09:20 +02:00
|
|
|
|
|
2019-07-16 11:12:38 +02:00
|
|
|
|
# when updating, consider bumping elixir version in all-packages.nix
|
2011-03-31 13:09:20 +02:00
|
|
|
|
src = fetchurl {
|
2019-08-15 14:41:18 +02:00
|
|
|
|
url = "https://github.com/rabbitmq/rabbitmq-server/releases/download/v${version}/${pname}-${version}.tar.xz";
|
2022-03-24 03:05:08 +01:00
|
|
|
|
sha256 = "sha256-c6GpB6CSCHiU9hTC9FkxyTc1UpNWxx5iP3y2dbTUfS0=";
|
2011-03-31 13:09:20 +02:00
|
|
|
|
};
|
|
|
|
|
|
2021-08-02 18:19:53 +02:00
|
|
|
|
nativeBuildInputs = [ unzip xmlto docbook_xml_dtd_45 docbook_xsl zip rsync ];
|
2022-01-12 00:40:02 +01:00
|
|
|
|
buildInputs = [ erlang elixir python2 libxml2 libxslt glibcLocales ]
|
2021-01-15 08:07:56 +01:00
|
|
|
|
++ lib.optionals stdenv.isDarwin [ AppKit Carbon Cocoa ];
|
2011-03-31 13:09:20 +02:00
|
|
|
|
|
2018-02-19 18:54:16 +01:00
|
|
|
|
outputs = [ "out" "man" "doc" ];
|
|
|
|
|
|
2019-11-05 02:10:31 +01:00
|
|
|
|
installFlags = [ "PREFIX=$(out)" "RMQ_ERLAPP_DIR=$(out)" ];
|
|
|
|
|
installTargets = [ "install" "install-man" ];
|
2013-04-19 16:46:31 +02:00
|
|
|
|
|
2018-10-03 09:55:41 +02:00
|
|
|
|
preBuild = ''
|
|
|
|
|
export LANG=C.UTF-8 # fix elixir locale warning
|
|
|
|
|
'';
|
|
|
|
|
|
2021-01-15 08:07:56 +01:00
|
|
|
|
runtimePath = lib.makeBinPath ([
|
2018-10-03 09:55:41 +02:00
|
|
|
|
erlang
|
|
|
|
|
getconf # for getting memory limits
|
2021-08-02 16:13:30 +02:00
|
|
|
|
socat
|
|
|
|
|
procps
|
|
|
|
|
gnused
|
|
|
|
|
coreutils # used by helper scripts
|
2021-01-15 08:07:56 +01:00
|
|
|
|
] ++ lib.optionals stdenv.isLinux [ systemd ]); # for systemd unit activation check
|
2021-08-02 16:13:30 +02:00
|
|
|
|
|
2018-02-19 18:54:16 +01:00
|
|
|
|
postInstall = ''
|
2018-10-03 09:55:41 +02:00
|
|
|
|
# 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|"
|
2018-02-19 18:54:16 +01:00
|
|
|
|
|
|
|
|
|
# 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
|
2018-09-24 15:30:32 +02:00
|
|
|
|
'';
|
2011-03-31 13:09:20 +02:00
|
|
|
|
|
2020-03-10 14:01:02 +01:00
|
|
|
|
passthru.tests = {
|
|
|
|
|
vm-test = nixosTests.rabbitmq;
|
|
|
|
|
};
|
2021-08-02 16:13:30 +02:00
|
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
|
homepage = "https://www.rabbitmq.com/";
|
|
|
|
|
description = "An implementation of the AMQP messaging protocol";
|
|
|
|
|
license = licenses.mpl20;
|
|
|
|
|
platforms = platforms.unix;
|
2021-08-17 15:44:27 +02:00
|
|
|
|
maintainers = with maintainers; [ turion ];
|
2021-08-02 16:13:30 +02:00
|
|
|
|
};
|
2011-03-31 13:09:20 +02:00
|
|
|
|
}
|