2023-08-22 20:05:09 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, cmake
|
2024-06-05 15:53:02 +00:00
|
|
|
, doctest
|
|
|
|
, fmt
|
2023-08-22 20:05:09 +00:00
|
|
|
, perl
|
|
|
|
, glib
|
|
|
|
, luajit
|
|
|
|
, openssl
|
|
|
|
, pcre
|
|
|
|
, pkg-config
|
|
|
|
, sqlite
|
|
|
|
, ragel
|
|
|
|
, icu
|
|
|
|
, hyperscan
|
|
|
|
, jemalloc
|
|
|
|
, blas
|
|
|
|
, lapack
|
|
|
|
, lua
|
|
|
|
, libsodium
|
2024-06-05 15:53:02 +00:00
|
|
|
, xxHash
|
|
|
|
, zstd
|
2020-04-24 23:36:52 +00:00
|
|
|
, 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";
|
2024-02-29 20:09:43 +00:00
|
|
|
version = "3.8.4";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "rspamd";
|
|
|
|
repo = "rspamd";
|
|
|
|
rev = version;
|
2024-02-29 20:09:43 +00:00
|
|
|
hash = "sha256-3skF+aQv8Y3ATujV+WH4DxwyQ2hXR6CDZz77CkaRso0=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-05-29 03:34:57 +00:00
|
|
|
hardeningEnable = [ "pie" ];
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
nativeBuildInputs = [ cmake pkg-config perl ];
|
2024-06-05 15:53:02 +00:00
|
|
|
buildInputs = [ doctest fmt glib openssl pcre sqlite ragel icu jemalloc libsodium xxHash zstd ]
|
2020-04-24 23:36:52 +00:00
|
|
|
++ lib.optional withHyperscan hyperscan
|
|
|
|
++ lib.optionals withBlas [ blas lapack ]
|
|
|
|
++ lib.optional withLuaJIT luajit ++ lib.optional (!withLuaJIT) lua;
|
|
|
|
|
|
|
|
cmakeFlags = [
|
2022-07-18 16:21:45 +00:00
|
|
|
# pcre2 jit seems to cause crashes: https://github.com/NixOS/nixpkgs/pull/181908
|
|
|
|
"-DENABLE_PCRE2=OFF"
|
2020-04-24 23:36:52 +00:00
|
|
|
"-DDEBIAN_BUILD=ON"
|
|
|
|
"-DRUNDIR=/run/rspamd"
|
|
|
|
"-DDBDIR=/var/lib/rspamd"
|
|
|
|
"-DLOGDIR=/var/log/rspamd"
|
|
|
|
"-DLOCAL_CONFDIR=/etc/rspamd"
|
|
|
|
"-DENABLE_JEMALLOC=ON"
|
2024-06-05 15:53:02 +00:00
|
|
|
"-DSYSTEM_DOCTEST=ON"
|
|
|
|
"-DSYSTEM_FMT=ON"
|
|
|
|
"-DSYSTEM_XXHASH=ON"
|
|
|
|
"-DSYSTEM_ZSTD=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";
|
2021-12-06 16:07:01 +00:00
|
|
|
maintainers = with maintainers; [ avnik fpletz globin lewo ];
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = with platforms; linux;
|
|
|
|
};
|
|
|
|
}
|