Skip to content
Permalink
Browse files

rabbitmq wip

  • Loading branch information
peterhoeg committed Aug 4, 2017
1 parent a7c8f5e commit 2c5933903c01bc4ee26ebd72cdf0d0559f3111cd
Showing with 61 additions and 24 deletions.
  1. +61 −24 pkgs/servers/amqp/rabbitmq-server/default.nix
@@ -1,40 +1,77 @@
{ stdenv, fetchurl, erlang, python, libxml2, libxslt, xmlto
, docbook_xml_dtd_45, docbook_xsl, zip, unzip, rsync

, AppKit, Carbon, Cocoa
{ stdenv, fetchFromGitHub, perl
, erlang, pythonPackages, libxml2, libxslt, zip, unzip, rsync
, docbook_xml_dtd_45, docbook_xsl, xmlto
, AppKit ? null, Carbon ? null, Cocoa ? null
}:

stdenv.mkDerivation rec {
name = "rabbitmq-server-${version}";
let
version = "3.6.6";
owner = "rabbitmq";
rev = (stdenv.lib.replaceStrings [ "." ] [ "_" ] "rabbitmq_v${version}");

rabbitmq-codegen = fetchFromGitHub {
repo = "rabbitmq-codegen";
sha256 = "12999bjbjixij36abn9n8wrzjik62wy7iyqgpafzp4zbgkf49258";
inherit owner rev;
};

rabbitmq-common = fetchFromGitHub {
repo = "rabbitmq-common";
sha256 = "1qdbnvq38kpkz2wq1qfwvnp6a6ldi5xcd9s124dyndpfxhh3nh4l";
inherit owner rev;
};

in stdenv.mkDerivation rec {
name = "rabbitmq-server-${version}";
version = "3.6.6";

src = fetchurl {
url = "https://github.com/rabbitmq/rabbitmq-server/releases/download/rabbitmq_v3_6_6/rabbitmq-server-3.6.6.tar.xz";
sha256 = "13mpnyfxd026w525rsnkcw0f8bcrkbzl7k9g8pnqmm3zyny8jmir";
src = fetchFromGitHub {
owner = "rabbitmq";
repo = "rabbitmq-server";
# sha256 = "174pvv0982wyll5aqc8y856dy638g1sk39xb3iwxxxfy1sb45kpz";
sha256 = "1h3lrar7svajx7ccf6zrn8csr2hlxc8fwnvpx62pndvjw9nzgdm7";
inherit rev;
};

buildInputs =
[ erlang python libxml2 libxslt xmlto docbook_xml_dtd_45 docbook_xsl zip unzip rsync ]
++ stdenv.lib.optionals stdenv.isDarwin [ AppKit Carbon Cocoa ];
buildInputs = [
# rabbitmq-common
erlang pythonPackages.python libxml2 libxslt zip unzip rsync
] ++ stdenv.lib.optionals stdenv.isDarwin [ AppKit Carbon Cocoa ];

nativeBuildInputs = [
docbook_xml_dtd_45 docbook_xsl perl xmlto
];

enableParallelBuilding = true;

prePatch = ''
mkdir -p deps
rm -rf deps/rabbitmq_{codegen,common}
ln -s ${rabbitmq-codegen} deps/rabbitmq_codegen
ln -s ${rabbitmq-common} deps/rabbitmq_common
# Fix the "/usr/bin/env" in "calculate-relative".
patchShebangs .
ls -la deps/
'';

makeTargets = [ "all" ];

preBuild =
''
# Fix the "/usr/bin/env" in "calculate-relative".
patchShebangs .
'';
installFlags = [
"PREFIX=$(out)"
"RMQ_ERLAPP_DIR=$(out)"
];

installFlags = "PREFIX=$(out) RMQ_ERLAPP_DIR=$(out)";
installTargets = "install install-man";

postInstall =
''
echo 'PATH=${erlang}/bin:''${PATH:+:}$PATH' >> $out/sbin/rabbitmq-env
''; # */
postInstall = ''
echo 'PATH=${stdenv.lib.makeBinPath [ erlang ]}:''${PATH:+:}$PATH' >> $out/sbin/rabbitmq-env
'';

meta = {
meta = with stdenv.lib; {
homepage = http://www.rabbitmq.com/;
description = "An implementation of the AMQP messaging protocol";
platforms = stdenv.lib.platforms.unix;
maintainers = with maintainers; [ peterhoeg ];
platforms = platforms.unix;
};
}

0 comments on commit 2c59339

Please sign in to comment.
You can’t perform that action at this time.