From a26836327d397105a2a643f32e85f6125f260a64 Mon Sep 17 00:00:00 2001 From: Austin Horstman Date: Thu, 31 Oct 2024 09:33:29 -0500 Subject: [PATCH 1/3] sketchybar: switch to apple-sdk_11 --- pkgs/by-name/sk/sketchybar/package.nix | 30 +++++--------------------- 1 file changed, 5 insertions(+), 25 deletions(-) diff --git a/pkgs/by-name/sk/sketchybar/package.nix b/pkgs/by-name/sk/sketchybar/package.nix index e0e2a004e6d7..d422801b59c6 100644 --- a/pkgs/by-name/sk/sketchybar/package.nix +++ b/pkgs/by-name/sk/sketchybar/package.nix @@ -1,26 +1,15 @@ { lib, - overrideSDK, stdenv, - darwin, fetchFromGitHub, testers, nix-update-script, + apple-sdk_11, + darwinMinVersionHook, }: let inherit (stdenv.hostPlatform) system; - inherit (darwin.apple_sdk_11_0.frameworks) - AppKit - Carbon - CoreAudio - CoreWLAN - CoreVideo - DisplayServices - IOKit - MediaRemote - SkyLight - ; target = { @@ -28,10 +17,8 @@ let "x86_64-darwin" = "x86"; } .${system} or (throw "Unsupported system: ${system}"); - - stdenv' = if stdenv.hostPlatform.isDarwin then overrideSDK stdenv "11.0" else stdenv; in -stdenv'.mkDerivation (finalAttrs: { +stdenv.mkDerivation (finalAttrs: { pname = "sketchybar"; version = "2.21.0"; @@ -43,15 +30,8 @@ stdenv'.mkDerivation (finalAttrs: { }; buildInputs = [ - AppKit - Carbon - CoreAudio - CoreWLAN - CoreVideo - DisplayServices - IOKit - MediaRemote - SkyLight + apple-sdk_11 + (darwinMinVersionHook "10.13") ]; makeFlags = [ target ]; From 1278bdd300906bbc3d8ef0e688650fff6bb37aa7 Mon Sep 17 00:00:00 2001 From: Austin Horstman Date: Thu, 31 Oct 2024 18:38:01 -0500 Subject: [PATCH 2/3] sketchybar: add versionCheckHook Check version on build and skip calling --help since it doesn't return version. --- pkgs/by-name/sk/sketchybar/package.nix | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/pkgs/by-name/sk/sketchybar/package.nix b/pkgs/by-name/sk/sketchybar/package.nix index d422801b59c6..b08e4ca81607 100644 --- a/pkgs/by-name/sk/sketchybar/package.nix +++ b/pkgs/by-name/sk/sketchybar/package.nix @@ -2,10 +2,10 @@ lib, stdenv, fetchFromGitHub, - testers, nix-update-script, apple-sdk_11, darwinMinVersionHook, + versionCheckHook, }: let @@ -45,14 +45,11 @@ stdenv.mkDerivation (finalAttrs: { runHook postInstall ''; - passthru = { - tests.version = testers.testVersion { - package = finalAttrs.finalPackage; - version = "sketchybar-v${finalAttrs.version}"; - }; + passthru.updateScript = nix-update-script { }; - updateScript = nix-update-script { }; - }; + nativeInstallCheckInputs = [ versionCheckHook ]; + versionCheckProgramArg = "--version"; + doInstallCheck = true; meta = { description = "Highly customizable macOS status bar replacement"; From 52ba81f6c06e69f53922b9ee24dc1c68ee627d7b Mon Sep 17 00:00:00 2001 From: Austin Horstman Date: Thu, 31 Oct 2024 18:43:27 -0500 Subject: [PATCH 3/3] sketchybar: apple_sdk-11 -> apple_sdk-15 Upstream uses availability checks for different features. Lets not hold back functionality by building with latest SDK available. --- pkgs/by-name/sk/sketchybar/package.nix | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/pkgs/by-name/sk/sketchybar/package.nix b/pkgs/by-name/sk/sketchybar/package.nix index b08e4ca81607..c6c83ca298cd 100644 --- a/pkgs/by-name/sk/sketchybar/package.nix +++ b/pkgs/by-name/sk/sketchybar/package.nix @@ -3,8 +3,7 @@ stdenv, fetchFromGitHub, nix-update-script, - apple-sdk_11, - darwinMinVersionHook, + apple-sdk_15, versionCheckHook, }: @@ -30,8 +29,7 @@ stdenv.mkDerivation (finalAttrs: { }; buildInputs = [ - apple-sdk_11 - (darwinMinVersionHook "10.13") + apple-sdk_15 ]; makeFlags = [ target ];