Unverified Commit 74de84cd authored by Weijia Wang's avatar Weijia Wang Committed by GitHub
Browse files

rabbitmq-server: 3.13.7 → 4.0.2 (#351867)

parents 40a5bbd4 52cef79e
Loading
Loading
Loading
Loading
+73 −41
Original line number Diff line number Diff line
{ lib
, stdenv
, fetchurl
, erlang
, elixir
, python3
, libxml2
, libxslt
, xmlto
, docbook_xml_dtd_45
, docbook_xsl
, zip
, unzip
, rsync
, getconf
, socat
, procps
, coreutils
, gnused
, systemd
, glibcLocales
, AppKit
, Carbon
, Cocoa
, nixosTests
{
  lib,
  stdenv,
  fetchurl,
  erlang,
  elixir,
  python3,
  libxml2,
  libxslt,
  xmlto,
  docbook_xml_dtd_45,
  docbook_xsl,
  zip,
  unzip,
  rsync,
  getconf,
  socat,
  procps,
  coreutils,
  gnused,
  systemd,
  glibcLocales,
  AppKit,
  Carbon,
  Cocoa,
  nixosTests,
  which,
}:

let
  runtimePath = lib.makeBinPath ([
  runtimePath = lib.makeBinPath (
    [
      erlang
      getconf # for getting memory limits
      socat
      procps
      gnused
      coreutils # used by helper scripts
  ] ++ lib.optionals stdenv.hostPlatform.isLinux [ systemd ]); # for systemd unit activation check
    ]
    ++ lib.optionals stdenv.hostPlatform.isLinux [ systemd ]
  ); # for systemd unit activation check
in

stdenv.mkDerivation rec {
  pname = "rabbitmq-server";
  version = "3.13.7";
  version = "4.0.2";

  # 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";
    hash = "sha256-GDUyYudwhQSLrFXO21W3fwmH2tl2STF9gSuZsb3GZh0=";
    hash = "sha256-mSwjQTLkEWBBbbMDLZ+qldS2YDcUvp8BB+J0+RLQvZE=";
  };

  nativeBuildInputs = [ unzip xmlto docbook_xml_dtd_45 docbook_xsl zip rsync python3 ];
  nativeBuildInputs = [
    unzip
    xmlto
    docbook_xml_dtd_45
    docbook_xsl
    zip
    rsync
    python3
    which
  ];

  buildInputs = [ erlang elixir libxml2 libxslt glibcLocales ]
    ++ lib.optionals stdenv.hostPlatform.isDarwin [ AppKit Carbon Cocoa ];
  buildInputs =
    [
      erlang
      elixir
      libxml2
      libxslt
      glibcLocales
    ]
    ++ lib.optionals stdenv.hostPlatform.isDarwin [
      AppKit
      Carbon
      Cocoa
    ];

  outputs = [ "out" "man" "doc" ];
  outputs = [
    "out"
    "man"
    "doc"
  ];

  installFlags = [
    "PREFIX=${placeholder "out"}"
    "RMQ_ERLAPP_DIR=${placeholder "out"}"
  ];

  installTargets = [ "install" "install-man" ];
  installTargets = [
    "install"
    "install-man"
  ];

  preBuild = ''
    export LANG=C.UTF-8 # fix elixir locale warning
@@ -91,6 +123,6 @@ stdenv.mkDerivation rec {
    changelog = "https://github.com/rabbitmq/rabbitmq-server/releases/tag/v${version}";
    license = lib.licenses.mpl20;
    platforms = lib.platforms.unix;
    maintainers = [ ];
    maintainers = with lib.maintainers; [ samueltardieu ];
  };
}