Darwin uses the system unwinder, which is based on the LLVM unwinder.
While it’s mostly API-compatible with libunwind, some packages expect to
find it using `pkg-config`. This package provides a compatible file to
allow those packages to use the system unwinder on Darwin.
The patch adding support for `__ENVIRONMENT_OS_VERSION_MIN_REQUIRED__`
to clang has been backported to all versions of clang in nixpkgs (except
for clang 12), allowing this workaround to be dropped.
libsbuf is required by some of the source release updates that will
be done. Unfortunately, it is only available on macOS 14 and newer, and
there is no source release available currently.
This is a port of libsbuf from FreeBSD, which appears to be the origin
of the header provided in the 14.x SDK. It provides the same ABI as the
system dylib and same API as the the SDK header while being available on
all supported deployment targets in nixpkgs.
Note: This package is not based on libsbuf from the FreeBSD package set
in nixpkgs because: it doesn’t build on Darwin, and using it would pull
many FreeBSD packages into the Darwin bootstrap, which is undesirable.
This is a replacement for the family of `appleDerivation` functions
currently used. It is patterned after the `mkDerivation` used in the BSD
package sets. It also provides additional support for using Meson to
build source releases.
This hook is used by source releases that build with Meson to assert
that the Xcode project has not changed since the previous release. This
is meant to be a check to force those updating source release packages
to make sure they have incorporated any changes that were made to the
Xcode project into the Meson build.
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.
Adding the hook allows the deployment target to be changed without
having to mess with the stdenv. The can also be propagated, which is
useful for libraries that have a minimum deployment target higher than
the default in nixpkgs. In that case, they can propagate the hook to
ensure library users are not targeting an unsupported version.
Found with `fd \\.patch$ pkgs/ -x bash -c 'rg -F "{/}" pkgs/ -q || echo {}'``
We're running more and more into patches fetched via `applyPatches`, for the next PR i'll script something to account for that.
In preparation for the deprecation of `stdenv.isX`.
These shorthands are not conducive to cross-compilation because they
hide the platforms.
Darwin might get cross-compilation for which the continued usage of `stdenv.isDarwin` will get in the way
One example of why this is bad and especially affects compiler packages
https://www.github.com/NixOS/nixpkgs/pull/343059
There are too many files to go through manually but a treewide should
get users thinking when they see a `hostPlatform.isX` in a place where it
doesn't make sense.
```
fd --type f "\.nix" | xargs sd --fixed-strings "stdenv.is" "stdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "stdenv'.is" "stdenv'.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "clangStdenv.is" "clangStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "gccStdenv.is" "gccStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "stdenvNoCC.is" "stdenvNoCC.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "inherit (stdenv) is" "inherit (stdenv.hostPlatform) is"
fd --type f "\.nix" | xargs sd --fixed-strings "buildStdenv.is" "buildStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "effectiveStdenv.is" "effectiveStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "originalStdenv.is" "originalStdenv.hostPlatform.is"
```