From 8668fe03715ca1f58ec67b3fd7039f9035dcf9cb Mon Sep 17 00:00:00 2001 From: David McFarland Date: Tue, 19 Nov 2024 20:29:49 +0000 Subject: [PATCH] p4: fix darwin build (cherry picked from commit 0a54d674cb3bd708b34c6b76ee6fed2f0dfb19af) --- pkgs/applications/version-management/p4/default.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkgs/applications/version-management/p4/default.nix b/pkgs/applications/version-management/p4/default.nix index ec01f86a3af0..94bbd7cb0df9 100644 --- a/pkgs/applications/version-management/p4/default.nix +++ b/pkgs/applications/version-management/p4/default.nix @@ -62,7 +62,6 @@ stdenv.mkDerivation (finalAttrs: rec { ++ lib.optionals stdenv.hostPlatform.isLinux [ "-sOSVER=26" ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ "-sOSVER=1013" - "-sMACOSX_SDK=${emptyDirectory}" "-sLIBC++DIR=${lib.getLib stdenv.cc.libcxx}/lib" ]; @@ -81,6 +80,10 @@ stdenv.mkDerivation (finalAttrs: rec { (stdenv.cc.isClang || (stdenv.cc.isGNU && lib.versionAtLeast stdenv.cc.cc.version "11.0.0")) [ "-include" "limits" "-include" "thread" ]; + preBuild = lib.optionalString stdenv.hostPlatform.isDarwin '' + export MACOSX_SDK=$SDKROOT + ''; + buildPhase = '' runHook preBuild jam $jamFlags -j$NIX_BUILD_CORES p4