From e14207dc4461abf7758bc40bf81bd1a0329676f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Mon, 22 Aug 2022 14:41:02 +0200 Subject: [PATCH] rsyslog: remove ? null from inputs, delete unused patch --- pkgs/tools/system/rsyslog/default.nix | 245 ++++++++++++------ .../system/rsyslog/fix-gnutls-detection.patch | 60 ----- pkgs/top-level/all-packages.nix | 51 ++-- 3 files changed, 186 insertions(+), 170 deletions(-) delete mode 100644 pkgs/tools/system/rsyslog/fix-gnutls-detection.patch diff --git a/pkgs/tools/system/rsyslog/default.nix b/pkgs/tools/system/rsyslog/default.nix index 2493d96a253a..94539c8bfddd 100644 --- a/pkgs/tools/system/rsyslog/default.nix +++ b/pkgs/tools/system/rsyslog/default.nix @@ -1,14 +1,65 @@ -{ lib, stdenv, fetchurl, pkg-config, autoreconfHook, libestr, json_c, zlib, docutils, fastJson -, libkrb5 ? null, systemd ? null, jemalloc ? null, libmysqlclient ? null, postgresql ? null -, libdbi ? null, net-snmp ? null, libuuid ? null, curl ? null, gnutls ? null -, libgcrypt ? null, liblognorm ? null, openssl ? null, librelp ? null, libksi ? null -, liblogging ? null, libnet ? null, hadoop ? null, rdkafka ? null -, libmongo-client ? null, czmq ? null, rabbitmq-c ? null, hiredis ? null, mongoc ? null -, libmaxminddb ? null -, nixosTests ? null +{ lib +, stdenv +, fetchurl +, pkg-config +, autoreconfHook +, libestr +, json_c +, zlib +, docutils +, fastJson +, withKrb5 ? true +, libkrb5 +, withSystemd ? stdenv.isLinux +, systemd +, withJemalloc ? true +, jemalloc +, withMysql ? true +, libmysqlclient +, withPostgres ? true +, postgresql +, withDbi ? true +, libdbi +, withNetSnmp ? true +, net-snmp +, withUuid ? true +, libuuid +, withCurl ? true +, curl +, withGnutls ? true +, gnutls +, withGcrypt ? true +, libgcrypt +, withLognorm ? true +, liblognorm +, withMaxminddb ? true +, libmaxminddb +, withOpenssl ? true +, openssl +, withRelp ? true +, librelp +, withKsi ? true +, libksi +, withLogging ? true +, liblogging +, withNet ? true +, libnet +, withHadoop ? true +, hadoop +, withRdkafka ? true +, rdkafka +, withMongo ? true +, libmongo-client +, mongoc +, withCzmq ? true +, czmq +, withRabbitmq ? true +, rabbitmq-c +, withHiredis ? true +, hiredis +, nixosTests }: -with lib; stdenv.mkDerivation rec { pname = "rsyslog"; version = "8.2208.0"; @@ -18,98 +69,122 @@ stdenv.mkDerivation rec { sha256 = "sha256-FN5o57jlqwxdc0+C4tyf/yLNf0cQrWkHJ+sQp7mz314="; }; - #patches = [ ./fix-gnutls-detection.patch ]; - nativeBuildInputs = [ pkg-config autoreconfHook ]; buildInputs = [ - fastJson libestr json_c zlib docutils libkrb5 jemalloc - postgresql libdbi net-snmp libuuid curl gnutls libgcrypt liblognorm openssl - librelp libksi liblogging libnet hadoop rdkafka libmongo-client czmq - rabbitmq-c hiredis mongoc libmaxminddb - ] ++ lib.optional (libmysqlclient != null) libmysqlclient - ++ lib.optional stdenv.isLinux systemd; + fastJson + libestr + json_c + zlib + docutils + ] ++ lib.optional withKrb5 libkrb5 + ++ lib.optional withJemalloc jemalloc + ++ lib.optional withPostgres postgresql + ++ lib.optional withDbi libdbi + ++ lib.optional withNetSnmp net-snmp + ++ lib.optional withUuid libuuid + ++ lib.optional withCurl curl + ++ lib.optional withGnutls gnutls + ++ lib.optional withGcrypt libgcrypt + ++ lib.optional withLognorm liblognorm + ++ lib.optional withOpenssl openssl + ++ lib.optional withRelp librelp + ++ lib.optional withKsi libksi + ++ lib.optional withLogging liblogging + ++ lib.optional withNet libnet + ++ lib.optional withHadoop hadoop + ++ lib.optional withRdkafka rdkafka + ++ lib.optionals withMongo [ libmongo-client mongoc ] + ++ lib.optional withCzmq czmq + ++ lib.optional withRabbitmq rabbitmq-c + ++ lib.optional withHiredis hiredis + ++ lib.optional withMaxminddb libmaxminddb + ++ lib.optional withMysql libmysqlclient + ++ lib.optional withSystemd systemd; - configureFlags = [ + configureFlags = with lib; [ "--sysconfdir=/etc" "--localstatedir=/var" "--with-systemdsystemunitdir=\${out}/etc/systemd/system" - (enableFeature true "largefile") - (enableFeature true "regexp") - (enableFeature (libkrb5 != null) "gssapi-krb5") - (enableFeature true "klog") - (enableFeature true "kmsg") - (enableFeature (systemd != null) "imjournal") - (enableFeature true "inet") - (enableFeature (jemalloc != null) "jemalloc") - (enableFeature true "unlimited-select") - (enableFeature false "debug") - (enableFeature false "debug-symbols") - (enableFeature true "debugless") - (enableFeature false "valgrind") - (enableFeature false "diagtools") - (enableFeature true "usertools") - (enableFeature (libmysqlclient != null) "mysql") - (enableFeature (postgresql != null) "pgsql") - (enableFeature (libdbi != null) "libdbi") - (enableFeature (net-snmp != null) "snmp") - (enableFeature (libuuid != null) "uuid") - (enableFeature (curl != null) "elasticsearch") - (enableFeature (gnutls != null) "gnutls") - (enableFeature (libgcrypt != null) "libgcrypt") - (enableFeature true "rsyslogrt") - (enableFeature true "rsyslogd") - (enableFeature true "mail") - (enableFeature (liblognorm != null) "mmnormalize") - (enableFeature (libmaxminddb != null) "mmdblookup") - (enableFeature true "mmjsonparse") - (enableFeature true "mmaudit") - (enableFeature true "mmanon") - (enableFeature true "mmutf8fix") - (enableFeature true "mmcount") - (enableFeature true "mmsequence") - (enableFeature true "mmfields") - (enableFeature true "mmpstrucdata") - (enableFeature (openssl != null) "mmrfc5424addhmac") - (enableFeature (librelp != null) "relp") - (enableFeature (libksi != null) "ksi-ls12") - (enableFeature (liblogging != null) "liblogging-stdlog") - (enableFeature (liblogging != null) "rfc3195") - (enableFeature true "imfile") - (enableFeature false "imsolaris") - (enableFeature true "imptcp") - (enableFeature true "impstats") - (enableFeature true "omprog") - (enableFeature (libnet != null) "omudpspoof") - (enableFeature true "omstdout") - (enableFeature (systemd != null) "omjournal") - (enableFeature true "pmlastmsg") - (enableFeature true "pmcisconames") - (enableFeature true "pmciscoios") - (enableFeature true "pmaixforwardedfrom") - (enableFeature true "pmsnare") - (enableFeature true "omruleset") - (enableFeature true "omuxsock") - (enableFeature true "mmsnmptrapd") - (enableFeature (hadoop != null) "omhdfs") - (enableFeature (rdkafka != null) "omkafka") - (enableFeature (libmongo-client != null) "ommongodb") - (enableFeature (czmq != null) "imczmq") - (enableFeature (czmq != null) "omczmq") - (enableFeature (rabbitmq-c != null) "omrabbitmq") - (enableFeature (hiredis != null) "omhiredis") - (enableFeature (curl != null) "omhttpfs") - (enableFeature true "generate-man-pages") + (enableFeature true "largefile") + (enableFeature true "regexp") + (enableFeature withKrb5 "gssapi-krb5") + (enableFeature true "klog") + (enableFeature true "kmsg") + (enableFeature withSystemd "imjournal") + (enableFeature true "inet") + (enableFeature withJemalloc "jemalloc") + (enableFeature true "unlimited-select") + (enableFeature withCurl "clickhouse") + (enableFeature false "debug") + (enableFeature false "debug-symbols") + (enableFeature true "debugless") + (enableFeature false "valgrind") + (enableFeature false "diagtools") + (enableFeature withCurl "fmhttp") + (enableFeature true "usertools") + (enableFeature withMysql "mysql") + (enableFeature withPostgres "pgsql") + (enableFeature withDbi "libdbi") + (enableFeature withNetSnmp "snmp") + (enableFeature withUuid "uuid") + (enableFeature withCurl "elasticsearch") + (enableFeature withGnutls "gnutls") + (enableFeature withGcrypt "libgcrypt") + (enableFeature true "rsyslogrt") + (enableFeature true "rsyslogd") + (enableFeature true "mail") + (enableFeature withLognorm "mmnormalize") + (enableFeature withMaxminddb "mmdblookup") + (enableFeature true "mmjsonparse") + (enableFeature true "mmaudit") + (enableFeature true "mmanon") + (enableFeature true "mmutf8fix") + (enableFeature true "mmcount") + (enableFeature true "mmsequence") + (enableFeature true "mmfields") + (enableFeature true "mmpstrucdata") + (enableFeature withOpenssl "mmrfc5424addhmac") + (enableFeature withRelp "relp") + (enableFeature withKsi "ksi-ls12") + (enableFeature withLogging "liblogging-stdlog") + (enableFeature withLogging "rfc3195") + (enableFeature true "imfile") + (enableFeature false "imsolaris") + (enableFeature true "imptcp") + (enableFeature true "impstats") + (enableFeature true "omprog") + (enableFeature withNet "omudpspoof") + (enableFeature true "omstdout") + (enableFeature withSystemd "omjournal") + (enableFeature true "pmlastmsg") + (enableFeature true "pmcisconames") + (enableFeature true "pmciscoios") + (enableFeature true "pmaixforwardedfrom") + (enableFeature true "pmsnare") + (enableFeature true "omruleset") + (enableFeature true "omuxsock") + (enableFeature true "mmsnmptrapd") + (enableFeature withHadoop "omhdfs") + (enableFeature withRdkafka "omkafka") + (enableFeature withMongo "ommongodb") + (enableFeature withCzmq "imczmq") + (enableFeature withCzmq "omczmq") + (enableFeature withRabbitmq "omrabbitmq") + (enableFeature withHiredis "omhiredis") + (enableFeature withCurl "omhttp") + (enableFeature true "generate-man-pages") ]; passthru.tests = { nixos-rsyslogd = nixosTests.rsyslogd; }; - meta = { + meta = with lib; { homepage = "https://www.rsyslog.com/"; description = "Enhanced syslog implementation"; changelog = "https://raw.githubusercontent.com/rsyslog/rsyslog/v${version}/ChangeLog"; license = licenses.gpl3; platforms = platforms.linux; + maintainers = with maintainers; [ ]; }; } diff --git a/pkgs/tools/system/rsyslog/fix-gnutls-detection.patch b/pkgs/tools/system/rsyslog/fix-gnutls-detection.patch deleted file mode 100644 index c8955ea57dc0..000000000000 --- a/pkgs/tools/system/rsyslog/fix-gnutls-detection.patch +++ /dev/null @@ -1,60 +0,0 @@ -From 588b4ca7412326abd51a5b2060eafbc04611e419 Mon Sep 17 00:00:00 2001 -From: Radovan Sroka -Date: Tue, 11 Aug 2015 17:09:15 +0200 -Subject: [PATCH] Fix detection of the GnuTLS package - -This commit fixes a number of issues that cropped up from these changes: -23c5b3e replace deprecated GnuTLS functions with newer ones if available -88f0651 bugfix: ommysql did not work when gnutls was enabled -ce560b6 build system: Failure action in AC_CHECK_LIB check for - -The solution is based on the assumption that the call to AC_CHECK_LIB() -was added purely to satisfy the subsequent calls to AC_CHECK_FUNCS(). -23c5b3e had the unintentional result of libgnutls being added to LIBS -and linked to undesired components. -The next commit removed libgnutls from LIBS which made the following -calls to AC_CHECK_FUNCS() nonfunctional. -Another commit made the processing not stop upon detecting a missing -component which, again, makes the calls to AC_CHECK_FUNCS() malfunction. - -The solution is to get rid of AC_CHECK_LIB() and temporarily override -LIBS for use by AC_CHECK_FUNCS(). ---- - configure.ac | 14 ++++---------- - 1 file changed, 4 insertions(+), 10 deletions(-) - -diff --git a/configure.ac b/configure.ac -index 6f82f0c..ba3f791 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -763,18 +763,13 @@ AC_ARG_ENABLE(gnutls, - if test "x$enable_gnutls" = "xyes"; then - PKG_CHECK_MODULES(GNUTLS, gnutls >= 1.4.0) - AC_DEFINE([ENABLE_GNUTLS], [1], [Indicator that GnuTLS is present]) -- AC_CHECK_LIB( -- [gnutls], -- [gnutls_global_init], -- [ -- AC_DEFINE(HAVE_LIB_GNUTLS, 1, [gnutls is available]) -- ], -- [AC_MSG_WARN([gnutls_global_init function missing or not detected])], -- [] -- ) -+ save_libs=$LIBS -+ LIBS="$LIBS $GNUTLS_LIBS" - AC_CHECK_FUNCS(gnutls_certificate_set_retrieve_function,,) - AC_CHECK_FUNCS(gnutls_certificate_type_set_priority,,) -+ LIBS=$save_libs - fi -+ - AM_CONDITIONAL(ENABLE_GNUTLS, test x$enable_gnutls = xyes) - - # libgcrypt support -@@ -1655,7 +1650,6 @@ else - AC_MSG_NOTICE([Not running from git source]) - fi - -- - AM_CONDITIONAL(ENABLE_GENERATE_MAN_PAGES, test x$have_to_generate_man_pages = xyes) - - # rst2man diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 99ca3ec35085..bab826ffe599 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -4649,34 +4649,35 @@ with pkgs; rsbep = callPackage ../tools/backup/rsbep { }; rsyslog = callPackage ../tools/system/rsyslog { - hadoop = null; # Currently Broken - libksi = null; # Currently Broken + withHadoop = false; # Currently Broken + withKsi = false; # Currently Broken }; rsyslog-light = rsyslog.override { - libkrb5 = null; - systemd = null; - jemalloc = null; - libmysqlclient = null; - postgresql = null; - libdbi = null; - net-snmp = null; - libuuid = null; - gnutls = null; - libgcrypt = null; - liblognorm = null; - openssl = null; - librelp = null; - libksi = null; - liblogging = null; - libnet = null; - hadoop = null; - rdkafka = null; - libmongo-client = null; - czmq = null; - rabbitmq-c = null; - hiredis = null; - libmaxminddb = null; + withKrb5 = false; + withSystemd = false; + withJemalloc = false; + withMysql = false; + withPostgres = false; + withDbi = false; + withNetSnmp = false; + withUuid = false; + withCurl = false; + withGnutls = false; + withGcrypt = false; + withLognorm = false; + withMaxminddb = false; + withOpenssl = false; + withRelp = false; + withKsi = false; + withLogging = false; + withNet = false; + withHadoop = false; + withRdkafka = false; + withMongo = false; + withCzmq = false; + withRabbitmq = false; + withHiredis = false; }; rtrtr = callPackage ../servers/rtrtr {