summary refs log tree commit diff
diff options
context:
space:
mode:
authorSarah Brofeldt <sbrofeldt@gmail.com>2018-10-25 08:37:51 +0200
committerGitHub <noreply@github.com>2018-10-25 08:37:51 +0200
commit7354d9de1f46057f7d94ed78d444663da35155f1 (patch)
treeb46b4bed9a42bcbbeda5a8528ddb9ff536e389ec
parentd17ab805fd8d150c78760cc9e7d3741b99cee07e (diff)
parenta45fa35742ac3bc109aa8516bf25a17759e84da9 (diff)
downloadnixlib-7354d9de1f46057f7d94ed78d444663da35155f1.tar
nixlib-7354d9de1f46057f7d94ed78d444663da35155f1.tar.gz
nixlib-7354d9de1f46057f7d94ed78d444663da35155f1.tar.bz2
nixlib-7354d9de1f46057f7d94ed78d444663da35155f1.tar.lz
nixlib-7354d9de1f46057f7d94ed78d444663da35155f1.tar.xz
nixlib-7354d9de1f46057f7d94ed78d444663da35155f1.tar.zst
nixlib-7354d9de1f46057f7d94ed78d444663da35155f1.zip
Merge pull request #49088 from peterhoeg/u/mqtt
mosquitto: 1.4.15 -> 1.5.3
-rw-r--r--pkgs/servers/mqtt/mosquitto/default.nix61
1 files changed, 38 insertions, 23 deletions
diff --git a/pkgs/servers/mqtt/mosquitto/default.nix b/pkgs/servers/mqtt/mosquitto/default.nix
index bce69370d2bd..231124a42efb 100644
--- a/pkgs/servers/mqtt/mosquitto/default.nix
+++ b/pkgs/servers/mqtt/mosquitto/default.nix
@@ -1,36 +1,51 @@
-{ stdenv, fetchurl, openssl, libuuid, cmake, libwebsockets, c-ares, libuv }:
+{ stdenv, fetchFromGitHub, fetchpatch, cmake, docbook_xsl, libxslt
+, openssl, libuuid, libwebsockets, c-ares, libuv }:
 
 stdenv.mkDerivation rec {
-  pname = "mosquitto";
-  version = "1.4.15";
+  name = "mosquitto-${version}";
+  version = "1.5.3";
 
-  name = "${pname}-${version}";
-
-  src = fetchurl {
-    url = "http://mosquitto.org/files/source/mosquitto-${version}.tar.gz";
-    sha256 = "10wsm1n4y61nz45zwk4zjhvrfd86r2cq33370m5wjkivb8j3wfvx";
+  src = fetchFromGitHub {
+    owner  = "eclipse";
+    repo   = "mosquitto";
+    rev    = "v${version}";
+    sha256 = "0bknmnvssix7c1cps6mzjjnw9zxdlyfsy6ksqx4zfglcw41p8gnz";
   };
 
-  buildInputs = [ openssl libuuid libwebsockets c-ares libuv ]
-    ++ stdenv.lib.optional stdenv.isDarwin cmake;
-
-  makeFlags = stdenv.lib.optionals stdenv.isLinux [
-    "DESTDIR=$(out)"
-    "PREFIX="
+  patches = [
+    # https://github.com/eclipse/mosquitto/issues/983
+    (fetchpatch {
+      url    = "https://github.com/eclipse/mosquitto/commit/7f1419e4de981f5cc38aa3a9684369b1de27ba46.patch";
+      sha256 = "05npr0h79mbaxzjyhdw78hi9gs1cwydf2fv67bqxm81jzj2yhx2s";
+      name   = "fix_threading_on_cmake.patch";
+    })
   ];
 
   postPatch = ''
-    substituteInPlace config.mk \
-      --replace "/usr/local" ""
-    substituteInPlace config.mk \
-      --replace "WITH_WEBSOCKETS:=no" "WITH_WEBSOCKETS:=yes"
+    substituteInPlace man/manpage.xsl \
+      --replace /usr/share/xml/docbook/stylesheet/ ${docbook_xsl}/share/xml/
+
+    # the manpages are not generated when using cmake
+    pushd man
+    make
+    popd
   '';
 
-  meta = {
-    homepage = http://mosquitto.org/;
+  buildInputs = [ openssl libuuid libwebsockets c-ares libuv ];
+
+  nativeBuildInputs = [ cmake docbook_xsl libxslt ];
+
+  enableParallelBuilding = true;
+
+  cmakeFlags = [
+    "-DWITH_THREADING=ON"
+  ];
+
+  meta = with stdenv.lib; {
     description = "An open source MQTT v3.1/3.1.1 broker";
-    platforms = stdenv.lib.platforms.unix;
-    # http://www.eclipse.org/legal/epl-v10.html (free software, copyleft)
-    license = stdenv.lib.licenses.epl10;
+    homepage = http://mosquitto.org/;
+    license = licenses.epl10;
+    maintainers = with maintainers; [ peterhoeg ];
+    platforms = platforms.unix;
   };
 }