2020-10-06 01:40:07 +02:00
|
|
|
{ lib
|
2022-02-16 10:49:48 +01:00
|
|
|
, stdenvNoCC
|
2020-10-06 01:40:07 +02:00
|
|
|
, fetchurl
|
2022-02-16 10:49:48 +01:00
|
|
|
, installShellFiles
|
2022-04-26 09:59:18 +02:00
|
|
|
, testers
|
2022-02-16 10:49:48 +01:00
|
|
|
, mas
|
2020-10-06 01:40:07 +02:00
|
|
|
}:
|
|
|
|
|
2022-02-16 10:49:48 +01:00
|
|
|
stdenvNoCC.mkDerivation rec {
|
2020-10-06 01:40:07 +02:00
|
|
|
pname = "mas";
|
2022-02-16 10:49:48 +01:00
|
|
|
version = "1.8.6";
|
2020-10-06 01:40:07 +02:00
|
|
|
|
|
|
|
src = fetchurl {
|
2022-02-16 10:49:48 +01:00
|
|
|
# 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";
|
2020-10-06 01:40:07 +02:00
|
|
|
};
|
|
|
|
|
2022-02-16 10:49:48 +01:00
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
2020-10-06 01:40:07 +02:00
|
|
|
|
|
|
|
installPhase = ''
|
2022-02-16 10:49:48 +01:00
|
|
|
install -D './${version}/bin/mas' "$out/bin/mas"
|
|
|
|
installShellCompletion --cmd mas --bash './${version}/etc/bash_completion.d/mas'
|
2020-10-06 01:40:07 +02:00
|
|
|
'';
|
|
|
|
|
2022-02-16 10:49:48 +01:00
|
|
|
passthru.tests = {
|
2022-04-26 09:59:18 +02:00
|
|
|
version = testers.testVersion {
|
2022-02-16 10:49:48 +01:00
|
|
|
package = mas;
|
|
|
|
command = "mas version";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2020-10-06 01:40:07 +02:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Mac App Store command line interface";
|
|
|
|
homepage = "https://github.com/mas-cli/mas";
|
|
|
|
license = licenses.mit;
|
2022-02-16 10:49:48 +01:00
|
|
|
maintainers = with maintainers; [ steinybot zachcoyle ];
|
|
|
|
platforms = [ "x86_64-darwin" "aarch64-darwin" ];
|
2020-10-06 01:40:07 +02:00
|
|
|
};
|
|
|
|
}
|