about summary refs log tree commit diff
path: root/pkgs/development/tools/xcodes/default.nix
blob: f10fd76aa0202bbb8ba3160dc526289b5da9f804 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
{ lib, stdenv, fetchurl, unzip }:

stdenv.mkDerivation (finalAttrs: {
  pname = "xcodes";
  version = "1.4.1";

  src = fetchurl {
    url = "https://github.com/XcodesOrg/xcodes/releases/download/${finalAttrs.version}/xcodes.zip";
    hash = "sha256-PtXF2eqNfEX29EtXlcjdxrUs7BPn/YurUuFFeLpXwrk=";
  };

  nativeBuildInputs = [ unzip ];

  unpackPhase = ''
    runHook preUnpack
    unzip -q $src
    runHook postUnpack
  '';

  dontPatch = true;
  dontConfigure = true;
  dontBuild = true;

  installPhase = ''
    runHook preInstall
    mkdir -p $out/bin
    install -m755 xcodes $out/bin/xcodes
    runHook postInstall
  '';

  dontFixup = true;

  meta = with lib; {
    changelog = "https://github.com/XcodesOrg/xcodes/releases/tag/${finalAttrs.version}";
    description = "Command-line tool to install and switch between multiple versions of Xcode";
    homepage = "https://github.com/XcodesOrg/xcodes";
    license = licenses.mit;
    maintainers = with maintainers; [ _0x120581f ];
    platforms = platforms.darwin;
  };
})