1 { lib, stdenv, fetchFromGitHub, cmake, openssl, sqlite, pkg-config
2 , systemd, tlsSupport ? false }:
4 assert tlsSupport -> openssl != null;
6 stdenv.mkDerivation rec {
8 version = "unstable-2019-12-13";
10 src = fetchFromGitHub {
13 rev = "35d8088b447527f56609b85b444bd0b10cd67b5c";
14 hash = "sha256-CdTTf82opnpjd7I9TTY+JDEZSfdGFPE0bq/xsafwm/w=";
17 nativeBuildInputs = [ cmake pkg-config ];
18 buildInputs = [ sqlite systemd ] ++ lib.optional tlsSupport openssl;
21 substituteInPlace CMakeLists.txt \
22 --replace "/usr/lib/uhub/" "$out/plugins" \
23 --replace "/etc/uhub" "$TMPDIR"
27 "-DSYSTEMD_SUPPORT=ON"
28 "-DSSL_SUPPORT=${if tlsSupport then "ON" else "OFF"}"
32 description = "High performance peer-to-peer hub for the ADC network";
33 homepage = "https://www.uhub.org/";
34 license = licenses.gpl3;
35 maintainers = [ maintainers.ehmry ];
36 platforms = platforms.unix;