Unverified Commit 1bf92d39 authored by Franz Pletz's avatar Franz Pletz Committed by GitHub
Browse files

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

parents 258921d6 eda516d4
Loading
Loading
Loading
Loading
+33 −16
Original line number Diff line number Diff line
{ lib
, stdenv
, fetchFromGitHub
, cmake
, enableShared ? !stdenv.hostPlatform.isStatic
{
  lib,
  stdenv,
  fetchFromGitHub,
  cmake,
  enableShared ? !stdenv.hostPlatform.isStatic,

  # tests
, mpd
, openimageio
, fcitx5
, spdlog
  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=";
  };
}
+81 −49
Original line number Diff line number Diff line
{ 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 = [
  cmakeFlags =
    [
      # pcre2 jit seems to cause crashes: https://github.com/NixOS/nixpkgs/pull/181908
      "-DENABLE_PCRE2=OFF"
      "-DDEBIAN_BUILD=ON"
@@ -61,7 +87,8 @@ stdenv.mkDerivation rec {
      "-DSYSTEM_FMT=ON"
      "-DSYSTEM_XXHASH=ON"
      "-DSYSTEM_ZSTD=ON"
  ] ++ lib.optional withHyperscan "-DENABLE_HYPERSCAN=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;
  };
}
+1 −1
Original line number Diff line number Diff line
@@ -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;