2018-02-19 17:54:16 +00:00
|
|
|
|
{ stdenv, fetchurl, runCommand
|
|
|
|
|
, erlang, python, libxml2, libxslt, xmlto
|
2017-02-08 23:12:49 +00:00
|
|
|
|
, docbook_xml_dtd_45, docbook_xsl, zip, unzip, rsync
|
2015-10-25 12:37:31 +00:00
|
|
|
|
|
|
|
|
|
, AppKit, Carbon, Cocoa
|
|
|
|
|
}:
|
2011-03-31 12:09:20 +01:00
|
|
|
|
|
2018-02-19 17:54:16 +00:00
|
|
|
|
let
|
|
|
|
|
# we only need that one glibc binary (28k instead of 2.7M)
|
|
|
|
|
getconf = runCommand "getconf" {} ''
|
|
|
|
|
install -D ${stdenv.lib.getBin stdenv.cc.libc}/bin/getconf $out/bin/getconf
|
|
|
|
|
'';
|
2013-04-19 15:46:31 +01:00
|
|
|
|
|
2018-02-19 17:54:16 +00:00
|
|
|
|
in stdenv.mkDerivation rec {
|
|
|
|
|
name = "rabbitmq-server-${version}";
|
|
|
|
|
version = "3.6.15";
|
2011-03-31 12:09:20 +01:00
|
|
|
|
|
|
|
|
|
src = fetchurl {
|
2017-09-14 06:47:12 +01:00
|
|
|
|
url = "https://www.rabbitmq.com/releases/rabbitmq-server/v${version}/${name}.tar.xz";
|
2018-02-19 17:54:16 +00:00
|
|
|
|
sha256 = "1zdmil657mhjmd20jv47s5dfpj2liqwvyg0zv2ky3akanfpgj98y";
|
2011-03-31 12:09:20 +01:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
buildInputs =
|
2017-02-08 23:12:49 +00:00
|
|
|
|
[ erlang python libxml2 libxslt xmlto docbook_xml_dtd_45 docbook_xsl zip unzip rsync ]
|
2015-10-25 12:37:31 +00:00
|
|
|
|
++ stdenv.lib.optionals stdenv.isDarwin [ AppKit Carbon Cocoa ];
|
2011-03-31 12:09:20 +01:00
|
|
|
|
|
2018-02-19 17:54:16 +00:00
|
|
|
|
outputs = [ "out" "man" "doc" ];
|
|
|
|
|
|
|
|
|
|
postPatch = with stdenv.lib; ''
|
|
|
|
|
# patch the path to getconf
|
|
|
|
|
substituteInPlace deps/rabbit_common/src/vm_memory_monitor.erl \
|
|
|
|
|
--replace "getconf PAGESIZE" "${getconf}/bin/getconf PAGESIZE"
|
|
|
|
|
'';
|
|
|
|
|
|
|
|
|
|
preBuild = ''
|
|
|
|
|
# Fix the "/usr/bin/env" in "calculate-relative".
|
|
|
|
|
patchShebangs .
|
|
|
|
|
'';
|
2011-03-31 12:09:20 +01:00
|
|
|
|
|
2017-02-08 23:12:49 +00:00
|
|
|
|
installFlags = "PREFIX=$(out) RMQ_ERLAPP_DIR=$(out)";
|
|
|
|
|
installTargets = "install install-man";
|
2013-04-19 15:46:31 +01:00
|
|
|
|
|
2018-02-19 17:54:16 +00:00
|
|
|
|
postInstall = ''
|
|
|
|
|
echo 'PATH=${erlang}/bin:''${PATH:+:}$PATH' >> $out/sbin/rabbitmq-env
|
|
|
|
|
|
|
|
|
|
# we know exactly where rabbitmq is gonna be,
|
|
|
|
|
# so we patch that into the env-script
|
|
|
|
|
substituteInPlace $out/sbin/rabbitmq-env \
|
|
|
|
|
--replace 'RABBITMQ_SCRIPTS_DIR=`dirname $SCRIPT_PATH`' \
|
|
|
|
|
"RABBITMQ_SCRIPTS_DIR=$out/sbin"
|
|
|
|
|
|
|
|
|
|
# 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
|
|
|
|
|
|
|
|
|
|
# patched into a source file above;
|
|
|
|
|
# needs to be explicitely passed to not be stripped by fixup
|
|
|
|
|
mkdir -p $out/nix-support
|
|
|
|
|
echo "${getconf}" > $out/nix-support/dont-strip-getconf
|
|
|
|
|
|
2017-09-14 06:47:12 +01:00
|
|
|
|
'';
|
2011-03-31 12:09:20 +01:00
|
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
|
homepage = http://www.rabbitmq.com/;
|
|
|
|
|
description = "An implementation of the AMQP messaging protocol";
|
2018-02-19 17:54:16 +00:00
|
|
|
|
license = stdenv.lib.licenses.mpl11;
|
2014-04-29 00:12:44 +01:00
|
|
|
|
platforms = stdenv.lib.platforms.unix;
|
2018-02-19 17:54:16 +00:00
|
|
|
|
maintainers = with stdenv.lib.maintainers; [ Profpatsch ];
|
2011-03-31 12:09:20 +01:00
|
|
|
|
};
|
|
|
|
|
}
|