From a37e330ff33ad5d80a011331baed2abdf9ed5e68 Mon Sep 17 00:00:00 2001 From: Theodore Ni <3806110+tjni@users.noreply.github.com> Date: Sat, 2 Nov 2024 00:01:16 -0700 Subject: [PATCH] bftpd: fix x86_64-darwin build --- pkgs/servers/ftp/bftpd/default.nix | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/pkgs/servers/ftp/bftpd/default.nix b/pkgs/servers/ftp/bftpd/default.nix index 895e3cd063fc..b244bec5fddc 100644 --- a/pkgs/servers/ftp/bftpd/default.nix +++ b/pkgs/servers/ftp/bftpd/default.nix @@ -9,10 +9,15 @@ stdenv.mkDerivation rec { sha256 = "sha256-lZGFsUV6LNjkBNUpV9UYedVt1yt1qTBJUorxGt4ApsI="; }; - # utmp.h is deprecated on aarch64-darwin - postPatch = lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) '' + # utmp has been replaced by utmpx since Mac OS X 10.6 (Snow Leopard): + # + # https://stackoverflow.com/a/37913019 + # + # bftpd does not have support for this, so disable it. + # + postPatch = lib.optionalString stdenv.hostPlatform.isDarwin '' for file in login.*; do - substituteInPlace $file --replace "#ifdef HAVE_UTMP_H" "#if 0" + substituteInPlace $file --replace-fail "#ifdef HAVE_UTMP_H" "#if 0" done '';