2020-04-24 23:36:52 +00:00
|
|
|
{ stdenv, lib, fetchFromGitHub, cmake, perl
|
2021-02-05 17:12:51 +00:00
|
|
|
, glib, luajit, openssl, pcre, pkg-config, sqlite, ragel, icu
|
2020-04-24 23:36:52 +00:00
|
|
|
, hyperscan, jemalloc, blas, lapack, lua, libsodium
|
|
|
|
, withBlas ? true
|
|
|
|
, withHyperscan ? stdenv.isx86_64
|
|
|
|
, withLuaJIT ? stdenv.isx86_64
|
2020-10-27 00:29:36 +00:00
|
|
|
, nixosTests
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
assert withHyperscan -> stdenv.isx86_64;
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "rspamd";
|
2021-03-19 17:17:44 +00:00
|
|
|
version = "2.7";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "rspamd";
|
|
|
|
repo = "rspamd";
|
|
|
|
rev = version;
|
2021-03-19 17:17:44 +00:00
|
|
|
sha256 = "sha256-LMLRDnKfGpApVsIvPNY2nxl+H5+qeVvwvwr3wdyyhjs=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
nativeBuildInputs = [ cmake pkg-config perl ];
|
2020-04-24 23:36:52 +00:00
|
|
|
buildInputs = [ glib openssl pcre sqlite ragel icu jemalloc libsodium ]
|
|
|
|
++ lib.optional withHyperscan hyperscan
|
|
|
|
++ lib.optionals withBlas [ blas lapack ]
|
|
|
|
++ lib.optional withLuaJIT luajit ++ lib.optional (!withLuaJIT) lua;
|
|
|
|
|
|
|
|
cmakeFlags = [
|
|
|
|
"-DDEBIAN_BUILD=ON"
|
|
|
|
"-DRUNDIR=/run/rspamd"
|
|
|
|
"-DDBDIR=/var/lib/rspamd"
|
|
|
|
"-DLOGDIR=/var/log/rspamd"
|
|
|
|
"-DLOCAL_CONFDIR=/etc/rspamd"
|
|
|
|
"-DENABLE_JEMALLOC=ON"
|
2020-11-19 00:13:47 +00:00
|
|
|
] ++ lib.optional withHyperscan "-DENABLE_HYPERSCAN=ON"
|
|
|
|
++ lib.optional (!withLuaJIT) "-DENABLE_LUAJIT=OFF";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-10-27 00:29:36 +00:00
|
|
|
passthru.tests.rspamd = nixosTests.rspamd;
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://rspamd.com";
|
|
|
|
license = licenses.asl20;
|
|
|
|
description = "Advanced spam filtering system";
|
|
|
|
maintainers = with maintainers; [ avnik fpletz globin ];
|
|
|
|
platforms = with platforms; linux;
|
|
|
|
};
|
|
|
|
}
|