Unverified Commit d13b002d authored by Philip Taron's avatar Philip Taron Committed by GitHub
Browse files

mailutils: 3.19 -> 3.21 (#502793)

parents 0fdbbc47 fa7d824c
Loading
Loading
Loading
Loading
+16 −7
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@
  system-sendmail,
  libxcrypt,
  mkpasswd,
  nss_wrapper,

  pythonSupport ? true,
  guileSupport ? true,
@@ -32,11 +33,11 @@

stdenv.mkDerivation (finalAttrs: {
  pname = "mailutils";
  version = "3.19";
  version = "3.21";

  src = fetchurl {
    url = "mirror://gnu/mailutils/mailutils-${finalAttrs.version}.tar.xz";
    hash = "sha256-UCMNIANsW4rYyWsNmWF38fEz+6THx+O0YtOe6zCEn0U=";
    hash = "sha256-5Hwe3GmbjWZ1/bx32zqEroN/GOHyCU/inUi7WKl+9ek=";
  };

  separateDebugInfo = true;
@@ -82,11 +83,6 @@ stdenv.mkDerivation (finalAttrs: {
      url = "https://lists.gnu.org/archive/html/bug-mailutils/2020-11/txtiNjqcNpqOk.txt";
      hash = "sha256-2rhuopBANngq/PRCboIr+ewdawr8472cYwiLjtHCHz4=";
    })
    # Avoid hardeningDisable = [ "format" ]; - this patch is from the project's master branch and can be removed at the next version
    (fetchpatch {
      url = "https://cgit.git.savannah.gnu.org/cgit/mailutils.git/patch/?id=9379ec9e25ae6bdbd3d6f5ef9930ac2176d2efe7";
      hash = "sha256-00R1DLMDPsvz3R6UgRO1ZvgMNCiHYS3lfjqAC9VD+Y4=";
    })
    # https://github.com/NixOS/nixpkgs/issues/223967
    # https://lists.gnu.org/archive/html/bug-mailutils/2023-04/msg00000.html
    ./don-t-use-descrypt-password-in-the-test-suite.patch
@@ -117,8 +113,21 @@ stdenv.mkDerivation (finalAttrs: {
  nativeCheckInputs = [
    dejagnu
    mkpasswd
    nss_wrapper
  ];

  preCheck = ''
    # The nix sandbox's /etc/passwd has literal quotes around the home directory
    # (e.g. "/build" instead of /build). imap4d's mu_homedir_assert (new in
    # 3.21) calls stat() on this path, which fails because no directory named
    # '"/build"' exists. Use nss_wrapper to provide a fixed passwd to the tests.
    sed 's/"//g' /etc/passwd > "$TMPDIR/passwd"
    sed 's/"//g' /etc/group > "$TMPDIR/group" 2>/dev/null || echo "nixbld:x:100:" > "$TMPDIR/group"
    export LD_PRELOAD="${nss_wrapper}/lib/libnss_wrapper.so"
    export NSS_WRAPPER_PASSWD="$TMPDIR/passwd"
    export NSS_WRAPPER_GROUP="$TMPDIR/group"
  '';

  doCheck = !stdenv.hostPlatform.isDarwin; # ERROR: All 46 tests were run, 46 failed unexpectedly.

  meta = {