2018-09-24 13:30:32 +00:00
|
|
|
|
{ stdenv, fetchurl, erlang, elixir, python, libxml2, libxslt, xmlto
|
|
|
|
|
, docbook_xml_dtd_45, docbook_xsl, zip, unzip, rsync, getconf, socat
|
2018-10-03 07:55:41 +00:00
|
|
|
|
, procps, coreutils, gnused, systemd, glibcLocales
|
2015-10-25 12:37:31 +00:00
|
|
|
|
, AppKit, Carbon, Cocoa
|
2020-03-10 13:01:02 +00:00
|
|
|
|
, nixosTests
|
2015-10-25 12:37:31 +00:00
|
|
|
|
}:
|
2011-03-31 11:09:20 +00:00
|
|
|
|
|
2018-04-10 23:54:11 +00:00
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 12:41:18 +00:00
|
|
|
|
pname = "rabbitmq-server";
|
2018-09-24 13:30:32 +00:00
|
|
|
|
|
2020-06-30 12:39:33 +00:00
|
|
|
|
version = "3.8.5";
|
2011-03-31 11:09:20 +00:00
|
|
|
|
|
2019-07-16 09:12:38 +00:00
|
|
|
|
# when updating, consider bumping elixir version in all-packages.nix
|
2011-03-31 11:09:20 +00:00
|
|
|
|
src = fetchurl {
|
2019-08-15 12:41:18 +00:00
|
|
|
|
url = "https://github.com/rabbitmq/rabbitmq-server/releases/download/v${version}/${pname}-${version}.tar.xz";
|
2020-06-30 12:39:33 +00:00
|
|
|
|
sha256 = "014pfgfj90scas40lf0yjx14vhx5l5zbi3by2nnb704lg8w2n456";
|
2011-03-31 11:09:20 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
buildInputs =
|
2018-10-03 07:55:41 +00:00
|
|
|
|
[ erlang elixir python libxml2 libxslt xmlto docbook_xml_dtd_45 docbook_xsl zip unzip rsync glibcLocales ]
|
2015-10-25 12:37:31 +00:00
|
|
|
|
++ stdenv.lib.optionals stdenv.isDarwin [ AppKit Carbon Cocoa ];
|
2011-03-31 11:09:20 +00:00
|
|
|
|
|
2018-02-19 17:54:16 +00:00
|
|
|
|
outputs = [ "out" "man" "doc" ];
|
|
|
|
|
|
2019-11-05 01:10:31 +00:00
|
|
|
|
installFlags = [ "PREFIX=$(out)" "RMQ_ERLAPP_DIR=$(out)" ];
|
|
|
|
|
installTargets = [ "install" "install-man" ];
|
2013-04-19 14:46:31 +00:00
|
|
|
|
|
2018-10-03 07:55:41 +00:00
|
|
|
|
preBuild = ''
|
|
|
|
|
export LANG=C.UTF-8 # fix elixir locale warning
|
|
|
|
|
'';
|
|
|
|
|
|
2020-05-31 15:38:48 +00:00
|
|
|
|
runtimePath = stdenv.lib.makeBinPath ([
|
2018-10-03 07:55:41 +00:00
|
|
|
|
erlang
|
|
|
|
|
getconf # for getting memory limits
|
2020-05-31 15:38:48 +00:00
|
|
|
|
socat procps
|
2018-10-03 07:55:41 +00:00
|
|
|
|
gnused coreutils # used by helper scripts
|
2020-05-31 15:38:48 +00:00
|
|
|
|
] ++ stdenv.lib.optionals stdenv.isLinux [ systemd ]); # for systemd unit activation check
|
2018-02-19 17:54:16 +00:00
|
|
|
|
postInstall = ''
|
2018-10-03 07:55:41 +00:00
|
|
|
|
# rabbitmq-env calls to sed/coreutils, so provide everything early
|
|
|
|
|
sed -i $out/sbin/rabbitmq-env -e '2s|^|PATH=${runtimePath}\''${PATH:+:}\$PATH/\n|'
|
|
|
|
|
|
|
|
|
|
# rabbitmq-server script uses `dirname` to get hold of a
|
|
|
|
|
# rabbitmq-env, so let's provide this file directly. After that
|
|
|
|
|
# point everything is OK - the PATH above will kick in
|
|
|
|
|
substituteInPlace $out/sbin/rabbitmq-server \
|
|
|
|
|
--replace '`dirname $0`/rabbitmq-env' \
|
|
|
|
|
"$out/sbin/rabbitmq-env"
|
2018-02-19 17:54:16 +00:00
|
|
|
|
|
2018-10-03 07:55:41 +00:00
|
|
|
|
# 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 17:54:16 +00: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 13:30:32 +00:00
|
|
|
|
'';
|
2011-03-31 11:09:20 +00:00
|
|
|
|
|
|
|
|
|
meta = {
|
2020-03-10 11:13:39 +00:00
|
|
|
|
homepage = "https://www.rabbitmq.com/";
|
2011-03-31 11:09:20 +00:00
|
|
|
|
description = "An implementation of the AMQP messaging protocol";
|
2018-02-19 17:54:16 +00:00
|
|
|
|
license = stdenv.lib.licenses.mpl11;
|
2014-04-28 23:12:44 +00:00
|
|
|
|
platforms = stdenv.lib.platforms.unix;
|
2018-02-19 17:54:16 +00:00
|
|
|
|
maintainers = with stdenv.lib.maintainers; [ Profpatsch ];
|
2011-03-31 11:09:20 +00:00
|
|
|
|
};
|
2020-03-10 13:01:02 +00:00
|
|
|
|
|
|
|
|
|
passthru.tests = {
|
|
|
|
|
vm-test = nixosTests.rabbitmq;
|
|
|
|
|
};
|
2011-03-31 11:09:20 +00:00
|
|
|
|
}
|