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