From 0b119a2d3c95dc87e9f66f2010deebbf0387ecca Mon Sep 17 00:00:00 2001 From: Mario Rodas Date: Fri, 17 Nov 2023 04:20:00 +0000 Subject: [PATCH] mailpit: fix build on darwin --- pkgs/servers/mail/mailpit/default.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkgs/servers/mail/mailpit/default.nix b/pkgs/servers/mail/mailpit/default.nix index baf15dce13e9..cfc71d0c24a4 100644 --- a/pkgs/servers/mail/mailpit/default.nix +++ b/pkgs/servers/mail/mailpit/default.nix @@ -34,6 +34,12 @@ let hash = "sha256-r4yv2qImIlNMPJagz5i1sxqBDnFAucc2kDUmjGktM6A="; }; + env = lib.optionalAttrs (stdenv.isDarwin && stdenv.isx86_64) { + # Make sure libc++ uses `posix_memalign` instead of `aligned_alloc` on x86_64-darwin. + # Otherwise, nodejs would require the 11.0 SDK and macOS 10.15+. + NIX_CFLAGS_COMPILE = "-D__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__=101300"; + }; + nativeBuildInputs = [ nodejs python3 libtool npmHooks.npmConfigHook ]; buildPhase = ''