Files
nixpkgs/pkgs/by-name/xc/xcodes/package.nix
Randy Eckenrode 282292d48e xcodes: remove obsolete Swift constructs
The new Swift packaging no longer requires using a custom stdenv.
2026-09-15 23:08:48 -04:00

60 lines
1.2 KiB
Nix

{
lib,
fetchFromGitHub,
stdenv,
swift,
swiftpm,
swiftpm2nix,
makeWrapper,
aria2,
}:
let
generated = swiftpm2nix.helpers ./generated;
in
stdenv.mkDerivation (finalAttrs: {
pname = "xcodes";
version = "1.6.2";
src = fetchFromGitHub {
owner = "XcodesOrg";
repo = "xcodes";
rev = finalAttrs.version;
hash = "sha256-eH6AdboJsGQ0iWoRllOMzhjM/1t43DB1U0bOu6J/uo4=";
};
nativeBuildInputs = [
swift
swiftpm
makeWrapper
];
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 = {
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 lib.licenses; [
mit
# unxip
lgpl3Only
];
maintainers = with lib.maintainers; [
_0x120581f
emilytrau
];
platforms = lib.platforms.darwin;
};
})