summaryrefslogtreecommitdiffstats
path: root/makefu/5pkgs/uhub/default.nix
blob: e0ee035e41a428f00ac1049eb26ff4794ea76e24 (plain)
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
{ stdenv, lib, fetchpatch, fetchFromGitHub, cmake, openssl, sqlite, pkgconfig, systemd
, tlsSupport ? false }:

assert tlsSupport -> openssl != null;

stdenv.mkDerivation rec {
  pname = "uhub";
  version = "2019-06-18";

  src = fetchFromGitHub {
    owner = "janvidar";
    repo = "uhub";
    rev = "78a703924064a92cedeb0a5aab5a80d8f77db73e";
    sha256 = "1dqmj08salhbcdlkglbi03hn9jzgmhjqlb0iysafpzrrwi0mca1z";
  };

  nativeBuildInputs = [ pkgconfig ];
  buildInputs = [ cmake sqlite systemd ] ++ lib.optional tlsSupport openssl;

  outputs = [ "out"
    "mod_example"
    "mod_welcome"
    "mod_logging"
    "mod_auth_simple"
    "mod_auth_sqlite"
    "mod_chat_history"
    "mod_chat_only"
    "mod_topic"
    "mod_no_guest_downloads"
  ];

  patches = [
    <nixpkgs/pkgs/servers/uhub/plugin-dir.patch>
  ];

  cmakeFlags = ''
    -DSYSTEMD_SUPPORT=ON
    ${if tlsSupport then "-DSSL_SUPPORT=ON" else "-DSSL_SUPPORT=OFF"}
  '';

  meta = with lib; {
    description = "High performance peer-to-peer hub for the ADC network";
    homepage = https://www.uhub.org/;
    license = licenses.gpl3;
    maintainers = [ maintainers.ehmry ];
    platforms = platforms.unix;
  };
}