depot/third_party/nixpkgs/pkgs/development/tools/xcodes/default.nix
Default email 24fdeddc0a Project import generated by Copybara.
GitOrigin-RevId: 2768c7d042a37de65bb1b5b3268fc987e534c49d
2024-10-23 09:41:50 +03: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;
};
})