From e55eb3d376c05d2bc902506aa0c42c8eb8c06bcb Mon Sep 17 00:00:00 2001 From: Jason Pickens Date: Wed, 16 Feb 2022 22:49:48 +1300 Subject: mas: 1.8.2 -> 1.8.6 --- pkgs/os-specific/darwin/mas/default.nix | 41 ++++++++++++++++++--------------- 1 file changed, 22 insertions(+), 19 deletions(-) (limited to 'pkgs/os-specific') diff --git a/pkgs/os-specific/darwin/mas/default.nix b/pkgs/os-specific/darwin/mas/default.nix index 907d2185327..33a3114c3d6 100644 --- a/pkgs/os-specific/darwin/mas/default.nix +++ b/pkgs/os-specific/darwin/mas/default.nix @@ -1,38 +1,41 @@ { lib -, stdenv +, stdenvNoCC , fetchurl -, libarchive -, p7zip +, installShellFiles +, testVersion +, mas }: -stdenv.mkDerivation rec { +stdenvNoCC.mkDerivation rec { pname = "mas"; - version = "1.8.2"; + version = "1.8.6"; src = fetchurl { - url = "https://github.com/mas-cli/mas/releases/download/v${version}/mas.pkg"; - sha256 = "HlLQKBVIYKanS6kjkbYdabBi1T0irxE6fNd2H6mDKe4="; + # 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"; }; - nativeBuildInputs = [ libarchive p7zip ]; - - unpackPhase = '' - 7z x $src - bsdtar -xf Payload~ - ''; - - dontBuild = true; + nativeBuildInputs = [ installShellFiles ]; installPhase = '' - mkdir -p $out - cp -r ./usr/local/bin $out + install -D './${version}/bin/mas' "$out/bin/mas" + installShellCompletion --cmd mas --bash './${version}/etc/bash_completion.d/mas' ''; + passthru.tests = { + version = testVersion { + package = mas; + command = "mas version"; + }; + }; + meta = with lib; { description = "Mac App Store command line interface"; homepage = "https://github.com/mas-cli/mas"; license = licenses.mit; - maintainers = with maintainers; [ zachcoyle ]; - platforms = platforms.darwin; + maintainers = with maintainers; [ steinybot zachcoyle ]; + platforms = [ "x86_64-darwin" "aarch64-darwin" ]; }; } -- cgit 1.4.1