Skip to content

Commit

Permalink
yabai: switch to apple-sdk_15
Browse files Browse the repository at this point in the history
Upstream uses __builtin._available checks for sdk features. We can
leverage the newer sdk to make sure we keep up with new features as they
are added since they are careful with version checks.
  • Loading branch information
khaneliman committed Oct 31, 2024
1 parent 846b05a commit 3242a36
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions pkgs/by-name/ya/yabai/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
xcodebuild,
xxd,
yabai,
apple-sdk_11,
apple-sdk_15,
darwinMinVersionHook,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "yabai";
Expand All @@ -30,7 +31,8 @@ stdenv.mkDerivation (finalAttrs: {
];

buildInputs = lib.optionals stdenv.hostPlatform.isx86_64 [
apple-sdk_11
(darwinMinVersionHook "11.0")
apple-sdk_15
];

dontConfigure = true;
Expand Down Expand Up @@ -58,12 +60,6 @@ stdenv.mkDerivation (finalAttrs: {
--replace-fail "-arch arm64e" "" \
--replace-fail "-arch arm64" "" \
--replace-fail "clang" "${stdenv.cc.targetPrefix}clang"
# `NSScreen::safeAreaInsets` is only available on macOS 12.0 and above, which frameworks aren't packaged.
# When a lower OS version is detected upstream just returns 0, so we can hardcode that at compile time.
# https://github.com/koekeishiya/yabai/blob/v4.0.2/src/workspace.m#L109
substituteInPlace src/workspace.m \
--replace-fail 'return screen.safeAreaInsets.top;' 'return 0;'
'';

passthru = {
Expand Down

0 comments on commit 3242a36

Please sign in to comment.