diff --git a/pkgs/servers/mail/rspamd/default.nix b/pkgs/servers/mail/rspamd/default.nix index dd34e5cc2a62..ecd037fd4967 100644 --- a/pkgs/servers/mail/rspamd/default.nix +++ b/pkgs/servers/mail/rspamd/default.nix @@ -1,30 +1,31 @@ -{ stdenv -, lib -, fetchFromGitHub -, cmake -, doctest -, fmt -, perl -, glib -, luajit -, openssl -, pcre -, pkg-config -, sqlite -, ragel -, icu -, hyperscan -, jemalloc -, blas -, lapack -, lua -, libsodium -, xxHash -, zstd -, withBlas ? true -, withHyperscan ? stdenv.isx86_64 -, withLuaJIT ? stdenv.isx86_64 -, nixosTests +{ + stdenv, + lib, + fetchFromGitHub, + cmake, + doctest, + fmt, + perl, + glib, + luajit, + openssl, + pcre, + pkg-config, + sqlite, + ragel, + icu, + hyperscan, + jemalloc, + blas, + lapack, + lua, + libsodium, + xxHash, + zstd, + withBlas ? true, + withHyperscan ? stdenv.isx86_64, + withLuaJIT ? stdenv.isx86_64, + nixosTests, }: assert withHyperscan -> stdenv.isx86_64; @@ -42,27 +43,51 @@ stdenv.mkDerivation rec { hardeningEnable = [ "pie" ]; - nativeBuildInputs = [ cmake pkg-config perl ]; - buildInputs = [ doctest fmt glib openssl pcre sqlite ragel icu jemalloc libsodium xxHash zstd ] + nativeBuildInputs = [ + cmake + pkg-config + perl + ]; + buildInputs = + [ + doctest + fmt + glib + openssl + pcre + sqlite + ragel + icu + jemalloc + libsodium + xxHash + zstd + ] ++ lib.optional withHyperscan hyperscan - ++ lib.optionals withBlas [ blas lapack ] - ++ lib.optional withLuaJIT luajit ++ lib.optional (!withLuaJIT) lua; + ++ lib.optionals withBlas [ + blas + lapack + ] + ++ lib.optional withLuaJIT luajit + ++ lib.optional (!withLuaJIT) lua; - cmakeFlags = [ - # pcre2 jit seems to cause crashes: https://github.com/NixOS/nixpkgs/pull/181908 - "-DENABLE_PCRE2=OFF" - "-DDEBIAN_BUILD=ON" - "-DRUNDIR=/run/rspamd" - "-DDBDIR=/var/lib/rspamd" - "-DLOGDIR=/var/log/rspamd" - "-DLOCAL_CONFDIR=/etc/rspamd" - "-DENABLE_JEMALLOC=ON" - "-DSYSTEM_DOCTEST=ON" - "-DSYSTEM_FMT=ON" - "-DSYSTEM_XXHASH=ON" - "-DSYSTEM_ZSTD=ON" - ] ++ lib.optional withHyperscan "-DENABLE_HYPERSCAN=ON" - ++ lib.optional (!withLuaJIT) "-DENABLE_LUAJIT=OFF"; + cmakeFlags = + [ + # pcre2 jit seems to cause crashes: https://github.com/NixOS/nixpkgs/pull/181908 + "-DENABLE_PCRE2=OFF" + "-DDEBIAN_BUILD=ON" + "-DRUNDIR=/run/rspamd" + "-DDBDIR=/var/lib/rspamd" + "-DLOGDIR=/var/log/rspamd" + "-DLOCAL_CONFDIR=/etc/rspamd" + "-DENABLE_JEMALLOC=ON" + "-DSYSTEM_DOCTEST=ON" + "-DSYSTEM_FMT=ON" + "-DSYSTEM_XXHASH=ON" + "-DSYSTEM_ZSTD=ON" + ] + ++ lib.optional withHyperscan "-DENABLE_HYPERSCAN=ON" + ++ lib.optional (!withLuaJIT) "-DENABLE_LUAJIT=OFF"; passthru.tests.rspamd = nixosTests.rspamd; @@ -70,7 +95,12 @@ stdenv.mkDerivation rec { homepage = "https://rspamd.com"; license = licenses.asl20; description = "Advanced spam filtering system"; - maintainers = with maintainers; [ avnik fpletz globin lewo ]; + maintainers = with maintainers; [ + avnik + fpletz + globin + lewo + ]; platforms = with platforms; linux; }; }