summary refs log tree commit diff
path: root/pkgs/servers/mqtt/mosquitto/default.nix
blob: be7947a03d6c3c69fcb686605617de4c278c407c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
{ stdenv, fetchurl, openssl, libuuid, cmake }:

stdenv.mkDerivation rec {
  pname = "mosquitto";
  version = "1.4";

  name = "${pname}-${version}";

  src = fetchurl {
    url = http://mosquitto.org/files/source/mosquitto-1.4.tar.gz;
    sha256 = "1imw5ps0cqda41b574k8hgz9gdr8yy58f76fg8gw14pdnvf3l7sr";
  };

  buildInputs = [ openssl libuuid ]
    ++ stdenv.lib.optional stdenv.isDarwin cmake;

  makeFlags = [
    "DESTDIR=$(out)"
    "PREFIX="
  ];

  preBuild = ''
    substituteInPlace config.mk \
      --replace "/usr/local" ""
  '';

  meta = {
    homepage = http://mosquitto.org/;
    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;
  };
}