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