mosquitto: 1.4.15 -> 1.5.3

Use cmake on all platforms instead of only macos.
This commit is contained in:
Peter Hoeg 2018-10-11 17:03:32 +08:00
parent 0a7e258012
commit a45fa35742

View File

@ -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 { stdenv.mkDerivation rec {
pname = "mosquitto"; name = "mosquitto-${version}";
version = "1.4.15"; version = "1.5.3";
name = "${pname}-${version}"; src = fetchFromGitHub {
owner = "eclipse";
src = fetchurl { repo = "mosquitto";
url = "http://mosquitto.org/files/source/mosquitto-${version}.tar.gz"; rev = "v${version}";
sha256 = "10wsm1n4y61nz45zwk4zjhvrfd86r2cq33370m5wjkivb8j3wfvx"; sha256 = "0bknmnvssix7c1cps6mzjjnw9zxdlyfsy6ksqx4zfglcw41p8gnz";
}; };
buildInputs = [ openssl libuuid libwebsockets c-ares libuv ] patches = [
++ stdenv.lib.optional stdenv.isDarwin cmake; # https://github.com/eclipse/mosquitto/issues/983
(fetchpatch {
makeFlags = stdenv.lib.optionals stdenv.isLinux [ url = "https://github.com/eclipse/mosquitto/commit/7f1419e4de981f5cc38aa3a9684369b1de27ba46.patch";
"DESTDIR=$(out)" sha256 = "05npr0h79mbaxzjyhdw78hi9gs1cwydf2fv67bqxm81jzj2yhx2s";
"PREFIX=" name = "fix_threading_on_cmake.patch";
})
]; ];
postPatch = '' postPatch = ''
substituteInPlace config.mk \ substituteInPlace man/manpage.xsl \
--replace "/usr/local" "" --replace /usr/share/xml/docbook/stylesheet/ ${docbook_xsl}/share/xml/
substituteInPlace config.mk \
--replace "WITH_WEBSOCKETS:=no" "WITH_WEBSOCKETS:=yes" # the manpages are not generated when using cmake
pushd man
make
popd
''; '';
meta = { buildInputs = [ openssl libuuid libwebsockets c-ares libuv ];
homepage = http://mosquitto.org/;
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"; description = "An open source MQTT v3.1/3.1.1 broker";
platforms = stdenv.lib.platforms.unix; homepage = http://mosquitto.org/;
# http://www.eclipse.org/legal/epl-v10.html (free software, copyleft) license = licenses.epl10;
license = stdenv.lib.licenses.epl10; maintainers = with maintainers; [ peterhoeg ];
platforms = platforms.unix;
}; };
} }