mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-28 18:03:04 +00:00
darwin: add libSystem
The new Darwin SDK pattern relies on an effectively empty, stub libc implementation. The actual libSystem to be linked is located dynamically based on the active SDK for the target. Independent build, host, and target SDKs are all supported by Darwin. The stub libSystem contains empty `include` and `lib` folders to avoid warnings from wrappers that add those paths unconditionally, which can turn into errors when a package is building with warnings-as-errors. While it would be nice if a fallback libc could be provided, SDK headers are not compatible between framework versions. Providing a fallback risks mixing headers from different frameworks, which can result in hard to diagnose errors involving semicolons or other punctuation.
This commit is contained in:
parent
40d415f4df
commit
5721c4fa47
13
pkgs/os-specific/darwin/libSystem/default.nix
Normal file
13
pkgs/os-specific/darwin/libSystem/default.nix
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
{ stdenvNoCC }:
|
||||||
|
|
||||||
|
# Darwin dynamically determines the `libSystem` to use based on the SDK found at `DEVELOPER_DIR`.
|
||||||
|
# By default, this will be `apple-sdk` or one of the versioned variants.
|
||||||
|
stdenvNoCC.mkDerivation {
|
||||||
|
pname = "libSystem";
|
||||||
|
version = "B";
|
||||||
|
|
||||||
|
# Silence linker warnings due a missing `lib` (which is added by cc-wrapper).
|
||||||
|
buildCommand = ''
|
||||||
|
mkdir -p "$out/include" "$out/lib"
|
||||||
|
'';
|
||||||
|
}
|
@ -148,6 +148,8 @@ impure-cmds // appleSourcePackages // chooseLibs // {
|
|||||||
# Removes propagated packages from the stdenv, so those packages can be built without depending upon themselves.
|
# Removes propagated packages from the stdenv, so those packages can be built without depending upon themselves.
|
||||||
bootstrapStdenv = mkBootstrapStdenv pkgs.stdenv;
|
bootstrapStdenv = mkBootstrapStdenv pkgs.stdenv;
|
||||||
|
|
||||||
|
libSystem = callPackage ../os-specific/darwin/libSystem { };
|
||||||
|
|
||||||
# TODO(@connorbaker): See https://github.com/NixOS/nixpkgs/issues/229389.
|
# TODO(@connorbaker): See https://github.com/NixOS/nixpkgs/issues/229389.
|
||||||
cf-private = self.apple_sdk.frameworks.CoreFoundation;
|
cf-private = self.apple_sdk.frameworks.CoreFoundation;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user