about summary refs log tree commit diff
path: root/pkgs/development/tools/xcodes
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/tools/xcodes')
-rw-r--r--pkgs/development/tools/xcodes/default.nix59
-rw-r--r--pkgs/development/tools/xcodes/generated/default.nix17
-rw-r--r--pkgs/development/tools/xcodes/generated/workspace-state.json194
3 files changed, 250 insertions, 20 deletions
diff --git a/pkgs/development/tools/xcodes/default.nix b/pkgs/development/tools/xcodes/default.nix
index f10fd76aa0202..a7449aa08651c 100644
--- a/pkgs/development/tools/xcodes/default.nix
+++ b/pkgs/development/tools/xcodes/default.nix
@@ -1,41 +1,60 @@
-{ lib, stdenv, fetchurl, unzip }:
-
+{ lib
+, stdenv
+, fetchFromGitHub
+, swift
+, swiftpm
+, swiftpm2nix
+, makeWrapper
+, CryptoKit
+, LocalAuthentication
+, libcompression
+, aria2
+}:
+let
+  generated = swiftpm2nix.helpers ./generated;
+in
 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=";
+  src = fetchFromGitHub {
+    owner = "XcodesOrg";
+    repo = finalAttrs.pname;
+    rev = finalAttrs.version;
+    hash = "sha256-ARrSQ9ozM90Yg7y4WdU7jjNQ64sXHuhxZh/iNJcFfY0=";
   };
 
-  nativeBuildInputs = [ unzip ];
+  nativeBuildInputs = [ swift swiftpm makeWrapper ];
 
-  unpackPhase = ''
-    runHook preUnpack
-    unzip -q $src
-    runHook postUnpack
-  '';
+  buildInputs = [
+    CryptoKit
+    LocalAuthentication
+    libcompression
+  ];
 
-  dontPatch = true;
-  dontConfigure = true;
-  dontBuild = true;
+  configurePhase = generated.configure;
 
   installPhase = ''
     runHook preInstall
-    mkdir -p $out/bin
-    install -m755 xcodes $out/bin/xcodes
+
+    binPath="$(swiftpmBinPath)"
+    install -D $binPath/xcodes $out/bin/xcodes
+    wrapProgram $out/bin/xcodes \
+      --prefix PATH : ${lib.makeBinPath [ aria2 ]}
+
     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 ];
+    license = with licenses; [
+      mit
+      # unxip
+      lgpl3Only
+    ];
+    maintainers = with maintainers; [ _0x120581f emilytrau ];
     platforms = platforms.darwin;
   };
 })
