Skip to content

Commit

Permalink
packaging: Set darwinMinVersion to fix x86_64-darwin build
Browse files Browse the repository at this point in the history
Ported from NixOS/nixpkgs#326172

Co-authored-by: Emily <vcs@emily.moe>
  • Loading branch information
2 people authored and domenkozar committed Sep 10, 2024
1 parent 03535d0 commit b4d43e1
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions packaging/dependencies.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,28 @@
versionSuffix,
}:

let
prevStdenv = stdenv;
in

let
inherit (pkgs) lib;

root = ../.;

stdenv = if prevStdenv.isDarwin && prevStdenv.isx86_64
then darwinStdenv
else prevStdenv;

# Fix the following error with the default x86_64-darwin SDK:
#
# error: aligned allocation function of type 'void *(std::size_t, std::align_val_t)' is only available on macOS 10.13 or newer
#
# Despite the use of the 10.13 deployment target here, the aligned
# allocation function Clang uses with this setting actually works
# all the way back to 10.6.
darwinStdenv = pkgs.overrideSDK prevStdenv { darwinMinVersion = "10.13"; };

# Nixpkgs implements this by returning a subpath into the fetched Nix sources.
resolvePath = p: p;

Expand Down

0 comments on commit b4d43e1

Please sign in to comment.