Skip to content

Commit 5c4a4ae

Browse files
committed
Revert "remove obsolete stdenv darwinMinVersion override"
This reverts commit d91310b. > Some packages require setting a non-default deployment target > (or minimum version) to gain access to certain APIs. You do > that using the darwinMinVersionHook, which takes the deployment > target version as a parameter. -- https://github.com/NixOS/nixpkgs/blob/60b54c7aee3c0cefde72d1a151bb7d3a46361ca2/doc/stdenv/platform-notes.chapter.md#what-is-a-deployment-target-or-minimum-version-sec-darwin-troubleshooting-using-deployment-targets This will again solve error: ../nix_api_expr.cc:38:18: error: aligned allocation function of type 'void *(std::size_t, std::align_val_t)' is only available on macOS 10.13 or newer -- https://hydra.nixos.org/build/294088946
1 parent cb972c7 commit 5c4a4ae

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

flake.nix

+1-1
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@
171171
{
172172
otherSplices = final.generateSplicesForMkScope "nixDependencies";
173173
f = import ./packaging/dependencies.nix {
174-
inherit stdenv;
174+
inherit inputs stdenv;
175175
pkgs = final;
176176
};
177177
};

packaging/dependencies.nix

+19
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,33 @@
11
# These overrides are applied to the dependencies of the Nix components.
22

33
{
4+
# Flake inputs; used for sources
5+
inputs,
6+
47
# The raw Nixpkgs, not affected by this scope
58
pkgs,
69

710
stdenv,
811
}:
912

13+
let
14+
prevStdenv = stdenv;
15+
in
16+
1017
let
1118
inherit (pkgs) lib;
19+
20+
stdenv = if prevStdenv.isDarwin && prevStdenv.isx86_64 then darwinStdenv else prevStdenv;
21+
22+
# Fix the following error with the default x86_64-darwin SDK:
23+
#
24+
# error: aligned allocation function of type 'void *(std::size_t, std::align_val_t)' is only available on macOS 10.13 or newer
25+
#
26+
# Despite the use of the 10.13 deployment target here, the aligned
27+
# allocation function Clang uses with this setting actually works
28+
# all the way back to 10.6.
29+
darwinStdenv = pkgs.overrideSDK prevStdenv { darwinMinVersion = "10.13"; };
30+
1231
in
1332
scope: {
1433
inherit stdenv;

0 commit comments

Comments
 (0)