2021-05-17 13:47:15 +02:00
|
|
|
{ lib, stdenv, fetchpatch, fetchFromGitHub, cmake, openssl, sqlite, pkg-config
|
|
|
|
, systemd, tlsSupport ? false }:
|
2014-07-18 19:02:53 +02:00
|
|
|
|
|
|
|
assert tlsSupport -> openssl != null;
|
|
|
|
|
2016-09-07 03:27:39 +02:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 14:41:18 +02:00
|
|
|
pname = "uhub";
|
2021-05-17 13:47:15 +02:00
|
|
|
version = "unstable-2019-12-13";
|
2014-07-18 19:02:53 +02:00
|
|
|
|
2018-10-08 00:53:16 +02:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "janvidar";
|
|
|
|
repo = "uhub";
|
2021-05-17 13:47:15 +02:00
|
|
|
rev = "35d8088b447527f56609b85b444bd0b10cd67b5c";
|
|
|
|
hash = "sha256-CdTTf82opnpjd7I9TTY+JDEZSfdGFPE0bq/xsafwm/w=";
|
2014-07-18 19:02:53 +02:00
|
|
|
};
|
|
|
|
|
2020-12-31 08:48:55 +01:00
|
|
|
nativeBuildInputs = [ cmake pkg-config ];
|
2021-01-15 08:07:56 +01:00
|
|
|
buildInputs = [ sqlite systemd ] ++ lib.optional tlsSupport openssl;
|
2014-07-18 19:02:53 +02:00
|
|
|
|
2021-05-17 13:47:15 +02:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace CMakeLists.txt \
|
|
|
|
--replace "/usr/lib/uhub/" "$out/plugins" \
|
|
|
|
--replace "/etc/uhub" "$TMPDIR"
|
|
|
|
'';
|
2014-07-18 19:02:53 +02:00
|
|
|
|
2019-10-29 23:21:22 +01:00
|
|
|
cmakeFlags = [
|
|
|
|
"-DSYSTEMD_SUPPORT=ON"
|
2021-05-17 13:47:15 +02:00
|
|
|
"-DSSL_SUPPORT=${if tlsSupport then "ON" else "OFF"}"
|
2019-10-29 23:21:22 +01:00
|
|
|
];
|
2014-07-18 19:02:53 +02:00
|
|
|
|
2021-01-11 08:54:33 +01:00
|
|
|
meta = with lib; {
|
2014-07-18 19:02:53 +02:00
|
|
|
description = "High performance peer-to-peer hub for the ADC network";
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "https://www.uhub.org/";
|
2014-07-18 19:02:53 +02:00
|
|
|
license = licenses.gpl3;
|
2015-12-05 22:41:25 +01:00
|
|
|
maintainers = [ maintainers.ehmry ];
|
2014-07-18 19:02:53 +02:00
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
2016-09-07 03:27:39 +02:00
|
|
|
}
|