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

Merge pull request #49187 from andir/18.03/mosquitto

[18.03] mosquitto: 1.4.14 ->1.5.3

authored by Andreas Rammhold and committed by GitHub 02fc3d36 ee9df2b7

Changed files
+38 -23
pkgs
servers
mqtt
mosquitto
+38 -23
pkgs/servers/mqtt/mosquitto/default.nix
··· 1 - { stdenv, fetchurl, openssl, libuuid, cmake, libwebsockets, c-ares, libuv }: 1 + { stdenv, fetchFromGitHub, fetchpatch, cmake, docbook_xsl, libxslt 2 + , openssl, libuuid, libwebsockets, c-ares, libuv }: 2 3 3 4 stdenv.mkDerivation rec { 4 - pname = "mosquitto"; 5 - version = "1.4.14"; 6 - 7 - name = "${pname}-${version}"; 5 + name = "mosquitto-${version}"; 6 + version = "1.5.3"; 8 7 9 - src = fetchurl { 10 - url = "http://mosquitto.org/files/source/mosquitto-${version}.tar.gz"; 11 - sha256 = "1la2577h7hcyj7lq26vizj0sh2zmi9m7nbxjp3aalayi66kiysqm"; 8 + src = fetchFromGitHub { 9 + owner = "eclipse"; 10 + repo = "mosquitto"; 11 + rev = "v${version}"; 12 + sha256 = "0bknmnvssix7c1cps6mzjjnw9zxdlyfsy6ksqx4zfglcw41p8gnz"; 12 13 }; 13 14 14 - buildInputs = [ openssl libuuid libwebsockets c-ares libuv ] 15 - ++ stdenv.lib.optional stdenv.isDarwin cmake; 16 - 17 - makeFlags = stdenv.lib.optionals stdenv.isLinux [ 18 - "DESTDIR=$(out)" 19 - "PREFIX=" 15 + patches = [ 16 + # https://github.com/eclipse/mosquitto/issues/983 17 + (fetchpatch { 18 + url = "https://github.com/eclipse/mosquitto/commit/7f1419e4de981f5cc38aa3a9684369b1de27ba46.patch"; 19 + sha256 = "05npr0h79mbaxzjyhdw78hi9gs1cwydf2fv67bqxm81jzj2yhx2s"; 20 + name = "fix_threading_on_cmake.patch"; 21 + }) 20 22 ]; 21 23 22 24 postPatch = '' 23 - substituteInPlace config.mk \ 24 - --replace "/usr/local" "" 25 - substituteInPlace config.mk \ 26 - --replace "WITH_WEBSOCKETS:=no" "WITH_WEBSOCKETS:=yes" 25 + substituteInPlace man/manpage.xsl \ 26 + --replace /usr/share/xml/docbook/stylesheet/ ${docbook_xsl}/share/xml/ 27 + 28 + # the manpages are not generated when using cmake 29 + pushd man 30 + make 31 + popd 27 32 ''; 28 33 29 - meta = { 30 - homepage = http://mosquitto.org/; 34 + buildInputs = [ openssl libuuid libwebsockets c-ares libuv ]; 35 + 36 + nativeBuildInputs = [ cmake docbook_xsl libxslt ]; 37 + 38 + enableParallelBuilding = true; 39 + 40 + cmakeFlags = [ 41 + "-DWITH_THREADING=ON" 42 + ]; 43 + 44 + meta = with stdenv.lib; { 31 45 description = "An open source MQTT v3.1/3.1.1 broker"; 32 - platforms = stdenv.lib.platforms.unix; 33 - # http://www.eclipse.org/legal/epl-v10.html (free software, copyleft) 34 - license = stdenv.lib.licenses.epl10; 46 + homepage = http://mosquitto.org/; 47 + license = licenses.epl10; 48 + maintainers = with maintainers; [ peterhoeg ]; 49 + platforms = platforms.unix; 35 50 }; 36 51 }