2021-01-11 08:54:33 +01:00
|
|
|
{ lib, stdenv, fetchpatch, fetchFromGitHub, cmake, openssl, sqlite, pkg-config, systemd
|
2014-07-18 19:02:53 +02:00
|
|
|
, tlsSupport ? false }:
|
|
|
|
|
|
|
|
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";
|
2016-09-07 03:27:39 +02:00
|
|
|
version = "0.5.0";
|
2014-07-18 19:02:53 +02:00
|
|
|
|
2018-10-08 00:53:16 +02:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "janvidar";
|
|
|
|
repo = "uhub";
|
|
|
|
rev = version;
|
|
|
|
sha256 = "0zdbxfvw7apmfhqgsfkfp4pn9iflzwdn0zwvzymm5inswfc00pxg";
|
2014-07-18 19:02:53 +02:00
|
|
|
};
|
|
|
|
|
2020-12-31 08:48:55 +01:00
|
|
|
nativeBuildInputs = [ cmake pkg-config ];
|
|
|
|
buildInputs = [ sqlite systemd ] ++ stdenv.lib.optional tlsSupport openssl;
|
2014-07-18 19:02:53 +02:00
|
|
|
|
|
|
|
outputs = [ "out"
|
|
|
|
"mod_example"
|
|
|
|
"mod_welcome"
|
|
|
|
"mod_logging"
|
|
|
|
"mod_auth_simple"
|
2018-06-09 01:35:34 +02:00
|
|
|
"mod_auth_sqlite"
|
2014-07-18 19:02:53 +02:00
|
|
|
"mod_chat_history"
|
|
|
|
"mod_chat_only"
|
|
|
|
"mod_topic"
|
|
|
|
"mod_no_guest_downloads"
|
|
|
|
];
|
|
|
|
|
2016-09-07 03:27:39 +02:00
|
|
|
patches = [
|
|
|
|
./plugin-dir.patch
|
2018-10-08 00:54:00 +02:00
|
|
|
# fix aarch64 build: https://github.com/janvidar/uhub/issues/46
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/janvidar/uhub/pull/47.patch";
|
|
|
|
sha256 = "07yik6za89ar5bxm7m2183i7f6hfbawbxvd4vs02n1zr2fgfxmiq";
|
|
|
|
})
|
2016-09-07 03:27:39 +02:00
|
|
|
|
|
|
|
# Fixed compilation on systemd > 210
|
2018-10-08 00:54:00 +02:00
|
|
|
(fetchpatch {
|
2016-09-07 03:27:39 +02:00
|
|
|
url = "https://github.com/janvidar/uhub/commit/70f2a43f676cdda5961950a8d9a21e12d34993f8.diff";
|
|
|
|
sha256 = "1jp8fvw6f9jh0sdjml9mahkk6p6b96p6rzg2y601mnnbcdj8y8xp";
|
|
|
|
})
|
|
|
|
];
|
2014-07-18 19:02:53 +02:00
|
|
|
|
2019-10-29 23:21:22 +01:00
|
|
|
cmakeFlags = [
|
|
|
|
"-DSYSTEMD_SUPPORT=ON"
|
|
|
|
(if tlsSupport then "-DSSL_SUPPORT=ON" else "-DSSL_SUPPORT=OFF")
|
|
|
|
];
|
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
|
|
|
}
|