sourcekit-lsp: init at 5.7

+438 -1
+4
pkgs/development/compilers/swift/default.nix
··· 88 88 swift = swift-unwrapped; 89 89 }; 90 90 91 + sourcekit-lsp = callPackage ./sourcekit-lsp { 92 + inherit (apple_sdk.frameworks) CryptoKit LocalAuthentication; 93 + }; 94 + 91 95 }; 92 96 93 97 in self
+74
pkgs/development/compilers/swift/sourcekit-lsp/default.nix
··· 1 + { lib 2 + , stdenv 3 + , callPackage 4 + , fetchFromGitHub 5 + , swift 6 + , swiftpm 7 + , Foundation 8 + , XCTest 9 + , sqlite 10 + , ncurses 11 + , CryptoKit 12 + , LocalAuthentication 13 + }: 14 + let 15 + # Generated by swiftpm2nix. 16 + generated = callPackage ./generated { }; 17 + 18 + # On Darwin, we only want ncurses in the linker search path, because headers 19 + # are part of libsystem. Adding its headers to the search path causes strange 20 + # mixing and errors. 21 + # TODO: Find a better way to prevent this conflict. 22 + ncursesInput = if stdenv.isDarwin then ncurses.out else ncurses; 23 + in 24 + stdenv.mkDerivation rec { 25 + pname = "sourcekit-lsp"; 26 + 27 + # Releases are made as part of the Swift toolchain, so versions should match. 28 + version = "5.7"; 29 + src = fetchFromGitHub { 30 + owner = "apple"; 31 + repo = "sourcekit-lsp"; 32 + rev = "swift-${version}-RELEASE"; 33 + hash = "sha256-uA3a+kAqI+XFzkDFEJ8XuRTgfYqacEuTsOU289Im+0Y="; 34 + }; 35 + 36 + nativeBuildInputs = [ swift swiftpm ]; 37 + buildInputs = [ 38 + Foundation 39 + XCTest 40 + sqlite 41 + ncursesInput 42 + ] 43 + ++ lib.optionals stdenv.isDarwin [ CryptoKit LocalAuthentication ]; 44 + 45 + configurePhase = generated.configure + '' 46 + swiftpmMakeMutable indexstore-db 47 + patch -p1 -d .build/checkouts/indexstore-db -i ${./patches/indexstore-db-macos-target.patch} 48 + 49 + # This toggles a section specific to Xcode XCTest, which doesn't work on 50 + # Darwin, where we also use swift-corelibs-xctest. 51 + substituteInPlace Sources/LSPTestSupport/PerfTestCase.swift \ 52 + --replace '#if os(macOS)' '#if false' 53 + 54 + # Required to link with swift-corelibs-xctest on Darwin. 55 + export SWIFTTSC_MACOS_DEPLOYMENT_TARGET=10.12 56 + ''; 57 + 58 + # TODO: BuildServerBuildSystemTests fails 59 + #doCheck = true; 60 + 61 + installPhase = '' 62 + binPath="$(swiftpmBinPath)" 63 + mkdir -p $out/bin 64 + cp $binPath/sourcekit-lsp $out/bin/ 65 + ''; 66 + 67 + meta = { 68 + description = "Language Server Protocol implementation for Swift and C-based languages"; 69 + homepage = "https://github.com/apple/sourcekit-lsp"; 70 + platforms = with lib.platforms; linux ++ darwin; 71 + license = lib.licenses.asl20; 72 + maintainers = with lib.maintainers; [ dtzWill trepetti dduan trundle stephank ]; 73 + }; 74 + }
+97
pkgs/development/compilers/swift/sourcekit-lsp/generated/Package.resolved
··· 1 + { 2 + "object": { 3 + "pins": [ 4 + { 5 + "package": "IndexStoreDB", 6 + "repositoryURL": "https://github.com/apple/indexstore-db.git", 7 + "state": { 8 + "branch": "main", 9 + "revision": "2ff1c0491248cd958a2ac05da9aa613eb27a8eeb", 10 + "version": null 11 + } 12 + }, 13 + { 14 + "package": "swift-argument-parser", 15 + "repositoryURL": "https://github.com/apple/swift-argument-parser.git", 16 + "state": { 17 + "branch": null, 18 + "revision": "e394bf350e38cb100b6bc4172834770ede1b7232", 19 + "version": "1.0.3" 20 + } 21 + }, 22 + { 23 + "package": "swift-collections", 24 + "repositoryURL": "https://github.com/apple/swift-collections.git", 25 + "state": { 26 + "branch": null, 27 + "revision": "f504716c27d2e5d4144fa4794b12129301d17729", 28 + "version": "1.0.3" 29 + } 30 + }, 31 + { 32 + "package": "swift-crypto", 33 + "repositoryURL": "https://github.com/apple/swift-crypto.git", 34 + "state": { 35 + "branch": null, 36 + "revision": "ddb07e896a2a8af79512543b1c7eb9797f8898a5", 37 + "version": "1.1.7" 38 + } 39 + }, 40 + { 41 + "package": "swift-driver", 42 + "repositoryURL": "https://github.com/apple/swift-driver.git", 43 + "state": { 44 + "branch": "main", 45 + "revision": "6c71f58f89d65eb79f1f6b32a707ddc39cec5ad6", 46 + "version": null 47 + } 48 + }, 49 + { 50 + "package": "llbuild", 51 + "repositoryURL": "https://github.com/apple/swift-llbuild.git", 52 + "state": { 53 + "branch": "main", 54 + "revision": "d99c31577c60a247b065d29289a44fbdd141e2be", 55 + "version": null 56 + } 57 + }, 58 + { 59 + "package": "SwiftPM", 60 + "repositoryURL": "https://github.com/apple/swift-package-manager.git", 61 + "state": { 62 + "branch": "main", 63 + "revision": "f04ad469a6053d713c2fb854fbeb27ee3e6c9dee", 64 + "version": null 65 + } 66 + }, 67 + { 68 + "package": "swift-system", 69 + "repositoryURL": "https://github.com/apple/swift-system.git", 70 + "state": { 71 + "branch": null, 72 + "revision": "836bc4557b74fe6d2660218d56e3ce96aff76574", 73 + "version": "1.1.1" 74 + } 75 + }, 76 + { 77 + "package": "swift-tools-support-core", 78 + "repositoryURL": "https://github.com/apple/swift-tools-support-core.git", 79 + "state": { 80 + "branch": "main", 81 + "revision": "0220fc394f2ae820eeacd754fb2c7ce211e9979e", 82 + "version": null 83 + } 84 + }, 85 + { 86 + "package": "Yams", 87 + "repositoryURL": "https://github.com/jpsim/Yams.git", 88 + "state": { 89 + "branch": null, 90 + "revision": "01835dc202670b5bb90d07f3eae41867e9ed29f6", 91 + "version": "5.0.1" 92 + } 93 + } 94 + ] 95 + }, 96 + "version": 1 97 + }
+72
pkgs/development/compilers/swift/sourcekit-lsp/generated/default.nix
··· 1 + # This file was generated by swiftpm2nix. 2 + { lib, fetchgit }: rec { 3 + sources = { 4 + "indexstore-db" = fetchgit { 5 + url = "https://github.com/apple/indexstore-db.git"; 6 + rev = "2ff1c0491248cd958a2ac05da9aa613eb27a8eeb"; 7 + sha256 = "005vvkrncgpryzrn0hzgsapflpyga0n7152b2b565wislpx90cwl"; 8 + }; 9 + "swift-argument-parser" = fetchgit { 10 + url = "https://github.com/apple/swift-argument-parser.git"; 11 + rev = "e394bf350e38cb100b6bc4172834770ede1b7232"; 12 + sha256 = "1jph9w7lk9nr20fsv2c8p4hisx3dda817fh7pybd0r0j1jwa9nmw"; 13 + }; 14 + "swift-collections" = fetchgit { 15 + url = "https://github.com/apple/swift-collections.git"; 16 + rev = "f504716c27d2e5d4144fa4794b12129301d17729"; 17 + sha256 = "0l0pv16zil3n7fac7mdf5qxklxr5rwiig5bixgca1ybq7arlnv7i"; 18 + }; 19 + "swift-crypto" = fetchgit { 20 + url = "https://github.com/apple/swift-crypto.git"; 21 + rev = "ddb07e896a2a8af79512543b1c7eb9797f8898a5"; 22 + sha256 = "020b8q4ss2k7a65r5dgh59z40i6sn7ij1allxkh8c8a9d0jzn313"; 23 + }; 24 + "swift-driver" = fetchgit { 25 + url = "https://github.com/apple/swift-driver.git"; 26 + rev = "6c71f58f89d65eb79f1f6b32a707ddc39cec5ad6"; 27 + sha256 = "0nblvs47kh2hl1l70rmrbablx4m5i27w8l3dfrv2h7zccqr8jl0a"; 28 + }; 29 + "swift-llbuild" = fetchgit { 30 + url = "https://github.com/apple/swift-llbuild.git"; 31 + rev = "d99c31577c60a247b065d29289a44fbdd141e2be"; 32 + sha256 = "1bvqbj8ji72ilh3ah2mw411jwzbbjxjyasa6sg4b8da0kqia4021"; 33 + }; 34 + "swift-package-manager" = fetchgit { 35 + url = "https://github.com/apple/swift-package-manager.git"; 36 + rev = "f04ad469a6053d713c2fb854fbeb27ee3e6c9dee"; 37 + sha256 = "16qvk14f1l0hf5bphx6qk51nn9d36a2iw5v3sgkvmqi8h7l4kqg5"; 38 + }; 39 + "swift-system" = fetchgit { 40 + url = "https://github.com/apple/swift-system.git"; 41 + rev = "836bc4557b74fe6d2660218d56e3ce96aff76574"; 42 + sha256 = "0402hkx2q2dv27gccnn8ma79ngvwiwzkhcv4zlcdldmy6cgi0px7"; 43 + }; 44 + "swift-tools-support-core" = fetchgit { 45 + url = "https://github.com/apple/swift-tools-support-core.git"; 46 + rev = "0220fc394f2ae820eeacd754fb2c7ce211e9979e"; 47 + sha256 = "1ryd5iyx5mfv8bhyq3bf08z7nv886chzzqnmwaj16r2cry9yml7c"; 48 + }; 49 + "Yams" = fetchgit { 50 + url = "https://github.com/jpsim/Yams.git"; 51 + rev = "01835dc202670b5bb90d07f3eae41867e9ed29f6"; 52 + sha256 = "11abhcfkmqm3cmh7vp7rqzvxd1zj02j2866a2pp6v9m89456xb76"; 53 + }; 54 + }; 55 + configure = '' 56 + mkdir -p .build/checkouts 57 + ln -sf ${./Package.resolved} ./Package.resolved 58 + install -m 0600 ${./workspace-state.json} ./.build/workspace-state.json 59 + '' 60 + + lib.concatStrings (lib.mapAttrsToList (name: src: '' 61 + ln -s '${src}' '.build/checkouts/${name}' 62 + '') sources) 63 + + '' 64 + # Helper that makes a swiftpm dependency mutable by copying the source. 65 + swiftpmMakeMutable() { 66 + local orig="$(readlink .build/checkouts/$1)" 67 + rm .build/checkouts/$1 68 + cp -r "$orig" .build/checkouts/$1 69 + chmod -R u+w .build/checkouts/$1 70 + } 71 + ''; 72 + }
+178
pkgs/development/compilers/swift/sourcekit-lsp/generated/workspace-state.json
··· 1 + { 2 + "object": { 3 + "artifacts": [], 4 + "dependencies": [ 5 + { 6 + "basedOn": null, 7 + "packageRef": { 8 + "identity": "indexstore-db", 9 + "kind": "remoteSourceControl", 10 + "location": "https://github.com/apple/indexstore-db.git", 11 + "name": "IndexStoreDB" 12 + }, 13 + "state": { 14 + "checkoutState": { 15 + "branch": "main", 16 + "revision": "2ff1c0491248cd958a2ac05da9aa613eb27a8eeb" 17 + }, 18 + "name": "sourceControlCheckout" 19 + }, 20 + "subpath": "indexstore-db" 21 + }, 22 + { 23 + "basedOn": null, 24 + "packageRef": { 25 + "identity": "swift-argument-parser", 26 + "kind": "remoteSourceControl", 27 + "location": "https://github.com/apple/swift-argument-parser.git", 28 + "name": "swift-argument-parser" 29 + }, 30 + "state": { 31 + "checkoutState": { 32 + "revision": "e394bf350e38cb100b6bc4172834770ede1b7232", 33 + "version": "1.0.3" 34 + }, 35 + "name": "sourceControlCheckout" 36 + }, 37 + "subpath": "swift-argument-parser" 38 + }, 39 + { 40 + "basedOn": null, 41 + "packageRef": { 42 + "identity": "swift-collections", 43 + "kind": "remoteSourceControl", 44 + "location": "https://github.com/apple/swift-collections.git", 45 + "name": "swift-collections" 46 + }, 47 + "state": { 48 + "checkoutState": { 49 + "revision": "f504716c27d2e5d4144fa4794b12129301d17729", 50 + "version": "1.0.3" 51 + }, 52 + "name": "sourceControlCheckout" 53 + }, 54 + "subpath": "swift-collections" 55 + }, 56 + { 57 + "basedOn": null, 58 + "packageRef": { 59 + "identity": "swift-crypto", 60 + "kind": "remoteSourceControl", 61 + "location": "https://github.com/apple/swift-crypto.git", 62 + "name": "swift-crypto" 63 + }, 64 + "state": { 65 + "checkoutState": { 66 + "revision": "ddb07e896a2a8af79512543b1c7eb9797f8898a5", 67 + "version": "1.1.7" 68 + }, 69 + "name": "sourceControlCheckout" 70 + }, 71 + "subpath": "swift-crypto" 72 + }, 73 + { 74 + "basedOn": null, 75 + "packageRef": { 76 + "identity": "swift-driver", 77 + "kind": "remoteSourceControl", 78 + "location": "https://github.com/apple/swift-driver.git", 79 + "name": "swift-driver" 80 + }, 81 + "state": { 82 + "checkoutState": { 83 + "branch": "main", 84 + "revision": "6c71f58f89d65eb79f1f6b32a707ddc39cec5ad6" 85 + }, 86 + "name": "sourceControlCheckout" 87 + }, 88 + "subpath": "swift-driver" 89 + }, 90 + { 91 + "basedOn": null, 92 + "packageRef": { 93 + "identity": "swift-llbuild", 94 + "kind": "remoteSourceControl", 95 + "location": "https://github.com/apple/swift-llbuild.git", 96 + "name": "llbuild" 97 + }, 98 + "state": { 99 + "checkoutState": { 100 + "branch": "main", 101 + "revision": "d99c31577c60a247b065d29289a44fbdd141e2be" 102 + }, 103 + "name": "sourceControlCheckout" 104 + }, 105 + "subpath": "swift-llbuild" 106 + }, 107 + { 108 + "basedOn": null, 109 + "packageRef": { 110 + "identity": "swift-package-manager", 111 + "kind": "remoteSourceControl", 112 + "location": "https://github.com/apple/swift-package-manager.git", 113 + "name": "SwiftPM" 114 + }, 115 + "state": { 116 + "checkoutState": { 117 + "branch": "main", 118 + "revision": "f04ad469a6053d713c2fb854fbeb27ee3e6c9dee" 119 + }, 120 + "name": "sourceControlCheckout" 121 + }, 122 + "subpath": "swift-package-manager" 123 + }, 124 + { 125 + "basedOn": null, 126 + "packageRef": { 127 + "identity": "swift-system", 128 + "kind": "remoteSourceControl", 129 + "location": "https://github.com/apple/swift-system.git", 130 + "name": "swift-system" 131 + }, 132 + "state": { 133 + "checkoutState": { 134 + "revision": "836bc4557b74fe6d2660218d56e3ce96aff76574", 135 + "version": "1.1.1" 136 + }, 137 + "name": "sourceControlCheckout" 138 + }, 139 + "subpath": "swift-system" 140 + }, 141 + { 142 + "basedOn": null, 143 + "packageRef": { 144 + "identity": "swift-tools-support-core", 145 + "kind": "remoteSourceControl", 146 + "location": "https://github.com/apple/swift-tools-support-core.git", 147 + "name": "swift-tools-support-core" 148 + }, 149 + "state": { 150 + "checkoutState": { 151 + "branch": "main", 152 + "revision": "0220fc394f2ae820eeacd754fb2c7ce211e9979e" 153 + }, 154 + "name": "sourceControlCheckout" 155 + }, 156 + "subpath": "swift-tools-support-core" 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": 5 178 + }
+12
pkgs/development/compilers/swift/sourcekit-lsp/patches/indexstore-db-macos-target.patch
··· 1 + Raise the deployment target of IndexStoreDB so it can link against our XCTest. 2 + 3 + --- a/Package.swift 4 + +++ b/Package.swift 5 + @@ -4,6 +4,7 @@ import PackageDescription 6 + 7 + let package = Package( 8 + name: "IndexStoreDB", 9 + + platforms: [.macOS("10.12")], 10 + products: [ 11 + .library( 12 + name: "IndexStoreDB",
+1 -1
pkgs/top-level/all-packages.nix
··· 15042 15042 svdtools = callPackage ../development/embedded/svdtools { }; 15043 15043 15044 15044 swiftPackages = recurseIntoAttrs (callPackage ../development/compilers/swift { }); 15045 - inherit (swiftPackages) swift swiftpm; 15045 + inherit (swiftPackages) swift swiftpm sourcekit-lsp; 15046 15046 15047 15047 swiftpm2nix = callPackage ../development/tools/swiftpm2nix { }; 15048 15048