summaryrefslogtreecommitdiff
path: root/dev-util/codegraph/codegraph-1.6.0.ebuild
blob: e4c8acb6840bcb3f8b116e306d8ffa340cfe8a5b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
# Copyright 1999-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

CRATES="
	aho-corasick@1.1.4
	bitflags@2.13.1
	block-buffer@0.10.4
	cc@1.2.67
	cfg-if@1.0.4
	convert_case@0.11.0
	cpufeatures@0.2.17
	crypto-common@0.1.7
	ctor@1.0.9
	digest@0.10.7
	equivalent@1.0.2
	find-msvc-tools@0.1.9
	futures-channel@0.3.32
	futures-core@0.3.32
	futures-executor@0.3.32
	futures-io@0.3.32
	futures-macro@0.3.32
	futures-sink@0.3.32
	futures-task@0.3.32
	futures-util@0.3.32
	futures@0.3.32
	generic-array@0.14.7
	hashbrown@0.17.1
	indexmap@2.14.0
	itoa@1.0.18
	libc@0.2.186
	libloading@0.9.0
	memchr@2.8.3
	napi-build@2.3.2
	napi-derive-backend@5.1.2
	napi-derive@3.5.10
	napi-sys@3.2.3
	napi@3.10.5
	nohash-hasher@0.2.0
	pin-project-lite@0.2.17
	proc-macro2@1.0.106
	quote@1.0.46
	regex-automata@0.4.16
	regex-syntax@0.8.11
	regex@1.13.1
	rustc-hash@2.1.3
	semver@1.0.28
	serde@1.0.228
	serde_core@1.0.228
	serde_derive@1.0.228
	serde_json@1.0.150
	sha2@0.10.9
	shlex@2.0.1
	slab@0.4.12
	streaming-iterator@0.1.9
	syn@2.0.119
	tree-sitter-c-sharp@0.23.5
	tree-sitter-c@0.24.2
	tree-sitter-cpp@0.23.4
	tree-sitter-go@0.23.4
	tree-sitter-java@0.23.5
	tree-sitter-javascript@0.25.0
	tree-sitter-language@0.1.7
	tree-sitter-luau@1.2.0
	tree-sitter-php@0.24.2
	tree-sitter-python@0.23.6
	tree-sitter-r@1.2.0
	tree-sitter-ruby@0.23.1
	tree-sitter-rust@0.24.2
	tree-sitter-swift@0.7.3
	tree-sitter-typescript@0.23.2
	tree-sitter@0.25.10
	typenum@1.20.1
	unicode-ident@1.0.24
	unicode-segmentation@1.13.3
	version_check@0.9.5
	windows-link@0.2.1
	zmij@1.0.23
"
RUST_MIN_VER="1.88.0"

inherit cargo multilib

