Merge pull request #326829 from fpletz/pkgs/rspamd-3.9.0

This commit is contained in:
Franz Pletz 2024-07-15 15:45:45 +02:00 committed by GitHub
commit 1bf92d3987
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 115 additions and 66 deletions

View File

@ -1,23 +1,32 @@
{ lib
, stdenv
, fetchFromGitHub
, cmake
, enableShared ? !stdenv.hostPlatform.isStatic
{
lib,
stdenv,
fetchFromGitHub,
cmake,
enableShared ? !stdenv.hostPlatform.isStatic,
# tests
, mpd
, openimageio
, fcitx5
, spdlog
# tests
mpd,
openimageio,
fcitx5,
spdlog,
}:
let
generic = { version, sha256, patches ? [ ] }:
generic =
{
version,
sha256,
patches ? [ ],
}:
stdenv.mkDerivation {
pname = "fmt";
inherit version;
outputs = [ "out" "dev" ];
outputs = [
"out"
"dev"
];
src = fetchFromGitHub {
owner = "fmtlib";
@ -30,14 +39,17 @@ let
nativeBuildInputs = [ cmake ];
cmakeFlags = [
"-DBUILD_SHARED_LIBS=${if enableShared then "ON" else "OFF"}"
];
cmakeFlags = [ "-DBUILD_SHARED_LIBS=${if enableShared then "ON" else "OFF"}" ];
doCheck = true;
passthru.tests = {
inherit mpd openimageio fcitx5 spdlog;
inherit
mpd
openimageio
fcitx5
spdlog
;
};
meta = with lib; {
@ -70,4 +82,9 @@ in
version = "10.2.1";
sha256 = "sha256-pEltGLAHLZ3xypD/Ur4dWPWJ9BGVXwqQyKcDWVmC3co=";
};
fmt_11 = generic {
version = "11.0.1";
sha256 = "sha256-EPidbZxCvysrL64AzbpJDowiNxqy4ii+qwSWAFwf/Ps=";
};
}

View File

@ -1,68 +1,95 @@
{ 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_11,
perl,
glib,
luajit,
openssl,
pcre,
pkg-config,
sqlite,
ragel,
icu,
hyperscan,
jemalloc,
blas,
lapack,
lua,
libsodium,
xxHash,
zstd,
libarchive,
withBlas ? true,
withHyperscan ? stdenv.isx86_64,
withLuaJIT ? stdenv.isx86_64,
nixosTests,
}:
assert withHyperscan -> stdenv.isx86_64;
stdenv.mkDerivation rec {
pname = "rspamd";
version = "3.8.4";
version = "3.9.0";
src = fetchFromGitHub {
owner = "rspamd";
repo = "rspamd";
rev = version;
hash = "sha256-3skF+aQv8Y3ATujV+WH4DxwyQ2hXR6CDZz77CkaRso0=";
hash = "sha256-PCogHnes3/8qqdcqsiUzuVVEUf8+ze3xiYUmfe6L3IU=";
};
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_11
glib
openssl
pcre
sqlite
ragel
icu
jemalloc
libsodium
xxHash
zstd
libarchive
]
++ 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 +97,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;
};
}

View File

@ -20488,7 +20488,7 @@ with pkgs;
flyway = callPackage ../development/tools/flyway { };
inherit (callPackages ../development/libraries/fmt { }) fmt_8 fmt_9 fmt_10;
inherit (callPackages ../development/libraries/fmt { }) fmt_8 fmt_9 fmt_10 fmt_11;
fmt = fmt_10;