From 4dc9c3973f4905238a540b4d52e1d5525c47c837 Mon Sep 17 00:00:00 2001 From: Greg Pfeil Date: Thu, 6 Feb 2025 07:38:29 -0700 Subject: [PATCH] mas: 1.8.6 -> 1.9.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Notably, this switches back to the .pkg from the tarball, since mas-cli/mas#452 was fixed about three years ago (just after this package was last bumped) and tarballs are no longer published. Also, the Bash completion file isn’t included in the pkg (but it’s still in the repo). Here are the intervening release notes: - https://github.com/mas-cli/mas/releases/tag/v1.8.7 - https://github.com/mas-cli/mas/releases/tag/v1.8.8 - https://github.com/mas-cli/mas/releases/tag/v1.9.0 And the list of (almost 600) commits since the version currently in Nixpkgs: https://github.com/mas-cli/mas/compare/v1.8.6...v1.9.0 --- pkgs/by-name/ma/mas/package.nix | 35 ++++++++++++++++++++++++--------- 1 file changed, 26 insertions(+), 9 deletions(-) diff --git a/pkgs/by-name/ma/mas/package.nix b/pkgs/by-name/ma/mas/package.nix index 1926bf2547428..db4fa214b380e 100644 --- a/pkgs/by-name/ma/mas/package.nix +++ b/pkgs/by-name/ma/mas/package.nix @@ -2,27 +2,44 @@ lib, stdenvNoCC, fetchurl, - installShellFiles, + libarchive, + p7zip, testers, mas, }: stdenvNoCC.mkDerivation rec { pname = "mas"; - version = "1.8.6"; + version = "1.9.0"; src = fetchurl { - # Use the tarball until https://github.com/mas-cli/mas/issues/452 is fixed. - # Even though it looks like an OS/arch specific build it is actually a universal binary. - url = "https://github.com/mas-cli/mas/releases/download/v${version}/mas-${version}.monterey.bottle.tar.gz"; - sha256 = "0q4skdhymgn5xrwafyisfshx327faia682yv83mf68r61m2jl10d"; + url = "https://github.com/mas-cli/mas/releases/download/v${version}/mas-${version}.pkg"; + hash = "sha256-MiSrCHLby3diTAzDPCYX1ZwdmzcHwOx/UJuWrlRJe54="; }; - nativeBuildInputs = [ installShellFiles ]; + nativeBuildInputs = [ + libarchive + p7zip + ]; + + unpackPhase = '' + runHook preUnpack + + 7z x $src + bsdtar -xf Payload~ + + runHook postUnpack + ''; + + dontBuild = true; installPhase = '' - install -D './${version}/bin/mas' "$out/bin/mas" - installShellCompletion --cmd mas --bash './${version}/etc/bash_completion.d/mas' + runHook preInstall + + mkdir -p $out/bin + cp mas $out/bin + + runHook postInstall ''; passthru.tests = {