2018-10-07 22:54:00 +00:00
|
|
|
{ stdenv, fetchpatch, fetchFromGitHub, cmake, openssl, sqlite, pkgconfig, systemd
|
2014-07-18 17:02:53 +00:00
|
|
|
, tlsSupport ? false }:
|
|
|
|
|
|
|
|
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";
|
2016-09-07 01:27:39 +00:00
|
|
|
version = "0.5.0";
|
2014-07-18 17:02:53 +00:00
|
|
|
|
2018-10-07 22:53:16 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "janvidar";
|
|
|
|
repo = "uhub";
|
|
|
|
rev = version;
|
|
|
|
sha256 = "0zdbxfvw7apmfhqgsfkfp4pn9iflzwdn0zwvzymm5inswfc00pxg";
|
2014-07-18 17:02:53 +00:00
|
|
|
};
|
|
|
|
|
2017-09-05 21:26:13 +00:00
|
|
|
nativeBuildInputs = [ pkgconfig ];
|
|
|
|
buildInputs = [ cmake sqlite systemd ] ++ stdenv.lib.optional tlsSupport openssl;
|
2014-07-18 17:02:53 +00:00
|
|
|
|
|
|
|
outputs = [ "out"
|
|
|
|
"mod_example"
|
|
|
|
"mod_welcome"
|
|
|
|
"mod_logging"
|
|
|
|
"mod_auth_simple"
|
2018-06-08 23:35:34 +00:00
|
|
|
"mod_auth_sqlite"
|
2014-07-18 17:02:53 +00:00
|
|
|
"mod_chat_history"
|
|
|
|
"mod_chat_only"
|
|
|
|
"mod_topic"
|
|
|
|
"mod_no_guest_downloads"
|
|
|
|
];
|
|
|
|
|
2016-09-07 01:27:39 +00:00
|
|
|
patches = [
|
|
|
|
./plugin-dir.patch
|
2018-10-07 22:54:00 +00: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 01:27:39 +00:00
|
|
|
|
|
|
|
# Fixed compilation on systemd > 210
|
2018-10-07 22:54:00 +00:00
|
|
|
(fetchpatch {
|
2016-09-07 01:27:39 +00:00
|
|
|
url = "https://github.com/janvidar/uhub/commit/70f2a43f676cdda5961950a8d9a21e12d34993f8.diff";
|
|
|
|
sha256 = "1jp8fvw6f9jh0sdjml9mahkk6p6b96p6rzg2y601mnnbcdj8y8xp";
|
|
|
|
})
|
|
|
|
];
|
2014-07-18 17:02:53 +00: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 17:02:53 +00:00
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "High performance peer-to-peer hub for the ADC network";
|
|
|
|
homepage = https://www.uhub.org/;
|
|
|
|
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
|
|
|
}
|