DESCRIPTION="Local code knowledge graph and MCP server for AI coding assistants"
HOMEPAGE="https://github.com/colbymchenry/codegraph"
# Generated from package-lock.json; keep tarballs in Portage's fetch phase.
NPM_SRC_URI="
	https://registry.npmjs.org/@clack/core/-/core-1.3.0.tgz -> codegraph-npm-clack-core-core-1.3.0.tgz
	https://registry.npmjs.org/@clack/prompts/-/prompts-1.3.0.tgz -> codegraph-npm-clack-prompts-prompts-1.3.0.tgz
	https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.5.tgz -> codegraph-npm-esbuild-aix-ppc64-aix-ppc64-0.21.5.tgz
	https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.21.5.tgz -> codegraph-npm-esbuild-android-arm-android-arm-0.21.5.tgz
	https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.21.5.tgz -> codegraph-npm-esbuild-android-arm64-android-arm64-0.21.5.tgz
	https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.21.5.tgz -> codegraph-npm-esbuild-android-x64-android-x64-0.21.5.tgz
	https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.21.5.tgz -> codegraph-npm-esbuild-darwin-arm64-darwin-arm64-0.21.5.tgz
	https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.21.5.tgz -> codegraph-npm-esbuild-darwin-x64-darwin-x64-0.21.5.tgz
	https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.5.tgz -> codegraph-npm-esbuild-freebsd-arm64-freebsd-arm64-0.21.5.tgz
	https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.21.5.tgz -> codegraph-npm-esbuild-freebsd-x64-freebsd-x64-0.21.5.tgz
	https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.21.5.tgz -> codegraph-npm-esbuild-linux-arm-linux-arm-0.21.5.tgz
	https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.21.5.tgz -> codegraph-npm-esbuild-linux-arm64-linux-arm64-0.21.5.tgz
	https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.21.5.tgz -> codegraph-npm-esbuild-linux-ia32-linux-ia32-0.21.5.tgz
	https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.21.5.tgz -> codegraph-npm-esbuild-linux-loong64-linux-loong64-0.21.5.tgz
	https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.21.5.tgz -> codegraph-npm-esbuild-linux-mips64el-linux-mips64el-0.21.5.tgz
	https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.21.5.tgz -> codegraph-npm-esbuild-linux-ppc64-linux-ppc64-0.21.5.tgz
	https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.21.5.tgz -> codegraph-npm-esbuild-linux-riscv64-linux-riscv64-0.21.5.tgz
	https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.21.5.tgz -> codegraph-npm-esbuild-linux-s390x-linux-s390x-0.21.5.tgz
	https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.21.5.tgz -> codegraph-npm-esbuild-linux-x64-linux-x64-0.21.5.tgz
	https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.21.5.tgz -> codegraph-npm-esbuild-netbsd-x64-netbsd-x64-0.21.5.tgz
	https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.21.5.tgz -> codegraph-npm-esbuild-openbsd-x64-openbsd-x64-0.21.5.tgz
	https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.21.5.tgz -> codegraph-npm-esbuild-sunos-x64-sunos-x64-0.21.5.tgz
	https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.21.5.tgz -> codegraph-npm-esbuild-win32-arm64-win32-arm64-0.21.5.tgz
	https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.21.5.tgz -> codegraph-npm-esbuild-win32-ia32-win32-ia32-0.21.5.tgz
	https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.21.5.tgz -> codegraph-npm-esbuild-win32-x64-win32-x64-0.21.5.tgz
	https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz -> codegraph-npm-jridgewell-sourcemap-codec-sourcemap-codec-1.5.5.tgz
	https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.57.1.tgz -> codegraph-npm-rollup-rollup-android-arm-eabi-rollup-android-arm-eabi-4.57.1.tgz
	https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.57.1.tgz -> codegraph-npm-rollup-rollup-android-arm64-rollup-android-arm64-4.57.1.tgz
	https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.57.1.tgz -> codegraph-npm-rollup-rollup-darwin-arm64-rollup-darwin-arm64-4.57.1.tgz
	https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.57.1.tgz -> codegraph-npm-rollup-rollup-darwin-x64-rollup-darwin-x64-4.57.1.tgz
	https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.57.1.tgz -> codegraph-npm-rollup-rollup-freebsd-arm64-rollup-freebsd-arm64-4.57.1.tgz
	https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.57.1.tgz -> codegraph-npm-rollup-rollup-freebsd-x64-rollup-freebsd-x64-4.57.1.tgz
	https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.57.1.tgz -> codegraph-npm-rollup-rollup-linux-arm-gnueabihf-rollup-linux-arm-gnueabihf-4.57.1.tgz
	https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.57.1.tgz -> codegraph-npm-rollup-rollup-linux-arm-musleabihf-rollup-linux-arm-musleabihf-4.57.1.tgz
	https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.57.1.tgz -> codegraph-npm-rollup-rollup-linux-arm64-gnu-rollup-linux-arm64-gnu-4.57.1.tgz
	https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.57.1.tgz -> codegraph-npm-rollup-rollup-linux-arm64-musl-rollup-linux-arm64-musl-4.57.1.tgz
	https://registry.npmjs.org/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.57.1.tgz -> codegraph-npm-rollup-rollup-linux-loong64-gnu-rollup-linux-loong64-gnu-4.57.1.tgz
	https://registry.npmjs.org/@rollup/rollup-linux-loong64-musl/-/rollup-linux-loong64-musl-4.57.1.tgz -> codegraph-npm-rollup-rollup-linux-loong64-musl-rollup-linux-loong64-musl-4.57.1.tgz
	https://registry.npmjs.org/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.57.1.tgz -> codegraph-npm-rollup-rollup-linux-ppc64-gnu-rollup-linux-ppc64-gnu-4.57.1.tgz
	https://registry.npmjs.org/@rollup/rollup-linux-ppc64-musl/-/rollup-linux-ppc64-musl-4.57.1.tgz -> codegraph-npm-rollup-rollup-linux-ppc64-musl-rollup-linux-ppc64-musl-4.57.1.tgz
	https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.57.1.tgz -> codegraph-npm-rollup-rollup-linux-riscv64-gnu-rollup-linux-riscv64-gnu-4.57.1.tgz
	https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.57.1.tgz -> codegraph-npm-rollup-rollup-linux-riscv64-musl-rollup-linux-riscv64-musl-4.57.1.tgz
	https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.57.1.tgz -> codegraph-npm-rollup-rollup-linux-s390x-gnu-rollup-linux-s390x-gnu-4.57.1.tgz
	https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.57.1.tgz -> codegraph-npm-rollup-rollup-linux-x64-gnu-rollup-linux-x64-gnu-4.57.1.tgz
	https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.57.1.tgz -> codegraph-npm-rollup-rollup-linux-x64-musl-rollup-linux-x64-musl-4.57.1.tgz
	https://registry.npmjs.org/@rollup/rollup-openbsd-x64/-/rollup-openbsd-x64-4.57.1.tgz -> codegraph-npm-rollup-rollup-openbsd-x64-rollup-openbsd-x64-4.57.1.tgz
	https://registry.npmjs.org/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.57.1.tgz -> codegraph-npm-rollup-rollup-openharmony-arm64-rollup-openharmony-arm64-4.57.1.tgz
	https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.57.1.tgz -> codegraph-npm-rollup-rollup-win32-arm64-msvc-rollup-win32-arm64-msvc-4.57.1.tgz
	https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.57.1.tgz -> codegraph-npm-rollup-rollup-win32-ia32-msvc-rollup-win32-ia32-msvc-4.57.1.tgz
	https://registry.npmjs.org/@rollup/rollup-win32-x64-gnu/-/rollup-win32-x64-gnu-4.57.1.tgz -> codegraph-npm-rollup-rollup-win32-x64-gnu-rollup-win32-x64-gnu-4.57.1.tgz
	https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.57.1.tgz -> codegraph-npm-rollup-rollup-win32-x64-msvc-rollup-win32-x64-msvc-4.57.1.tgz
	https://registry.npmjs.org/@types/better-sqlite3/-/better-sqlite3-7.6.13.tgz -> codegraph-npm-types-better-sqlite3-better-sqlite3-7.6.13.tgz
	https://registry.npmjs.org/@types/estree/-/estree-1.0.8.tgz -> codegraph-npm-types-estree-estree-1.0.8.tgz
	https://registry.npmjs.org/@types/node/-/node-20.19.33.tgz -> codegraph-npm-types-node-node-20.19.33.tgz
	https://registry.npmjs.org/@types/picomatch/-/picomatch-4.0.2.tgz -> codegraph-npm-types-picomatch-picomatch-4.0.2.tgz
	https://registry.npmjs.org/@vitest/expect/-/expect-2.1.9.tgz -> codegraph-npm-vitest-expect-expect-2.1.9.tgz
	https://registry.npmjs.org/@vitest/mocker/-/mocker-2.1.9.tgz -> codegraph-npm-vitest-mocker-mocker-2.1.9.tgz
	https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-2.1.9.tgz -> codegraph-npm-vitest-pretty-format-pretty-format-2.1.9.tgz
	https://registry.npmjs.org/@vitest/runner/-/runner-2.1.9.tgz -> codegraph-npm-vitest-runner-runner-2.1.9.tgz
	https://registry.npmjs.org/@vitest/snapshot/-/snapshot-2.1.9.tgz -> codegraph-npm-vitest-snapshot-snapshot-2.1.9.tgz
	https://registry.npmjs.org/@vitest/spy/-/spy-2.1.9.tgz -> codegraph-npm-vitest-spy-spy-2.1.9.tgz
	https://registry.npmjs.org/@vitest/utils/-/utils-2.1.9.tgz -> codegraph-npm-vitest-utils-utils-2.1.9.tgz
	https://registry.npmjs.org/assertion-error/-/assertion-error-2.0.1.tgz -> codegraph-npm-assertion-error-assertion-error-2.0.1.tgz
	https://registry.npmjs.org/cac/-/cac-6.7.14.tgz -> codegraph-npm-cac-cac-6.7.14.tgz
	https://registry.npmjs.org/chai/-/chai-5.3.3.tgz -> codegraph-npm-chai-chai-5.3.3.tgz
	https://registry.npmjs.org/check-error/-/check-error-2.1.3.tgz -> codegraph-npm-check-error-check-error-2.1.3.tgz
	https://registry.npmjs.org/commander/-/commander-14.0.3.tgz -> codegraph-npm-commander-commander-14.0.3.tgz
	https://registry.npmjs.org/debug/-/debug-4.4.3.tgz -> codegraph-npm-debug-debug-4.4.3.tgz
	https://registry.npmjs.org/deep-eql/-/deep-eql-5.0.2.tgz -> codegraph-npm-deep-eql-deep-eql-5.0.2.tgz
	https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.7.0.tgz -> codegraph-npm-es-module-lexer-es-module-lexer-1.7.0.tgz
	https://registry.npmjs.org/esbuild/-/esbuild-0.21.5.tgz -> codegraph-npm-esbuild-esbuild-0.21.5.tgz
	https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz -> codegraph-npm-estree-walker-estree-walker-3.0.3.tgz
	https://registry.npmjs.org/expect-type/-/expect-type-1.3.0.tgz -> codegraph-npm-expect-type-expect-type-1.3.0.tgz
	https://registry.npmjs.org/fast-string-truncated-width/-/fast-string-truncated-width-3.0.3.tgz -> codegraph-npm-fast-string-truncated-width-fast-string-truncated-width-3.0.3.tgz
	https://registry.npmjs.org/fast-string-width/-/fast-string-width-3.0.2.tgz -> codegraph-npm-fast-string-width-fast-string-width-3.0.2.tgz
	https://registry.npmjs.org/fast-wrap-ansi/-/fast-wrap-ansi-0.2.0.tgz -> codegraph-npm-fast-wrap-ansi-fast-wrap-ansi-0.2.0.tgz
	https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz -> codegraph-npm-fsevents-fsevents-2.3.3.tgz
	https://registry.npmjs.org/ignore/-/ignore-7.0.5.tgz -> codegraph-npm-ignore-ignore-7.0.5.tgz
	https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.3.1.tgz -> codegraph-npm-jsonc-parser-jsonc-parser-3.3.1.tgz
	https://registry.npmjs.org/loupe/-/loupe-3.2.1.tgz -> codegraph-npm-loupe-loupe-3.2.1.tgz
	https://registry.npmjs.org/magic-string/-/magic-string-0.30.21.tgz -> codegraph-npm-magic-string-magic-string-0.30.21.tgz
	https://registry.npmjs.org/ms/-/ms-2.1.3.tgz -> codegraph-npm-ms-ms-2.1.3.tgz
	https://registry.npmjs.org/nanoid/-/nanoid-3.3.11.tgz -> codegraph-npm-nanoid-nanoid-3.3.11.tgz
	https://registry.npmjs.org/pathe/-/pathe-1.1.2.tgz -> codegraph-npm-pathe-pathe-1.1.2.tgz
	https://registry.npmjs.org/pathval/-/pathval-2.0.1.tgz -> codegraph-npm-pathval-pathval-2.0.1.tgz
	https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz -> codegraph-npm-picocolors-picocolors-1.1.1.tgz
	https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz -> codegraph-npm-picomatch-picomatch-4.0.3.tgz
	https://registry.npmjs.org/postcss/-/postcss-8.5.6.tgz -> codegraph-npm-postcss-postcss-8.5.6.tgz
	https://registry.npmjs.org/rollup/-/rollup-4.57.1.tgz -> codegraph-npm-rollup-rollup-4.57.1.tgz
	https://registry.npmjs.org/siginfo/-/siginfo-2.0.0.tgz -> codegraph-npm-siginfo-siginfo-2.0.0.tgz
	https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz -> codegraph-npm-sisteransi-sisteransi-1.0.5.tgz
	https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz -> codegraph-npm-source-map-js-source-map-js-1.2.1.tgz
	https://registry.npmjs.org/stackback/-/stackback-0.0.2.tgz -> codegraph-npm-stackback-stackback-0.0.2.tgz
	https://registry.npmjs.org/std-env/-/std-env-3.10.0.tgz -> codegraph-npm-std-env-std-env-3.10.0.tgz
	https://registry.npmjs.org/tinybench/-/tinybench-2.9.0.tgz -> codegraph-npm-tinybench-tinybench-2.9.0.tgz
	https://registry.npmjs.org/tinyexec/-/tinyexec-0.3.2.tgz -> codegraph-npm-tinyexec-tinyexec-0.3.2.tgz
	https://registry.npmjs.org/tinypool/-/tinypool-1.1.1.tgz -> codegraph-npm-tinypool-tinypool-1.1.1.tgz
	https://registry.npmjs.org/tinyrainbow/-/tinyrainbow-1.2.0.tgz -> codegraph-npm-tinyrainbow-tinyrainbow-1.2.0.tgz
	https://registry.npmjs.org/tinyspy/-/tinyspy-3.0.2.tgz -> codegraph-npm-tinyspy-tinyspy-3.0.2.tgz
	https://registry.npmjs.org/tree-sitter-wasms/-/tree-sitter-wasms-0.1.13.tgz -> codegraph-npm-tree-sitter-wasms-tree-sitter-wasms-0.1.13.tgz
	https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz -> codegraph-npm-typescript-typescript-5.9.3.tgz
	https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz -> codegraph-npm-undici-types-undici-types-6.21.0.tgz
	https://registry.npmjs.org/vite-node/-/vite-node-2.1.9.tgz -> codegraph-npm-vite-node-vite-node-2.1.9.tgz
	https://registry.npmjs.org/vite/-/vite-5.4.21.tgz -> codegraph-npm-vite-vite-5.4.21.tgz
	https://registry.npmjs.org/vitest/-/vitest-2.1.9.tgz -> codegraph-npm-vitest-vitest-2.1.9.tgz
	https://registry.npmjs.org/web-tree-sitter/-/web-tree-sitter-0.25.10.tgz -> codegraph-npm-web-tree-sitter-web-tree-sitter-0.25.10.tgz
	https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-2.3.0.tgz -> codegraph-npm-why-is-node-running-why-is-node-running-2.3.0.tgz
