pytrainer: unpin python 3.10
[NixPkgs.git] / pkgs / servers / mail / rspamd / default.nix
blobea0768433325bb550b6e2b4a91ed5eee6ef01052
2   stdenv,
3   lib,
4   fetchFromGitHub,
5   cmake,
6   doctest,
7   fmt_11,
8   perl,
9   glib,
10   luajit,
11   openssl,
12   pcre,
13   pkg-config,
14   sqlite,
15   ragel,
16   icu,
17   hyperscan,
18   jemalloc,
19   blas,
20   lapack,
21   lua,
22   libsodium,
23   xxHash,
24   zstd,
25   libarchive,
26   withBlas ? true,
27   withHyperscan ? stdenv.hostPlatform.isx86_64,
28   withLuaJIT ? stdenv.hostPlatform.isx86_64,
29   nixosTests,
32 assert withHyperscan -> stdenv.hostPlatform.isx86_64;
34 stdenv.mkDerivation rec {
35   pname = "rspamd";
36   version = "3.10.2";
38   src = fetchFromGitHub {
39     owner = "rspamd";
40     repo = "rspamd";
41     rev = version;
42     hash = "sha256-x0Mw2ug5H6BZI6LKOjFufYzGVxZIkgxXHeIX7Emsj8A=";
43   };
45   hardeningEnable = [ "pie" ];
47   nativeBuildInputs = [
48     cmake
49     pkg-config
50     perl
51   ];
52   buildInputs =
53     [
54       doctest
55       fmt_11
56       glib
57       openssl
58       pcre
59       sqlite
60       ragel
61       icu
62       jemalloc
63       libsodium
64       xxHash
65       zstd
66       libarchive
67     ]
68     ++ lib.optional withHyperscan hyperscan
69     ++ lib.optionals withBlas [
70       blas
71       lapack
72     ]
73     ++ lib.optional withLuaJIT luajit
74     ++ lib.optional (!withLuaJIT) lua;
76   cmakeFlags =
77     [
78       # pcre2 jit seems to cause crashes: https://github.com/NixOS/nixpkgs/pull/181908
79       "-DENABLE_PCRE2=OFF"
80       "-DDEBIAN_BUILD=ON"
81       "-DRUNDIR=/run/rspamd"
82       "-DDBDIR=/var/lib/rspamd"
83       "-DLOGDIR=/var/log/rspamd"
84       "-DLOCAL_CONFDIR=/etc/rspamd"
85       "-DENABLE_JEMALLOC=ON"
86       "-DSYSTEM_DOCTEST=ON"
87       "-DSYSTEM_FMT=ON"
88       "-DSYSTEM_XXHASH=ON"
89       "-DSYSTEM_ZSTD=ON"
90     ]
91     ++ lib.optional withHyperscan "-DENABLE_HYPERSCAN=ON"
92     ++ lib.optional (!withLuaJIT) "-DENABLE_LUAJIT=OFF";
94   passthru.tests.rspamd = nixosTests.rspamd;
96   meta = with lib; {
97     homepage = "https://rspamd.com";
98     license = licenses.asl20;
99     description = "Advanced spam filtering system";
100     maintainers = with maintainers; [
101       avnik
102       fpletz
103       globin
104       lewo
105     ];
106     platforms = with platforms; linux;
107   };