uhub: 0.5.0 -> unstable-2019-12-13

This commit is contained in:
Emery Hemingway 2021-05-17 13:47:15 +02:00 committed by J. Emery Hemingway
parent 297a0094a6
commit 4f78c88e81
2 changed files with 11 additions and 51 deletions

View File

@ -1,52 +1,31 @@
{ lib, stdenv, fetchpatch, fetchFromGitHub, cmake, openssl, sqlite, pkg-config, systemd
, tlsSupport ? false }:
{ lib, stdenv, fetchpatch, fetchFromGitHub, cmake, openssl, sqlite, pkg-config
, systemd, tlsSupport ? false }:
assert tlsSupport -> openssl != null;
stdenv.mkDerivation rec {
pname = "uhub";
version = "0.5.0";
version = "unstable-2019-12-13";
src = fetchFromGitHub {
owner = "janvidar";
repo = "uhub";
rev = version;
sha256 = "0zdbxfvw7apmfhqgsfkfp4pn9iflzwdn0zwvzymm5inswfc00pxg";
rev = "35d8088b447527f56609b85b444bd0b10cd67b5c";
hash = "sha256-CdTTf82opnpjd7I9TTY+JDEZSfdGFPE0bq/xsafwm/w=";
};
nativeBuildInputs = [ cmake pkg-config ];
buildInputs = [ sqlite systemd ] ++ lib.optional tlsSupport openssl;
outputs = [ "out"
"mod_example"
"mod_welcome"
"mod_logging"
"mod_auth_simple"
"mod_auth_sqlite"
"mod_chat_history"
"mod_chat_only"
"mod_topic"
"mod_no_guest_downloads"
];
patches = [
./plugin-dir.patch
# fix aarch64 build: https://github.com/janvidar/uhub/issues/46
(fetchpatch {
url = "https://github.com/janvidar/uhub/pull/47.patch";
sha256 = "07yik6za89ar5bxm7m2183i7f6hfbawbxvd4vs02n1zr2fgfxmiq";
})
# Fixed compilation on systemd > 210
(fetchpatch {
url = "https://github.com/janvidar/uhub/commit/70f2a43f676cdda5961950a8d9a21e12d34993f8.diff";
sha256 = "1jp8fvw6f9jh0sdjml9mahkk6p6b96p6rzg2y601mnnbcdj8y8xp";
})
];
postPatch = ''
substituteInPlace CMakeLists.txt \
--replace "/usr/lib/uhub/" "$out/plugins" \
--replace "/etc/uhub" "$TMPDIR"
'';
cmakeFlags = [
"-DSYSTEMD_SUPPORT=ON"
(if tlsSupport then "-DSSL_SUPPORT=ON" else "-DSSL_SUPPORT=OFF")
"-DSSL_SUPPORT=${if tlsSupport then "ON" else "OFF"}"
];
meta = with lib; {

View File

@ -1,19 +0,0 @@
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -241,8 +241,14 @@
if (UNIX)
install( TARGETS uhub uhub-passwd RUNTIME DESTINATION bin )
- install( TARGETS mod_example mod_welcome mod_logging mod_auth_simple mod_auth_sqlite mod_chat_history mod_chat_history_sqlite mod_chat_only mod_topic mod_no_guest_downloads DESTINATION /usr/lib/uhub/ OPTIONAL )
- install( FILES ${CMAKE_SOURCE_DIR}/doc/uhub.conf ${CMAKE_SOURCE_DIR}/doc/plugins.conf ${CMAKE_SOURCE_DIR}/doc/rules.txt ${CMAKE_SOURCE_DIR}/doc/motd.txt DESTINATION /etc/uhub OPTIONAL )
+
+ set( PLUGINS mod_example mod_welcome mod_logging mod_auth_simple mod_auth_sqlite mod_chat_history mod_chat_only mod_topic mod_no_guest_downloads )
+
+ foreach( PLUGIN ${PLUGINS} )
+ install( TARGETS ${PLUGIN} DESTINATION $ENV{${PLUGIN}} OPTIONAL )
+ endforeach( PLUGIN )
+
+ install( FILES ${CMAKE_SOURCE_DIR}/doc/uhub.conf ${CMAKE_SOURCE_DIR}/doc/plugins.conf ${CMAKE_SOURCE_DIR}/doc/rules.txt ${CMAKE_SOURCE_DIR}/doc/motd.txt DESTINATION doc/ OPTIONAL )
endif()