diff --git a/pkgs/development/tools/xcodes/generated/default.nix b/pkgs/development/tools/xcodes/generated/default.nix
new file mode 100644
index 0000000000000..32ec081a93801
--- /dev/null
+++ b/pkgs/development/tools/xcodes/generated/default.nix
@@ -0,0 +1,17 @@
+# This file was generated by swiftpm2nix.
+{
+  workspaceStateFile = ./workspace-state.json;
+  hashes = {
+    "data" = "1jf2y9dbg1qvxkkabdkihdnr1kmznq79h18j65a7iw1hljdp8hyg";
+    "Foundation" = "0hcpc15v38l32qc2sh4gqj909b1f90knln9yz3mfiyf6xi7iy6q7";
+    "KeychainAccess" = "0m57pq1vn5qarmlx5x4kfv0yzjylafl3ipih5p60zyfsx6k5b55l";
+    "LegibleError" = "08x5agha74chq1z5c7c5r2vasdk81pyl2k085miapd4l3jszz4fj";
+    "Path.swift" = "05qk7kwb1254zwdxc3sjc3gprccnv9fwapmy5y6ygxjz8a6jfk83";
+    "PromiseKit" = "0vlkd4famjgbd4qs2ldi5aqg13nk77h7ddsdigyxxzgkwgxl076d";
+    "Rainbow" = "0iv31azny668vpsjgmldgkgn9cp8i5h9rlc6w5bs8q63nwq19wb0";
+    "swift-argument-parser" = "19b4pkcx4xf0iwg0nbr7wvkkbwl6h8sch848gid6l98728glmcw9";
+    "SwiftSoup" = "14klizw8jhmxhxays1b1yh4bp0nbb3l4l1pj6sdnf0iqs0wladv8";
+    "Version" = "0s5bwr1li6dnsnalfyraq1kzhqmmn9qwp1mld4msrn3q5vvjmql9";
+    "Yams" = "11abhcfkmqm3cmh7vp7rqzvxd1zj02j2866a2pp6v9m89456xb76";
+  };
+}
diff --git a/pkgs/development/tools/xcodes/generated/workspace-state.json b/pkgs/development/tools/xcodes/generated/workspace-state.json
new file mode 100644
index 0000000000000..f13a3a54c6d4d
--- /dev/null
+++ b/pkgs/development/tools/xcodes/generated/workspace-state.json
@@ -0,0 +1,194 @@
+{
+  "object": {
+    "artifacts": [],
+    "dependencies": [
+      {
+        "basedOn": null,
+        "packageRef": {
+          "identity": "data",
+          "kind": "remoteSourceControl",
+          "location": "https://github.com/xcodereleases/data",
+          "name": "XcodeReleases"
+        },
+        "state": {
+          "checkoutState": {
+            "revision": "fcf527b187817f67c05223676341f3ab69d4214d"
+          },
+          "name": "sourceControlCheckout"
+        },
+        "subpath": "data"
+      },
+      {
+        "basedOn": null,
+        "packageRef": {
+          "identity": "foundation",
+          "kind": "remoteSourceControl",
+          "location": "https://github.com/PromiseKit/Foundation.git",
+          "name": "PMKFoundation"
+        },
+        "state": {
+          "checkoutState": {
+            "revision": "985f17fa69ee0e5b7eb3ff9be87ffc4e05fc0927",
+            "version": "3.4.0"
+          },
+          "name": "sourceControlCheckout"
+        },
+        "subpath": "Foundation"
+      },
+      {
+        "basedOn": null,
+        "packageRef": {
+          "identity": "keychainaccess",
+          "kind": "remoteSourceControl",
+          "location": "https://github.com/kishikawakatsumi/KeychainAccess.git",
+          "name": "KeychainAccess"
+        },
+        "state": {
+          "checkoutState": {
+            "revision": "8d33ffd6f74b3bcfc99af759d4204c6395a3f918",
+            "version": "3.2.1"
+          },
+          "name": "sourceControlCheckout"
+        },
+        "subpath": "KeychainAccess"
+      },
+      {
+        "basedOn": null,
+        "packageRef": {
+          "identity": "legibleerror",
+          "kind": "remoteSourceControl",
+          "location": "https://github.com/mxcl/LegibleError.git",
+          "name": "LegibleError"
+        },
+        "state": {
+          "checkoutState": {
+            "revision": "909e9bab3ded97350b28a5ab41dd745dd8aa9710",
+            "version": "1.0.4"
+          },
+          "name": "sourceControlCheckout"
+        },
+        "subpath": "LegibleError"
+      },
+      {
+        "basedOn": null,
+        "packageRef": {
+          "identity": "path.swift",
+          "kind": "remoteSourceControl",
+          "location": "https://github.com/mxcl/Path.swift.git",
+          "name": "Path.swift"
+        },
+        "state": {
+          "checkoutState": {
+            "revision": "dac007e907a4f4c565cfdc55a9ce148a761a11d5",
+            "version": "0.16.3"
+          },
+          "name": "sourceControlCheckout"
+        },
+        "subpath": "Path.swift"
+      },
+      {
+        "basedOn": null,
+        "packageRef": {
+          "identity": "promisekit",
+          "kind": "remoteSourceControl",
+          "location": "https://github.com/mxcl/PromiseKit.git",
+          "name": "PromiseKit"
+        },
+        "state": {
+          "checkoutState": {
+            "revision": "1c296a8637838901d2b01e4c46875ee749506133",
+            "version": "6.8.5"
+          },
+          "name": "sourceControlCheckout"
+        },
+        "subpath": "PromiseKit"
+      },
+      {
+        "basedOn": null,
+        "packageRef": {
+          "identity": "rainbow",
+          "kind": "remoteSourceControl",
+          "location": "https://github.com/onevcat/Rainbow.git",
+          "name": "Rainbow"
+        },
+        "state": {
+          "checkoutState": {
+            "revision": "626c3d4b6b55354b4af3aa309f998fae9b31a3d9",
+            "version": "3.2.0"
+          },
+          "name": "sourceControlCheckout"
+        },
+        "subpath": "Rainbow"
+      },
+      {
+        "basedOn": null,
+        "packageRef": {
+          "identity": "swift-argument-parser",
+          "kind": "remoteSourceControl",
+          "location": "https://github.com/apple/swift-argument-parser",
+          "name": "swift-argument-parser"
+        },
+        "state": {
+          "checkoutState": {
+            "revision": "9f39744e025c7d377987f30b03770805dcb0bcd1",
+            "version": "1.1.4"
+          },
+          "name": "sourceControlCheckout"
+        },
+        "subpath": "swift-argument-parser"
+      },
+      {
+        "basedOn": null,
+        "packageRef": {
+          "identity": "swiftsoup",
+          "kind": "remoteSourceControl",
+          "location": "https://github.com/scinfu/SwiftSoup.git",
+          "name": "SwiftSoup"
+        },
+        "state": {
+          "checkoutState": {
+            "revision": "aeb5b4249c273d1783a5299e05be1b26e061ea81",
+            "version": "2.0.0"
+          },
+          "name": "sourceControlCheckout"
+        },
+        "subpath": "SwiftSoup"
+      },
+      {
+        "basedOn": null,
+        "packageRef": {
+          "identity": "version",
+          "kind": "remoteSourceControl",
+          "location": "https://github.com/mxcl/Version.git",
+          "name": "Version"
+        },
+        "state": {
+          "checkoutState": {
+            "revision": "087c91fedc110f9f833b14ef4c32745dabca8913",
+            "version": "1.0.3"
+          },
+          "name": "sourceControlCheckout"
+        },
+        "subpath": "Version"
+      },
+      {
+        "basedOn": null,
+        "packageRef": {
+          "identity": "yams",
+          "kind": "remoteSourceControl",
+          "location": "https://github.com/jpsim/Yams",
+          "name": "Yams"
+        },
+        "state": {
+          "checkoutState": {
+            "revision": "01835dc202670b5bb90d07f3eae41867e9ed29f6",
+            "version": "5.0.1"
+          },
+          "name": "sourceControlCheckout"
+        },
+        "subpath": "Yams"
+      }
+    ]
+  },
+  "version": 6
+}