"
SRC_URI="
	${HOMEPAGE}/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz
	${NPM_SRC_URI}
	${CARGO_CRATE_URIS}
"

LICENSE="Apache-2.0 BSD ISC MIT Unicode-3.0 Unlicense"
SLOT="0"
KEYWORDS="~amd64 ~arm64"

# The CLI blocks Node >=25; node:sqlite needs a recent Node 22 or Node 24.
RDEPEND="
	dev-vcs/git
	>=net-libs/nodejs-22.13.0
	<net-libs/nodejs-25
"
BDEPEND="
	>=net-libs/nodejs-22.13.0[npm]
	<net-libs/nodejs-25
"

src_unpack() {
	# npm consumes its archives directly when populating the offline cache.
	local archive
	local -a cargo_archives=()
	for archive in ${A}; do
		[[ ${archive} == ${PN}-npm-*.tgz ]] || cargo_archives+=( "${archive}" )
	done
	local A="${cargo_archives[*]}"
	cargo_src_unpack
}

src_prepare() {
	default

	# Let Portage control stripping of the native library.
	sed -i '/^strip = "symbols"$/d' codegraph-kernel/Cargo.toml || die
}

src_configure() {
	export npm_config_cache="${T}/npm-cache"
	export npm_config_audit=false
	export npm_config_fund=false
	export npm_config_update_notifier=false
	export npm_config_progress=false

	local archive
	for archive in ${A}; do
		[[ ${archive} == ${PN}-npm-*.tgz ]] || continue
		npm cache add --offline --ignore-scripts "${DISTDIR}/${archive}" \
			|| die "Failed to cache ${archive}"
	done
	npm ci --offline --ignore-scripts || die "Offline npm install failed"
	cargo_src_configure --manifest-path "${S}/codegraph-kernel/Cargo.toml"
}

