From 2b2be7f8a892e2de458b342a8551a11b954b323b Mon Sep 17 00:00:00 2001 From: Dimitar Nestorov <8790386+dimitarnestorov@users.noreply.github.com> Date: Sun, 5 Jan 2025 12:36:09 +0200 Subject: [PATCH] mactracker: add version check --- pkgs/by-name/ma/mactracker/package.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pkgs/by-name/ma/mactracker/package.nix b/pkgs/by-name/ma/mactracker/package.nix index 9ee5c07704cf2..430373fe90c58 100644 --- a/pkgs/by-name/ma/mactracker/package.nix +++ b/pkgs/by-name/ma/mactracker/package.nix @@ -9,6 +9,9 @@ libxml2, xmlstarlet, common-updater-scripts, + versionCheckHook, + writeShellScript, + xcbuild, }: stdenvNoCC.mkDerivation (finalAttrs: { @@ -53,6 +56,13 @@ stdenvNoCC.mkDerivation (finalAttrs: { ''; }); + nativeInstallCheckInputs = [ versionCheckHook ]; + versionCheckProgram = writeShellScript "version-check" '' + ${xcbuild}/bin/PlistBuddy -c "Print :CFBundleVersion" "$1" + ''; + versionCheckProgramArg = [ "${placeholder "out"}/Applications/Mactracker.app/Contents/Info.plist" ]; + doInstallCheck = true; + meta = { description = "Mactracker provides detailed information on every Apple Macintosh, iPod, iPhone, iPad, and Apple Watch ever made"; homepage = "https://mactracker.ca";