Unverified Commit 8474f557 authored by Franz Pletz's avatar Franz Pletz
Browse files

rspamd: build with vectorscan

parent 671f385b
Loading
Loading
Loading
Loading
+19 −22
Original line number Diff line number Diff line
@@ -14,7 +14,7 @@
  sqlite,
  ragel,
  icu,
  hyperscan,
  vectorscan,
  jemalloc,
  blas,
  lapack,
@@ -24,13 +24,10 @@
  zstd,
  libarchive,
  withBlas ? true,
  withHyperscan ? stdenv.hostPlatform.isx86_64,
  withLuaJIT ? stdenv.hostPlatform.isx86_64,
  nixosTests,
}:

assert withHyperscan -> stdenv.hostPlatform.isx86_64;

stdenv.mkDerivation rec {
  pname = "rspamd";
  version = "3.11.0";
@@ -48,7 +45,9 @@ stdenv.mkDerivation rec {
    cmake
    pkg-config
    perl
    ragel
  ];

  buildInputs =
    [
      doctest
@@ -64,8 +63,8 @@ stdenv.mkDerivation rec {
      xxHash
      zstd
      libarchive
      vectorscan
    ]
    ++ lib.optional withHyperscan hyperscan
    ++ lib.optionals withBlas [
      blas
      lapack
@@ -73,8 +72,7 @@ stdenv.mkDerivation rec {
    ++ lib.optional withLuaJIT luajit
    ++ lib.optional (!withLuaJIT) lua;

  cmakeFlags =
    [
  cmakeFlags = [
    # pcre2 jit seems to cause crashes: https://github.com/NixOS/nixpkgs/pull/181908
    "-DENABLE_PCRE2=OFF"
    "-DDEBIAN_BUILD=ON"
@@ -87,9 +85,8 @@ stdenv.mkDerivation rec {
    "-DSYSTEM_FMT=ON"
    "-DSYSTEM_XXHASH=ON"
    "-DSYSTEM_ZSTD=ON"
    ]
    ++ lib.optional withHyperscan "-DENABLE_HYPERSCAN=ON"
    ++ lib.optional (!withLuaJIT) "-DENABLE_LUAJIT=OFF";
    "-DENABLE_HYPERSCAN=ON"
  ] ++ lib.optional (!withLuaJIT) "-DENABLE_LUAJIT=OFF";

  passthru.tests.rspamd = nixosTests.rspamd;