src_compile() {
	npm run build || die "TypeScript build failed"
	pushd codegraph-kernel > /dev/null || die
	cargo_src_compile
	mkdir -p "${S}/kernel" || die
	cp "$(cargo_target_dir)/libcodegraph_kernel.so" "${S}/kernel/codegraph-kernel.node" || die
	popd > /dev/null || die
}

src_test() {
	export DO_NOT_TRACK=1
	export CODEGRAPH_KERNEL_PATH="${S}/kernel/codegraph-kernel.node"
	export CODEGRAPH_KERNEL_EXPECT=1
	# Upstream tests also check their development staging path directly.
	local kernel_dir="codegraph-kernel/prebuilds/$(node -p 'process.platform + "-" + process.arch')"
	mkdir -p "${kernel_dir}" || die
	ln -sf "${CODEGRAPH_KERNEL_PATH}" "${kernel_dir}/codegraph-kernel.node" || die
	# Exercise the native loader, parser parity and SQLite backend without
	# the full suite's agent installations and external-tool integrations.
	node --liftoff-only --disable-warning=ExperimentalWarning \
		node_modules/vitest/vitest.mjs run --maxWorkers=2 --minWorkers=1 \
		__tests__/kernel-scaffold.test.ts \
		__tests__/kernel-tsjs-parity.test.ts \
		__tests__/node-sqlite-backend.test.ts || die "Runtime tests failed"
}

src_install() {
	npm prune --omit=dev --offline --ignore-scripts || die "npm prune failed"
	insinto "/usr/$(get_libdir)/${PN}"
	doins -r dist kernel node_modules package.json

	sed "s|@LIBDIR@|${EPREFIX}/usr/$(get_libdir)|g; s|@EPREFIX@|${EPREFIX}|g" \
		"${FILESDIR}/${PN}" > "${T}/${PN}" || die
	dobin "${T}/${PN}"
	dodoc README.md LICENSE
}

pkg_postinst() {
	elog "Run 'codegraph install' as your user to configure your coding assistants."
	elog "Run 'codegraph init' in a project to build its code graph."
	elog "Update this package with Portage instead of 'codegraph upgrade'."
}