2023-07-24 16:47:12 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, swift
|
|
|
|
, swiftpm
|
|
|
|
, swiftpm2nix
|
|
|
|
, makeWrapper
|
|
|
|
, CryptoKit
|
|
|
|
, LocalAuthentication
|
|
|
|
, libcompression
|
|
|
|
, aria2
|
|
|
|
}:
|
|
|
|
let
|
|
|
|
generated = swiftpm2nix.helpers ./generated;
|
|
|
|
in
|
2023-04-14 15:36:19 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
|
|
|
pname = "xcodes";
|
2023-06-28 17:18:42 +00:00
|
|
|
version = "1.4.1";
|
2023-04-14 15:36:19 +00:00
|
|
|
|
2023-07-24 16:47:12 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "XcodesOrg";
|
|
|
|
repo = finalAttrs.pname;
|
|
|
|
rev = finalAttrs.version;
|
|
|
|
hash = "sha256-ARrSQ9ozM90Yg7y4WdU7jjNQ64sXHuhxZh/iNJcFfY0=";
|
2023-04-14 15:36:19 +00:00
|
|
|
};
|
|
|
|
|
2023-07-24 16:47:12 +00:00
|
|
|
nativeBuildInputs = [ swift swiftpm makeWrapper ];
|
2023-04-14 15:36:19 +00:00
|
|
|
|
2023-07-24 16:47:12 +00:00
|
|
|
buildInputs = [
|
|
|
|
CryptoKit
|
|
|
|
LocalAuthentication
|
|
|
|
libcompression
|
|
|
|
];
|
2023-04-14 15:36:19 +00:00
|
|
|
|
2023-07-24 16:47:12 +00:00
|
|
|
configurePhase = generated.configure;
|
2023-04-14 15:36:19 +00:00
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
2023-07-24 16:47:12 +00:00
|
|
|
|
|
|
|
binPath="$(swiftpmBinPath)"
|
|
|
|
install -D $binPath/xcodes $out/bin/xcodes
|
|
|
|
wrapProgram $out/bin/xcodes \
|
|
|
|
--prefix PATH : ${lib.makeBinPath [ aria2 ]}
|
|
|
|
|
2023-04-14 15:36:19 +00:00
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
2023-06-28 17:18:42 +00:00
|
|
|
changelog = "https://github.com/XcodesOrg/xcodes/releases/tag/${finalAttrs.version}";
|
2023-04-14 15:36:19 +00:00
|
|
|
description = "Command-line tool to install and switch between multiple versions of Xcode";
|
|
|
|
homepage = "https://github.com/XcodesOrg/xcodes";
|
2023-07-24 16:47:12 +00:00
|
|
|
license = with licenses; [
|
|
|
|
mit
|
|
|
|
# unxip
|
|
|
|
lgpl3Only
|
|
|
|
];
|
|
|
|
maintainers = with maintainers; [ _0x120581f emilytrau ];
|
2023-04-14 15:36:19 +00:00
|
|
|
platforms = platforms.darwin;
|
|
|
|
};
|
|
|
|
})
|