Commit 3aa03ba2 authored by Olivier Marty's avatar Olivier Marty
Browse files

rspamd: add option to use hyperscan or vectorscan

parent b780ce5f
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -15,6 +15,7 @@
  ragel,
  fasttext,
  icu,
  hyperscan,
  vectorscan,
  jemalloc,
  blas,
@@ -27,10 +28,15 @@
  # Enabling blas support breaks bayes filter training from dovecot in nixos-mailserver tests
  # https://gitlab.com/simple-nixos-mailserver/nixos-mailserver/-/issues/321
  withBlas ? false,
  withHyperscan ? false,
  withLuaJIT ? stdenv.hostPlatform.isx86_64,
  withVectorscan ? true,
  nixosTests,
}:

assert withHyperscan -> stdenv.hostPlatform.isx86_64;
assert (!withHyperscan) || (!withVectorscan);

stdenv.mkDerivation rec {
  pname = "rspamd";
  version = "3.12.1";
@@ -66,14 +72,15 @@ stdenv.mkDerivation rec {
    xxHash
    zstd
    libarchive
    vectorscan
  ]
  ++ lib.optionals withBlas [
    blas
    lapack
  ]
  ++ lib.optional withHyperscan hyperscan
  ++ lib.optional withLuaJIT luajit
  ++ lib.optional (!withLuaJIT) lua;
  ++ lib.optional (!withLuaJIT) lua
  ++ lib.optional withVectorscan vectorscan;

  cmakeFlags = [
    # pcre2 jit seems to cause crashes: https://github.com/NixOS/nixpkgs/pull/181908