From 3b4bd6019304d5c1a52078aabfd2f336458da717 Mon Sep 17 00:00:00 2001 From: ghpzin Date: Sun, 21 Sep 2025 02:42:44 +0300 Subject: [PATCH] mailutils: fix build with gcc15 - add patch from archlinux fixing `incompatible-pointer-types` error: https://gitlab.archlinux.org/archlinux/packaging/packages/mailutils/-/raw/87c3614083260f52dd1222e872a1836f0ff9abe1/fix-build.patch Upstream issues: https://lists.gnu.org/archive/html/bug-mailutils/2025-06/msg00000.html https://lists.gnu.org/archive/html/bug-mailutils/2025-09/msg00000.html Fixes build failure with gcc15: ``` progmailer.c: In function 'mu_progmailer_create': progmailer.c:63:18: error: assignment to 'void (*)(void)' from incompatible pointer type 'void (*)(int)' [-Wincompatible-pointer-types] 63 | pm->sighandler = SIG_ERR; | ^ progmailer.c: In function 'mu_progmailer_open': progmailer.c:116:23: error: assignment to 'void (*)(void)' from incompatible pointer type '__sighandler_t' {aka 'void (*)(int)'} [-Wincompatible-pointer-types] 116 | if ((pm->sighandler = signal (SIGCHLD, SIG_DFL)) == SIG_ERR) | ^ In file included from progmailer.c:27: /nix/store/i1qha7him4faq593wwl1zmhg2pc6lz98-glibc-2.40-66-dev/include/signal.h:72:16: note: '__sighandler_t' declared here 72 | typedef void (*__sighandler_t) (int); | ^~~~~~~~~~~~~~ progmailer.c:116:52: warning: comparison of distinct pointer types lacks a cast [-Wcompare-distinct-pointer-types] 116 | if ((pm->sighandler = signal (SIGCHLD, SIG_DFL)) == SIG_ERR) | ^~ progmailer.c: In function 'mu_progmailer_close': progmailer.c:295:22: warning: comparison of distinct pointer types lacks a cast [-Wcompare-distinct-pointer-types] 295 | if (pm->sighandler != SIG_ERR | ^~ progmailer.c:296:29: error: passing argument 2 of 'signal' from incompatible pointer type [-Wincompatible-pointer-types] 296 | && signal (SIGCHLD, pm->sighandler) == SIG_ERR) | ~~^~~~~~~~~~~~ | | | void (*)(void) /nix/store/i1qha7him4faq593wwl1zmhg2pc6lz98-glibc-2.40-66-dev/include/signal.h:88:57: note: expected '__sighandler_t' {aka 'void (*)(int)'} but argument is of type 'void (*)(void)' 88 | extern __sighandler_t signal (int __sig, __sighandler_t __handler) | ~~~~~~~~~~~~~~~^~~~~~~~~ /nix/store/i1qha7him4faq593wwl1zmhg2pc6lz98-glibc-2.40-66-dev/include/signal.h:72:16: note: '__sighandler_t' declared here 72 | typedef void (*__sighandler_t) (int); | ^~~~~~~~~~~~~~ progmailer.c:302:18: error: assignment to 'void (*)(void)' from incompatible pointer type 'void (*)(int)' [-Wincompatible-pointer-types] 302 | pm->sighandler = SIG_ERR; | ^ ``` --- pkgs/by-name/ma/mailutils/package.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkgs/by-name/ma/mailutils/package.nix b/pkgs/by-name/ma/mailutils/package.nix index d70c39d7b8b5..f0d30309ee90 100644 --- a/pkgs/by-name/ma/mailutils/package.nix +++ b/pkgs/by-name/ma/mailutils/package.nix @@ -90,6 +90,13 @@ stdenv.mkDerivation (finalAttrs: { # 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 + # Fix build with gcc15 + # https://lists.gnu.org/archive/html/bug-mailutils/2025-06/msg00000.html + (fetchpatch { + name = "mailutils-fix-sighandler-incompatible-pointer-types-gcc15.patch"; + url = "https://gitlab.archlinux.org/archlinux/packaging/packages/mailutils/-/raw/87c3614083260f52dd1222e872a1836f0ff9abe1/fix-build.patch"; + hash = "sha256-RN62l5mYqtViEjXpAlQKWhFez1TPynRMj/1nvZkq5Gs="; + }) ]; enableParallelBuilding = true;