Skip to content

Commit 88eb0fc

Browse files
committed
yabai: switch to apple-sdk_15
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.
1 parent 4457d95 commit 88eb0fc

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

pkgs/by-name/ya/yabai/package.nix

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
jq,
1212
xxd,
1313
yabai,
14-
apple-sdk_11,
14+
apple-sdk_15,
1515
}:
1616
stdenv.mkDerivation (finalAttrs: {
1717
pname = "yabai";
@@ -33,7 +33,7 @@ stdenv.mkDerivation (finalAttrs: {
3333
];
3434

3535
buildInputs = lib.optionals stdenv.hostPlatform.isx86_64 [
36-
apple-sdk_11
36+
apple-sdk_15
3737
];
3838

3939
dontConfigure = true;
@@ -58,15 +58,9 @@ stdenv.mkDerivation (finalAttrs: {
5858
# aarch64 code is compiled on all targets, which causes our Apple SDK headers to error out.
5959
# Since multilib doesn't work on darwin i dont know of a better way of handling this.
6060
substituteInPlace makefile \
61-
--replace "-arch arm64e" "" \
62-
--replace "-arch arm64" "" \
63-
--replace "clang" "${stdenv.cc.targetPrefix}clang"
64-
65-
# `NSScreen::safeAreaInsets` is only available on macOS 12.0 and above, which frameworks aren't packaged.
66-
# When a lower OS version is detected upstream just returns 0, so we can hardcode that at compile time.
67-
# https://github.com/koekeishiya/yabai/blob/v4.0.2/src/workspace.m#L109
68-
substituteInPlace src/workspace.m \
69-
--replace 'return screen.safeAreaInsets.top;' 'return 0;'
61+
--replace-fail "-arch arm64e" "" \
62+
--replace-fail "-arch arm64" "" \
63+
--replace-fail "clang" "${stdenv.cc.targetPrefix}clang"
7064
'';
7165

7266
passthru = {

0 commit comments

Comments
 (0)