xcodegen: init

Sam a0d07c62 8dacc3a6

+304
+34
pkgs/by-name/xc/xcodegen/0001-spectre-xct-record.patch
··· 1 + diff --git a/Sources/Spectre/XCTest.swift b/Sources/Spectre/XCTest.swift 2 + index 3704436..e759f14 100644 3 + --- a/Sources/Spectre/XCTest.swift 4 + +++ b/Sources/Spectre/XCTest.swift 5 + @@ -31,28 +31,6 @@ class XcodeReporter: ContextReporter { 6 + func addDisabled(_ name: String) {} 7 + 8 + func addFailure(_ name: String, failure: FailureType) { 9 + - // Xcode 12 removed `recordFailure` and replaced with `record(_:)` 10 + - #if swift(>=4.2) 11 + - // The `compiler` statement was added in swift 4.2, so it needs to be in a separate statement to retain 12 + - // compatibility with 4.x. 13 + - #if compiler(>=5.3) && os(macOS) 14 + - let location = XCTSourceCodeLocation(filePath: failure.file, lineNumber: failure.line) 15 + - #if Xcode 16 + - // As of Xcode 12.0.1, XCTIssue is unavailable even though it is documented: 17 + - // https://developer.apple.com/documentation/xctest/xctissue 18 + - // When building with `swift build`, it is available. Perhaps the xctest overlay behaves differently between the two. 19 + - let issue = XCTIssueReference(type: .assertionFailure, compactDescription: "\(name): \(failure.reason)", detailedDescription: nil, sourceCodeContext: .init(location: location), associatedError: nil, attachments: []) 20 + - #else 21 + - let issue = XCTIssue(type: .assertionFailure, compactDescription: "\(name): \(failure.reason)", detailedDescription: nil, sourceCodeContext: .init(location: location), associatedError: nil, attachments: []) 22 + - #endif 23 + - #if compiler(>=5.4) 24 + - testCase.record(issue as XCTIssue) 25 + - #else 26 + - testCase.record(issue) 27 + - #endif 28 + - #else 29 + testCase.recordFailure(withDescription: "\(name): \(failure.reason)", inFile: failure.file, atLine: failure.line, expected: false) 30 + - #endif 31 + - #endif 32 + } 33 + } 34 + \ No newline at end of file
+16
pkgs/by-name/xc/xcodegen/nix/default.nix
··· 1 + # This file was generated by swiftpm2nix. 2 + { 3 + workspaceStateFile = ./workspace-state.json; 4 + hashes = { 5 + "AEXML" = "sha256-bQcXq1aS76sOjW8yYCOlGVZ2tStDvzRQSyj9VrAj6nI="; 6 + "ArtifactBundleGen" = "sha256-mSXJiRGFIm2RtzBG8l6s4RJ2BzSbPZKUZIqWM4vDIhc="; 7 + "JSONUtilities" = "sha256-jl8XfgoB5IX0qwwDtzcWgK0u3SNG2HfrPoEb2a6/mlA="; 8 + "PathKit" = "sha256-ewxTC1kpu6PXhwamCxYfI50ooYO1SIU0+IXH2tc/uv4="; 9 + "Rainbow" = "sha256-zmd/wGFX0AYRvwecqQerlxDETMuBqQM+Whuf3JezAGM="; 10 + "Spectre" = "sha256-fipGRIgw+jV7Wrxa+xivRk7YMyxDhGFB6SHIHscrmV8="; 11 + "SwiftCLI" = "sha256-PmjzLss0D12iy6YKsudFa8i63NQAssyCBqqq8VjRiH4="; 12 + "Version" = "sha256-4IwQlexWtIH9M0sSai1a+ITTAKkD2zJtbYoV4Cg+Snw="; 13 + "XcodeProj" = "sha256-ycHDzay37YtT/3QqUpG6XPjRh32P5iU/I5GpfjrXs/I="; 14 + "Yams" = "sha256-5qxuCkmopm3uFcoYJKQA8ofW98f53H1gZaPiOh2DS4U="; 15 + }; 16 + }
+178
pkgs/by-name/xc/xcodegen/nix/workspace-state.json
··· 1 + { 2 + "object": { 3 + "artifacts": [], 4 + "dependencies": [ 5 + { 6 + "basedOn": null, 7 + "packageRef": { 8 + "identity": "aexml", 9 + "kind": "remoteSourceControl", 10 + "location": "https://github.com/tadija/AEXML.git", 11 + "name": "AEXML" 12 + }, 13 + "state": { 14 + "checkoutState": { 15 + "revision": "38f7d00b23ecd891e1ee656fa6aeebd6ba04ecc3", 16 + "version": "4.6.1" 17 + }, 18 + "name": "sourceControlCheckout" 19 + }, 20 + "subpath": "AEXML" 21 + }, 22 + { 23 + "basedOn": null, 24 + "packageRef": { 25 + "identity": "artifactbundlegen", 26 + "kind": "remoteSourceControl", 27 + "location": "https://github.com/freddi-kit/ArtifactBundleGen", 28 + "name": "ArtifactBundleGen" 29 + }, 30 + "state": { 31 + "checkoutState": { 32 + "revision": "707e4ccc4b1c7e48e881cd5ea91e493a95df24bf", 33 + "version": "0.0.6" 34 + }, 35 + "name": "sourceControlCheckout" 36 + }, 37 + "subpath": "ArtifactBundleGen" 38 + }, 39 + { 40 + "basedOn": null, 41 + "packageRef": { 42 + "identity": "jsonutilities", 43 + "kind": "remoteSourceControl", 44 + "location": "https://github.com/yonaskolb/JSONUtilities.git", 45 + "name": "JSONUtilities" 46 + }, 47 + "state": { 48 + "checkoutState": { 49 + "revision": "128d2ffc22467f69569ef8ff971683e2393191a0", 50 + "version": "4.2.0" 51 + }, 52 + "name": "sourceControlCheckout" 53 + }, 54 + "subpath": "JSONUtilities" 55 + }, 56 + { 57 + "basedOn": null, 58 + "packageRef": { 59 + "identity": "pathkit", 60 + "kind": "remoteSourceControl", 61 + "location": "https://github.com/kylef/PathKit.git", 62 + "name": "PathKit" 63 + }, 64 + "state": { 65 + "checkoutState": { 66 + "revision": "3bfd2737b700b9a36565a8c94f4ad2b050a5e574", 67 + "version": "1.0.1" 68 + }, 69 + "name": "sourceControlCheckout" 70 + }, 71 + "subpath": "PathKit" 72 + }, 73 + { 74 + "basedOn": null, 75 + "packageRef": { 76 + "identity": "rainbow", 77 + "kind": "remoteSourceControl", 78 + "location": "https://github.com/onevcat/Rainbow.git", 79 + "name": "Rainbow" 80 + }, 81 + "state": { 82 + "checkoutState": { 83 + "revision": "e0dada9cd44e3fa7ec3b867e49a8ddbf543e3df3", 84 + "version": "4.0.1" 85 + }, 86 + "name": "sourceControlCheckout" 87 + }, 88 + "subpath": "Rainbow" 89 + }, 90 + { 91 + "basedOn": null, 92 + "packageRef": { 93 + "identity": "spectre", 94 + "kind": "remoteSourceControl", 95 + "location": "https://github.com/kylef/Spectre.git", 96 + "name": "Spectre" 97 + }, 98 + "state": { 99 + "checkoutState": { 100 + "revision": "26cc5e9ae0947092c7139ef7ba612e34646086c7", 101 + "version": "0.10.1" 102 + }, 103 + "name": "sourceControlCheckout" 104 + }, 105 + "subpath": "Spectre" 106 + }, 107 + { 108 + "basedOn": null, 109 + "packageRef": { 110 + "identity": "swiftcli", 111 + "kind": "remoteSourceControl", 112 + "location": "https://github.com/jakeheis/SwiftCLI.git", 113 + "name": "SwiftCLI" 114 + }, 115 + "state": { 116 + "checkoutState": { 117 + "revision": "2e949055d9797c1a6bddcda0e58dada16cc8e970", 118 + "version": "6.0.3" 119 + }, 120 + "name": "sourceControlCheckout" 121 + }, 122 + "subpath": "SwiftCLI" 123 + }, 124 + { 125 + "basedOn": null, 126 + "packageRef": { 127 + "identity": "version", 128 + "kind": "remoteSourceControl", 129 + "location": "https://github.com/mxcl/Version", 130 + "name": "Version" 131 + }, 132 + "state": { 133 + "checkoutState": { 134 + "revision": "a94b48f36763c05629fc102837398505032dead9", 135 + "version": "2.0.0" 136 + }, 137 + "name": "sourceControlCheckout" 138 + }, 139 + "subpath": "Version" 140 + }, 141 + { 142 + "basedOn": null, 143 + "packageRef": { 144 + "identity": "xcodeproj", 145 + "kind": "remoteSourceControl", 146 + "location": "https://github.com/tuist/XcodeProj.git", 147 + "name": "XcodeProj" 148 + }, 149 + "state": { 150 + "checkoutState": { 151 + "revision": "447c159b0c5fb047a024fd8d942d4a76cf47dde0", 152 + "version": "8.16.0" 153 + }, 154 + "name": "sourceControlCheckout" 155 + }, 156 + "subpath": "XcodeProj" 157 + }, 158 + { 159 + "basedOn": null, 160 + "packageRef": { 161 + "identity": "yams", 162 + "kind": "remoteSourceControl", 163 + "location": "https://github.com/jpsim/Yams.git", 164 + "name": "Yams" 165 + }, 166 + "state": { 167 + "checkoutState": { 168 + "revision": "01835dc202670b5bb90d07f3eae41867e9ed29f6", 169 + "version": "5.0.1" 170 + }, 171 + "name": "sourceControlCheckout" 172 + }, 173 + "subpath": "Yams" 174 + } 175 + ] 176 + }, 177 + "version": 6 178 + }
+76
pkgs/by-name/xc/xcodegen/package.nix
··· 1 + { 2 + lib, 3 + swiftPackages, 4 + swift, 5 + swiftpm, 6 + swiftpm2nix, 7 + fetchFromGitHub, 8 + versionCheckHook, 9 + nix-update-script, 10 + ... 11 + }: 12 + 13 + let 14 + # Pass the generated files to the helper. 15 + generated = swiftpm2nix.helpers ./nix; 16 + in 17 + 18 + swiftPackages.stdenv.mkDerivation (finalAttrs: { 19 + pname = "xcodegen"; 20 + version = "2.42.0"; 21 + 22 + src = fetchFromGitHub { 23 + owner = "yonaskolb"; 24 + repo = "XcodeGen"; 25 + tag = finalAttrs.version; 26 + hash = "sha256-wcjmADG+XnS2kR8BHe6ijApomucS9Tx7ZRjWZmTCUiI="; 27 + }; 28 + 29 + # Including SwiftPM as a nativeBuildInput provides a buildPhase for you. 30 + # This by default performs a release build using SwiftPM, essentially: 31 + # swift build -c release 32 + nativeBuildInputs = [ 33 + swift 34 + swiftpm 35 + ]; 36 + 37 + buildInputs = [ 38 + swiftPackages.XCTest 39 + ]; 40 + 41 + # The helper provides a configure snippet that will prepare all dependencies 42 + # in the correct place, where SwiftPM expects them. 43 + configurePhase = 44 + generated.configure 45 + + '' 46 + # Replace the dependency symlink with a writable copy 47 + swiftpmMakeMutable Spectre 48 + # Now apply a patch 49 + patch -p1 -d .build/checkouts/Spectre -i ${./0001-spectre-xct-record.patch} 50 + ''; 51 + 52 + installPhase = '' 53 + mkdir -p $out/bin 54 + cp "$(swiftpmBinPath)/${finalAttrs.pname}" $out/bin/ 55 + ''; 56 + 57 + nativeInstallCheckInputs = [ 58 + versionCheckHook 59 + ]; 60 + versionCheckProgramArg = [ "--version" ]; 61 + doInstallCheck = true; 62 + 63 + passthru = { 64 + updateScript = nix-update-script { }; 65 + }; 66 + 67 + meta = { 68 + description = "Swift command line tool for generating your Xcode project"; 69 + homepage = "https://github.com/yonaskolb/XcodeGen"; 70 + changelog = "https://github.com/XcodeGen/blob/${finalAttrs.version}/CHANGELOG.md"; 71 + license = lib.licenses.mit; 72 + platforms = lib.platforms.darwin; 73 + maintainers = [ lib.maintainers.samasaur ]; 74 + mainProgram = "xcodegen"; 75 + }; 76 + })