depot/pkgs/development/tools/xcodes/default.nix
Luke Granger-Brown 57725ef3ec Squashed 'third_party/nixpkgs/' content from commit 76612b17c0ce
git-subtree-dir: third_party/nixpkgs
git-subtree-split: 76612b17c0ce71689921ca12d9ffdc9c23ce40b2
2024-11-10 23:59:47 +00:00

60 lines
1.3 KiB
Nix

{ lib
, stdenv
, fetchFromGitHub
, swift
, swiftpm
, swiftpm2nix
, makeWrapper
, CryptoKit
, LocalAuthentication
, libcompression
, aria2
}:
let
generated = swiftpm2nix.helpers ./generated;
in
stdenv.mkDerivation (finalAttrs: {
pname = "xcodes";
version = "1.5.0";
src = fetchFromGitHub {
owner = "XcodesOrg";
repo = "xcodes";
rev = finalAttrs.version;
hash = "sha256-vksfvrx0TqtjcOHn38Ey3P6jIFYF4CbD3SVICVFINSU=";
};
nativeBuildInputs = [ swift swiftpm makeWrapper ];
buildInputs = [
CryptoKit
LocalAuthentication
libcompression
];
configurePhase = generated.configure;
installPhase = ''
runHook preInstall
binPath="$(swiftpmBinPath)"
install -D $binPath/xcodes $out/bin/xcodes
wrapProgram $out/bin/xcodes \
--prefix PATH : ${lib.makeBinPath [ aria2 ]}
runHook postInstall
'';
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 = with licenses; [
mit
# unxip
lgpl3Only
];
maintainers = with maintainers; [ _0x120581f emilytrau ];
platforms = platforms.darwin;
};
})