about summary refs log tree commit diff
path: root/pkgs/by-name/st/stalwart-mail/package.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/by-name/st/stalwart-mail/package.nix')
-rw-r--r--pkgs/by-name/st/stalwart-mail/package.nix95
1 files changed, 73 insertions, 22 deletions
diff --git a/pkgs/by-name/st/stalwart-mail/package.nix b/pkgs/by-name/st/stalwart-mail/package.nix
index abb197c6c70eb..8ed6c8386666c 100644
--- a/pkgs/by-name/st/stalwart-mail/package.nix
+++ b/pkgs/by-name/st/stalwart-mail/package.nix
@@ -1,18 +1,20 @@
-{ lib
-, rustPlatform
-, fetchFromGitHub
-, fetchpatch
-, pkg-config
-, protobuf
-, bzip2
-, openssl
-, sqlite
-, zstd
-, stdenv
-, darwin
-, nix-update-script
-, nixosTests
-, rocksdb_8_11
+{
+  lib,
+  rustPlatform,
+  fetchFromGitHub,
+  fetchpatch,
+  pkg-config,
+  protobuf,
+  bzip2,
+  openssl,
+  sqlite,
+  foundationdb,
+  zstd,
+  stdenv,
+  darwin,
+  nix-update-script,
+  nixosTests,
+  rocksdb_8_11,
 }:
 
 let
@@ -23,7 +25,7 @@ let
   # See upstream issue for rocksdb 9.X support
   # https://github.com/stalwartlabs/mail-server/issues/407
   rocksdb = rocksdb_8_11;
-  version = "0.8.3";
+  version = "0.9.1";
 in
 rustPlatform.buildRustPackage {
   pname = "stalwart-mail";
@@ -32,12 +34,12 @@ rustPlatform.buildRustPackage {
   src = fetchFromGitHub {
     owner = "stalwartlabs";
     repo = "mail-server";
-    rev = "v${version}";
-    hash = "sha256-zaEe7/qQOz+kco8Fo4d9xx/v6PZarjEMTSXO0nDxxh0=";
+    rev = "refs/tags/v${version}";
+    hash = "sha256-7a2Vrrjo4Qd62dneQr3Xl2+HVUIfLa9AnGXEt2RWWZY=";
     fetchSubmodules = true;
   };
 
-  cargoHash = "sha256-/B1O7Tvj/CfRKPmnHxl+I4eNCT8sx75l8z/1JBXpPks=";
+  cargoHash = "sha256-sAma3T9X9N8UjJ4leePIa6gvqpKW2QkpzYaIAFWLeVc=";
 
   patches = [
     # Remove "PermissionsStartOnly" from systemd service files,
@@ -59,6 +61,7 @@ rustPlatform.buildRustPackage {
     bzip2
     openssl
     sqlite
+    foundationdb
     zstd
   ] ++ lib.optionals stdenv.isDarwin [
     darwin.apple_sdk.frameworks.CoreFoundation
@@ -84,8 +87,56 @@ rustPlatform.buildRustPackage {
       --replace "__PATH__" "$out"
   '';
 
-  # Tests require reading to /etc/resolv.conf
-  doCheck = false;
+  checkFlags = [
+    # Require running mysql, postgresql daemon
+    "--skip=directory::imap::imap_directory"
+    "--skip=directory::internal::internal_directory"
+    "--skip=directory::ldap::ldap_directory"
+    "--skip=directory::sql::sql_directory"
+    "--skip=store::blob::blob_tests"
+    "--skip=store::lookup::lookup_tests"
+    # thread 'directory::smtp::lmtp_directory' panicked at tests/src/store/mod.rs:122:44:
+    # called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "No such file or directory" }
+    "--skip=directory::smtp::lmtp_directory"
+    # thread 'imap::imap_tests' panicked at tests/src/imap/mod.rs:436:14:
+    # Missing store type. Try running `STORE=<store_type> cargo test`: NotPresent
+    "--skip=imap::imap_tests"
+    # thread 'jmap::jmap_tests' panicked at tests/src/jmap/mod.rs:303:14:
+    # Missing store type. Try running `STORE=<store_type> cargo test`: NotPresent
+    "--skip=jmap::jmap_tests"
+    # Failed to read system DNS config: io error: No such file or directory (os error 2)
+    "--skip=smtp::inbound::data::data"
+    # Expected "X-My-Header: true" but got Received: from foobar.net (unknown [10.0.0.123])
+    "--skip=smtp::inbound::scripts::sieve_scripts"
+    # panicked at tests/src/smtp/outbound/smtp.rs:173:5:
+    "--skip=smtp::outbound::smtp::smtp_delivery"
+    # thread 'smtp::queue::retry::queue_retry' panicked at tests/src/smtp/queue/retry.rs:119:5:
+    # assertion `left == right` failed
+    #   left: [1, 2, 2]
+    #  right: [1, 2, 3]
+    "--skip=smtp::queue::retry::queue_retry"
+    # Missing store type. Try running `STORE=<store_type> cargo test`: NotPresent
+    "--skip=store::store_tests"
+    # thread 'config::parser::tests::toml_parse' panicked at crates/utils/src/config/parser.rs:463:58:
+    # called `Result::unwrap()` on an `Err` value: "Expected ['\\n'] but found '!' in value at line 70."
+    "--skip=config::parser::tests::toml_parse"
+    # error[E0432]: unresolved import `r2d2_sqlite`
+    # use of undeclared crate or module `r2d2_sqlite`
+    "--skip=backend::sqlite::pool::SqliteConnectionManager::with_init"
+    # thread 'smtp::reporting::analyze::report_analyze' panicked at tests/src/smtp/reporting/analyze.rs:88:5:
+    # assertion `left == right` failed
+    #   left: 0
+    #  right: 12
+    "--skip=smtp::reporting::analyze::report_analyze"
+    # thread 'smtp::inbound::dmarc::dmarc' panicked at tests/src/smtp/inbound/mod.rs:59:26:
+    # Expected empty queue but got Reload
+    "--skip=smtp::inbound::dmarc::dmarc"
+    # thread 'smtp::queue::concurrent::concurrent_queue' panicked at tests/src/smtp/inbound/mod.rs:65:9:
+    # assertion `left == right` failed
+    "--skip=smtp::queue::concurrent::concurrent_queue"
+  ];
+
+  doCheck = !(stdenv.isLinux && stdenv.isAarch64);
 
   passthru = {
     update-script = nix-update-script { };
@@ -97,6 +148,6 @@ rustPlatform.buildRustPackage {
     homepage = "https://github.com/stalwartlabs/mail-server";
     changelog = "https://github.com/stalwartlabs/mail-server/blob/${version}/CHANGELOG";
     license = licenses.agpl3Only;
-    maintainers = with maintainers; [ happysalada onny ];
+    maintainers = with maintainers; [ happysalada onny oddlama ];
   };
 }