From 3aa03ba2fcf006adb93fa5df9cae3fd2005dbaa0 Mon Sep 17 00:00:00 2001 From: Olivier Marty Date: Tue, 16 Sep 2025 10:59:47 +0200 Subject: [PATCH] rspamd: add option to use hyperscan or vectorscan --- pkgs/by-name/rs/rspamd/package.nix | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/rs/rspamd/package.nix b/pkgs/by-name/rs/rspamd/package.nix index 709713a9bbb5..af18cd8ed5ce 100644 --- a/pkgs/by-name/rs/rspamd/package.nix +++ b/pkgs/by-name/rs/rspamd/package.nix @@ -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