summary refs log tree commit diff
path: root/pkgs/os-specific/darwin
diff options
context:
space:
mode:
authorZach Coyle <zach.coyle@gmail.com>2020-10-05 19:40:07 -0400
committerZach Coyle <zach.coyle@gmail.com>2021-04-02 12:14:36 -0400
commitc7c2e2f54f8ee6934149418f34d03b782a096490 (patch)
treebd401713b25bb12a113300fed775e261b2c3c7f5 /pkgs/os-specific/darwin
parentae73ec2b68cb37166254570ba7fbb352abab2d66 (diff)
downloadnixpkgs-c7c2e2f54f8ee6934149418f34d03b782a096490.tar
nixpkgs-c7c2e2f54f8ee6934149418f34d03b782a096490.tar.gz
nixpkgs-c7c2e2f54f8ee6934149418f34d03b782a096490.tar.bz2
nixpkgs-c7c2e2f54f8ee6934149418f34d03b782a096490.tar.lz
nixpkgs-c7c2e2f54f8ee6934149418f34d03b782a096490.tar.xz
nixpkgs-c7c2e2f54f8ee6934149418f34d03b782a096490.tar.zst
nixpkgs-c7c2e2f54f8ee6934149418f34d03b782a096490.zip
mas: init at 1.8.1
Diffstat (limited to 'pkgs/os-specific/darwin')
-rw-r--r--pkgs/os-specific/darwin/mas/default.nix44
1 files changed, 44 insertions, 0 deletions
diff --git a/pkgs/os-specific/darwin/mas/default.nix b/pkgs/os-specific/darwin/mas/default.nix
new file mode 100644
index 00000000000..495d47df89f
--- /dev/null
+++ b/pkgs/os-specific/darwin/mas/default.nix
@@ -0,0 +1,44 @@
+{ lib
+, stdenv
+, fetchurl
+, libarchive
+, p7zip
+}:
+
+stdenv.mkDerivation rec {
+  pname = "mas";
+  version = "1.8.1";
+
+  src = fetchurl {
+    url = "https://github.com/mas-cli/mas/releases/download/v${version}/mas.pkg";
+    sha256 = "W/wgg+ETeJPoZ7MoVGH2uJzQiZMLIy3n1JYKUloc3ZU=";
+  };
+
+  nativeBuildInputs = [ libarchive p7zip ];
+
+  unpackPhase = ''
+    7z x $src
+    bsdtar -xf Payload~
+  '';
+
+  doBuild = false;
+
+  installPhase = ''
+    mkdir -p $out
+    cp -r ./bin $out
+    cp -r ./Frameworks $out
+  '';
+
+  postFixup = ''
+    install_name_tool -change @rpath/MasKit.framework/Versions/A/MasKit $out/Frameworks/MasKit.framework/Versions/A/MasKit $out/bin/mas
+    install_name_tool -change @rpath/Commandant.framework/Commandant $out/Frameworks/MasKit.framework/Versions/A/Frameworks/Commandant.framework/Versions/A/Commandant $out/bin/mas
+  '';
+
+  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;
+  };
+}