From 3242a364e60b05d677130b200271440ea82a9cd0 Mon Sep 17 00:00:00 2001 From: Austin Horstman Date: Thu, 31 Oct 2024 10:32:30 -0500 Subject: [PATCH] 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. --- pkgs/by-name/ya/yabai/package.nix | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/pkgs/by-name/ya/yabai/package.nix b/pkgs/by-name/ya/yabai/package.nix index d691968aa57b..8972b1c320f0 100644 --- a/pkgs/by-name/ya/yabai/package.nix +++ b/pkgs/by-name/ya/yabai/package.nix @@ -12,7 +12,8 @@ xcodebuild, xxd, yabai, - apple-sdk_11, + apple-sdk_15, + darwinMinVersionHook, }: stdenv.mkDerivation (finalAttrs: { pname = "yabai"; @@ -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; @@ -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 = {