2021-08-05 21:33:18 +00:00
|
|
|
|
{ lib
|
|
|
|
|
, stdenv
|
|
|
|
|
, fetchurl
|
|
|
|
|
, erlang
|
|
|
|
|
, elixir
|
2022-04-27 09:35:20 +00:00
|
|
|
|
, python3
|
2021-08-05 21:33:18 +00:00
|
|
|
|
, libxml2
|
|
|
|
|
, libxslt
|
|
|
|
|
, xmlto
|
|
|
|
|
, docbook_xml_dtd_45
|
|
|
|
|
, docbook_xsl
|
|
|
|
|
, zip
|
|
|
|
|
, unzip
|
|
|
|
|
, rsync
|
|
|
|
|
, getconf
|
|
|
|
|
, socat
|
|
|
|
|
, procps
|
|
|
|
|
, coreutils
|
|
|
|
|
, gnused
|
|
|
|
|
, systemd
|
|
|
|
|
, glibcLocales
|
|
|
|
|
, AppKit
|
|
|
|
|
, Carbon
|
|
|
|
|
, Cocoa
|
2020-04-24 23:36:52 +00:00
|
|
|
|
, nixosTests
|
|
|
|
|
}:
|
|
|
|
|
|
2022-09-30 11:47:45 +00:00
|
|
|
|
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
|
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
|
pname = "rabbitmq-server";
|
2023-10-19 13:55:26 +00:00
|
|
|
|
version = "3.12.6";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
|
|
# 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";
|
2023-10-19 13:55:26 +00:00
|
|
|
|
hash = "sha256-QBDgRpYlOaROIbgmpOHW2wzULgXrIW1IxJ14jvy/YR4=";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
};
|
|
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
|
nativeBuildInputs = [ unzip xmlto docbook_xml_dtd_45 docbook_xsl zip rsync python3 ];
|
2023-07-15 17:15:38 +00:00
|
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
|
buildInputs = [ erlang elixir libxml2 libxslt glibcLocales ]
|
2021-01-15 22:18:51 +00:00
|
|
|
|
++ lib.optionals stdenv.isDarwin [ AppKit Carbon Cocoa ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
|
|
outputs = [ "out" "man" "doc" ];
|
|
|
|
|
|
2023-01-20 10:41:00 +00:00
|
|
|
|
installFlags = [
|
|
|
|
|
"PREFIX=${placeholder "out"}"
|
|
|
|
|
"RMQ_ERLAPP_DIR=${placeholder "out"}"
|
|
|
|
|
];
|
2023-07-15 17:15:38 +00:00
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
|
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;
|
|
|
|
|
};
|
2021-08-05 21:33:18 +00:00
|
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
|
homepage = "https://www.rabbitmq.com/";
|
|
|
|
|
description = "An implementation of the AMQP messaging protocol";
|
2023-07-15 17:15:38 +00:00
|
|
|
|
changelog = "https://github.com/rabbitmq/rabbitmq-server/releases/tag/v${version}";
|
2021-08-05 21:33:18 +00:00
|
|
|
|
license = licenses.mpl20;
|
|
|
|
|
platforms = platforms.unix;
|
2021-08-18 13:19:15 +00:00
|
|
|
|
maintainers = with maintainers; [ turion ];
|
2021-08-05 21:33:18 +00:00
|
|
|
|
};
|
2020-04-24 23:36:52 +00:00
|
|
|
|
}
|