2021-01-11 07:54:33 +00:00
|
|
|
{ lib, stdenv, fetchpatch, fetchFromGitHub, cmake, openssl, sqlite, pkg-config, systemd
|
2014-07-18 18:02:53 +01:00
|
|
|
, tlsSupport ? false }:
|
|
|
|
|
|
|
|
assert tlsSupport -> openssl != null;
|
|
|
|
|
2016-09-07 02:27:39 +01:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "uhub";
|
2016-09-07 02:27:39 +01:00
|
|
|
version = "0.5.0";
|
2014-07-18 18:02:53 +01:00
|
|
|
|
2018-10-07 23:53:16 +01:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "janvidar";
|
|
|
|
repo = "uhub";
|
|
|
|
rev = version;
|
|
|
|
sha256 = "0zdbxfvw7apmfhqgsfkfp4pn9iflzwdn0zwvzymm5inswfc00pxg";
|
2014-07-18 18:02:53 +01: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 18:02:53 +01:00
|
|
|
|
|
|
|
outputs = [ "out"
|
|
|
|
"mod_example"
|
|
|
|
"mod_welcome"
|
|
|
|
"mod_logging"
|
|
|
|
"mod_auth_simple"
|
2018-06-09 00:35:34 +01:00
|
|
|
"mod_auth_sqlite"
|
2014-07-18 18:02:53 +01:00
|
|
|
"mod_chat_history"
|
|
|
|
"mod_chat_only"
|
|
|
|
"mod_topic"
|
|
|
|
"mod_no_guest_downloads"
|
|
|
|
];
|
|
|
|
|
2016-09-07 02:27:39 +01:00
|
|
|
patches = [
|
|
|
|
./plugin-dir.patch
|
2018-10-07 23:54:00 +01: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 02:27:39 +01:00
|
|
|
|
|
|
|
# Fixed compilation on systemd > 210
|
2018-10-07 23:54:00 +01:00
|
|
|
(fetchpatch {
|
2016-09-07 02:27:39 +01:00
|
|
|
url = "https://github.com/janvidar/uhub/commit/70f2a43f676cdda5961950a8d9a21e12d34993f8.diff";
|
|
|
|
sha256 = "1jp8fvw6f9jh0sdjml9mahkk6p6b96p6rzg2y601mnnbcdj8y8xp";
|
|
|
|
})
|
|
|
|
];
|
2014-07-18 18:02:53 +01:00
|
|
|
|
2019-10-29 22:21:22 +00:00
|
|
|
cmakeFlags = [
|
|
|
|
"-DSYSTEMD_SUPPORT=ON"
|
|
|
|
(if tlsSupport then "-DSSL_SUPPORT=ON" else "-DSSL_SUPPORT=OFF")
|
|
|
|
];
|
2014-07-18 18:02:53 +01:00
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2014-07-18 18:02:53 +01:00
|
|
|
description = "High performance peer-to-peer hub for the ADC network";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://www.uhub.org/";
|
2014-07-18 18:02:53 +01:00
|
|
|
license = licenses.gpl3;
|
2015-12-05 21:41:25 +00:00
|
|
|
maintainers = [ maintainers.ehmry ];
|
2014-07-18 18:02:53 +01:00
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
2016-09-07 02:27:39 +01:00
|
|
|
}
|