Unverified Commit 4dc9c397 authored by Greg Pfeil's avatar Greg Pfeil
Browse files

mas: 1.8.6 -> 1.9.0

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
parent 62eb6058
Loading
Loading
Loading
Loading
+26 −9
Original line number Diff line number Diff line
@@ -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 = {