Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)

mosquitto: 1.5.5 -> 1.5.8 and add systemd support

(cherry picked from commit 5638a1c71738013e96a51b07ce7a39d76a33448c)

authored by

Peter Hoeg and committed by
Robin Gloster
ce16af3c bc7de5b5

+18 -10
+18 -10
pkgs/servers/mqtt/mosquitto/default.nix
··· 1 - { stdenv, fetchFromGitHub, fetchpatch, cmake, docbook_xsl, libxslt 2 - , openssl, libuuid, libwebsockets, c-ares, libuv }: 1 + { stdenv, lib, fetchFromGitHub, fetchpatch, cmake, docbook_xsl, libxslt 2 + , openssl, libuuid, libwebsockets, c-ares, libuv 3 + , systemd ? null }: 3 4 4 - stdenv.mkDerivation rec { 5 + let 6 + withSystemd = stdenv.isLinux; 7 + 8 + in stdenv.mkDerivation rec { 5 9 name = "mosquitto-${version}"; 6 - version = "1.5.5"; 10 + version = "1.5.8"; 7 11 8 12 src = fetchFromGitHub { 9 13 owner = "eclipse"; 10 14 repo = "mosquitto"; 11 15 rev = "v${version}"; 12 - sha256 = "1sfwmvrglfy5gqfk004kvbjldqr36dqz6xmppbgfhr47j5zs66xc"; 16 + sha256 = "1rf8g6fq7g1mhwsajsgvvlynasybgc51v0qg5j6ynsxfh8yi7s6r"; 13 17 }; 14 18 15 19 postPatch = '' 16 - substituteInPlace man/manpage.xsl \ 17 - --replace /usr/share/xml/docbook/stylesheet/ ${docbook_xsl}/share/xml/ 20 + for f in html manpage ; do 21 + substituteInPlace man/$f.xsl \ 22 + --replace http://docbook.sourceforge.net/release/xsl/current ${docbook_xsl}/share/xml/docbook-xsl 23 + done 18 24 19 25 for f in {lib,lib/cpp,src}/CMakeLists.txt ; do 20 - substituteInPlace $f --replace /sbin/ldconfig ldconfig 26 + substituteInPlace $f --replace /sbin/ldconfig true 21 27 done 22 28 23 29 # the manpages are not generated when using cmake ··· 26 32 popd 27 33 ''; 28 34 29 - buildInputs = [ openssl libuuid libwebsockets c-ares libuv ]; 35 + buildInputs = [ 36 + openssl libuuid libwebsockets c-ares libuv 37 + ] ++ lib.optional withSystemd systemd; 30 38 31 39 nativeBuildInputs = [ cmake docbook_xsl libxslt ]; 32 40 ··· 35 43 cmakeFlags = [ 36 44 "-DWITH_THREADING=ON" 37 45 "-DWITH_WEBSOCKETS=ON" 38 - ]; 46 + ] ++ lib.optional withSystemd "-DWITH_SYSTEMD=ON"; 39 47 40 48 meta = with stdenv.lib; { 41 49 description = "An open source MQTT v3.1/3.1.1 broker";