swift-format: init at 5.8

This commit is contained in:
Stéphan Kochen 2023-05-06 13:26:53 +02:00
parent 89abc99d5b
commit 1f5b379683
6 changed files with 130 additions and 1 deletions

View file

@ -97,6 +97,8 @@ let
inherit (apple_sdk.frameworks) CryptoKit LocalAuthentication;
};
swift-format = callPackage ./swift-format { };
};
in self

View file

@ -18,6 +18,7 @@ let
swift-docc-render-artifact = "sha256-vdSyICXOjlNSjZXzPRxa/5305pg6PG4xww9GYEV9m10=";
swift-driver = "sha256-7xsG3Bpf+wqisCMaPEuEg8CjGYO/0r8BX3pMUmRrezE=";
swift-experimental-string-processing = "sha256-ioXG6pQKjlAc2oF38Z7TGighyZN8w2ZAAtFUq83Ow6Q=";
swift-format = "sha256-uKhIcbJb0DDHKACfVrhQ4fSyXVUkAj090eUZsOrtEqw=";
swift-package-manager = "sha256-xd6ZpeXfMoHyVrJxz6XcDLPKBvc2nl1lgWXuLrJdq+E=";
swift-syntax = "sha256-gkpx/1sWWi9y917OJ1GSNFYXrJb6e2qI4JlV+38laRQ=";
};

View file

@ -0,0 +1,40 @@
{ lib
, stdenv
, callPackage
, swift
, swiftpm
, swiftpm2nix
, Foundation
}:
let
sources = callPackage ../sources.nix { };
generated = swiftpm2nix.helpers ./generated;
in
stdenv.mkDerivation {
pname = "swift-format";
inherit (sources) version;
src = sources.swift-format;
nativeBuildInputs = [ swift swiftpm ];
buildInputs = [ Foundation ];
configurePhase = generated.configure;
# We only install the swift-format binary, so don't need the other products.
swiftpmFlags = "--product swift-format";
installPhase = ''
binPath="$(swiftpmBinPath)"
mkdir -p $out/bin
cp $binPath/swift-format $out/bin/
'';
meta = {
description = "Formatting technology for Swift source code";
homepage = "https://github.com/apple/swift-format";
platforms = with lib.platforms; linux ++ darwin;
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [ dtzWill trepetti dduan trundle stephank ];
};
}

View file

@ -0,0 +1,10 @@
# This file was generated by swiftpm2nix.
{
workspaceStateFile = ./workspace-state.json;
hashes = {
"swift-argument-parser" = "01p814snzlfpby2qj67a3dcnsa6038fbk8411npi28440w1hzpzx";
"swift-syntax" = "05394mzznmcrw246lyzsjsn1fmilj98jgkjyyxr2ynhnbgzp2jl2";
"swift-system" = "0402hkx2q2dv27gccnn8ma79ngvwiwzkhcv4zlcdldmy6cgi0px7";
"swift-tools-support-core" = "16kp0y1akr99v319j46x0zwc8kzh5klnqcvjhsb57ah5xr0l29bk";
};
}

View file

@ -0,0 +1,76 @@
{
"object": {
"artifacts": [],
"dependencies": [
{
"basedOn": null,
"packageRef": {
"identity": "swift-argument-parser",
"kind": "remoteSourceControl",
"location": "https://github.com/apple/swift-argument-parser.git",
"name": "swift-argument-parser"
},
"state": {
"checkoutState": {
"branch": "main",
"revision": "c5050aa63ed5bb23209e7120b7ff6618ee06e0ee"
},
"name": "sourceControlCheckout"
},
"subpath": "swift-argument-parser"
},
{
"basedOn": null,
"packageRef": {
"identity": "swift-syntax",
"kind": "remoteSourceControl",
"location": "https://github.com/apple/swift-syntax.git",
"name": "SwiftSyntax"
},
"state": {
"checkoutState": {
"branch": "main",
"revision": "cd793adf5680e138bf2bcbaacc292490175d0dcd"
},
"name": "sourceControlCheckout"
},
"subpath": "swift-syntax"
},
{
"basedOn": null,
"packageRef": {
"identity": "swift-system",
"kind": "remoteSourceControl",
"location": "https://github.com/apple/swift-system.git",
"name": "swift-system"
},
"state": {
"checkoutState": {
"revision": "836bc4557b74fe6d2660218d56e3ce96aff76574",
"version": "1.1.1"
},
"name": "sourceControlCheckout"
},
"subpath": "swift-system"
},
{
"basedOn": null,
"packageRef": {
"identity": "swift-tools-support-core",
"kind": "remoteSourceControl",
"location": "https://github.com/apple/swift-tools-support-core.git",
"name": "swift-tools-support-core"
},
"state": {
"checkoutState": {
"branch": "main",
"revision": "1296d2f11b0226c4b83540010936c7238d21c12b"
},
"name": "sourceControlCheckout"
},
"subpath": "swift-tools-support-core"
}
]
},
"version": 6
}

View file

@ -16451,7 +16451,7 @@ with pkgs;
svdtools = callPackage ../development/embedded/svdtools { };
swiftPackages = recurseIntoAttrs (callPackage ../development/compilers/swift { });
inherit (swiftPackages) swift swiftpm sourcekit-lsp;
inherit (swiftPackages) swift swiftpm sourcekit-lsp swift-format;
swiftpm2nix = callPackage ../development/tools/swiftpm2nix { };