projects/guix·blob python-team · refs

484 lines · 18.2 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2023 JOULAUD François <[email protected]>
3;;; Copyright © 2025 Maxim Cournoyer <[email protected]>
4;;; Copyright © 2025 Tomas Volf <[email protected]>
5;;; Copyright © 2025-2026 Sharlatan Hellseher <[email protected]>
6;;; Copyright © 2025 jgart <[email protected]>
7;;; Copyright © 2026 Ankit Gadiya <[email protected]>
8;;;
9;;; This file is part of GNU Guix.
10;;;
11;;; GNU Guix is free software; you can redistribute it and/or modify it
12;;; under the terms of the GNU General Public License as published by
13;;; the Free Software Foundation; either version 3 of the License, or (at
14;;; your option) any later version.
15;;;
16;;; GNU Guix is distributed in the hope that it will be useful, but
17;;; WITHOUT ANY WARRANTY; without even the implied warranty of
18;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19;;; GNU General Public License for more details.
20;;;
21;;; You should have received a copy of the GNU General Public License
22;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
23
24;;; Commentary:
25;;;
26;;; Golang (Go) specific applications which are not inherited from their
27;;; source live here e.g linters, language servers, REPL implementations etc.
28;;;
29;;; If the <cmd/APP> is inherited from its source place it in corresponded
30;;; golang-*.scm file in the end after the section "Executables".
31;;;
32;;; Please: Try to add new variable in alphabetical order.
33;;;
34;;; Code:
35
36(define-module (gnu packages golang-apps)
37 #:use-module (guix build-system go)
38 #:use-module (guix gexp)
39 #:use-module (guix git-download)
40 #:use-module ((guix licenses) #:prefix license:)
41 #:use-module (guix packages)
42 #:use-module (gnu packages)
43 #:use-module (gnu packages golang)
44 #:use-module (gnu packages golang-build)
45 #:use-module (gnu packages golang-check)
46 #:use-module (gnu packages golang-web)
47 #:use-module (gnu packages golang-xyz))
48
49
50(define-public go-chroma
51 (package
52 (name "go-chroma")
53 (version "2.27.0")
54 (source
55 (origin
56 (method git-fetch)
57 (uri (git-reference
58 (url "https://github.com/alecthomas/chroma")
59 (commit (string-append "v" version ))))
60 (file-name (git-file-name name version))
61 (sha256
62 (base32 "18p9inwlwkbsgi9frqhxhqqwdymnwm02iqpjdgk7dg8sa0ab92w8"))))
63 (build-system go-build-system)
64 (arguments
65 (list
66 #:install-source? #f
67 #:embed-files #~(list ".*\\.xml")
68 #:import-path "github.com/alecthomas/chroma/cmd/chroma"
69 #:unpack-path "github.com/alecthomas/chroma"))
70 (native-inputs
71 (list go-github-com-alecthomas-chroma-v2
72 go-github-com-alecthomas-kong
73 go-github-com-mattn-go-colorable
74 go-github-com-mattn-go-isatty))
75 (home-page "https://github.com/alecthomas/chroma")
76 (synopsis "General purpose syntax highlighter")
77 (description
78 "This package implements a syntax highlighter for a long list of
79programming languages. It takes source code and other structured text and
80converts it into syntax highlighted HTML, ANSI-coloured text, etc. Chroma is
81based heavily on @url{http://pygments.org/, Pygments}, and includes
82translators for Pygments lexers and styles.")
83 (license license:expat)))
84
85(define-public go-fxlint
86 (package
87 (name "go-fxlint")
88 (version "1.24.0")
89 (source
90 (origin
91 (method git-fetch)
92 (uri (git-reference
93 (url "https://github.com/uber-go/fx")
94 (commit (string-append "v" version ))))
95 (file-name (git-file-name name version))
96 (sha256
97 (base32 "0iifq4gjd873l444qh32x2zzsz2yinrvpjsdfphxsfk1h0cyk4q9"))))
98 (build-system go-build-system)
99 (arguments
100 (list
101 #:tests? #f
102 #:install-source? #f
103 #:import-path "go.uber.org/fx/tools/cmd/fxlint"
104 #:unpack-path "go.uber.org/fx"))
105 (native-inputs
106 (list go-golang-org-x-tools))
107 (home-page "https://go.uber.org/fx")
108 (synopsis "Verify FX events")
109 (description
110 "This Package implements a Go analysis pass that verifies that an
111@code{fxevent.Logger} implementation handles all known fxevent types. As a
112special case for no-op or fake fxevent.Loggers, it ignores implementations
113that handle none of the event types.")
114 (license license:expat)))
115
116(define-public go-jsonnet
117 (package
118 (name "go-jsonnet")
119 (version "0.22.0")
120 (source
121 (origin
122 (method git-fetch)
123 (uri (git-reference
124 (url "https://github.com/google/go-jsonnet")
125 (commit (string-append "v" version))))
126 (file-name (git-file-name name version))
127 (sha256
128 (base32 "1c7h14rvavgadvbsyfa9j4rchsgxb5j363f53rhcvghvmblzddiv"))))
129 (build-system go-build-system)
130 (arguments
131 (list
132 #:install-source? #f
133 #:import-path "github.com/google/go-jsonnet/cmd/..."
134 #:unpack-path "github.com/google/go-jsonnet"))
135 (native-inputs
136 (list go-github-com-fatih-color
137 go-github-com-sergi-go-diff
138 go-golang-org-x-crypto
139 go-sigs-k8s-io-yaml))
140 (home-page "https://github.com/google/go-jsonnet")
141 (synopsis "Go implementation of Jsonnet")
142 (description
143 "This package provides an implementation of the @url{http://jsonnet.org/,
144Jsonnet} data templating language in Go. It is a feature-complete,
145production-ready implementation, compatible with the original Jsonnet
146C++implementation.")
147 (license license:asl2.0)))
148
149(define-public godef
150 (package
151 (name "godef")
152 (version "1.1.2")
153 (source
154 (origin
155 (method git-fetch)
156 (uri (git-reference
157 (url "https://github.com/rogpeppe/godef")
158 (commit (string-append "v" version))))
159 (file-name (git-file-name name version))
160 (sha256
161 (base32 "0rhhg73kzai6qzhw31yxw3nhpsijn849qai2v9am955svmnckvf4"))
162 (modules '((guix build utils)))
163 (snippet '(delete-file-recursively "vendor"))))
164 (build-system go-build-system)
165 (arguments
166 (list
167 #:import-path "github.com/rogpeppe/godef"
168 ;; The TestGoDef/Modules test fails, because of the lack of Go modules
169 ;; support.
170 #:test-flags #~(list "-skip" "TestGoDef/GOPATH|TestGoDef/Modules")))
171 (native-inputs
172 ;; XXX: Remove in the next refresh cycle.
173 (list go-golang-org-x-tools-go-packages-packagestest))
174 (inputs
175 (list go-golang-org-x-tools
176 go-ninefans-net-go))
177 (home-page "https://github.com/rogpeppe/godef")
178 (synopsis "Print where symbols are defined in Go source code")
179 (description "The @command{godef} command prints the source location of
180definitions in Go programs.")
181 (license license:bsd-3)))
182
183(define-public godepgraph
184 (package
185 (name "godepgraph")
186 (version "1.0.0")
187 (source
188 (origin
189 (method git-fetch)
190 (uri (git-reference
191 (url "https://github.com/kisielk/godepgraph")
192 (commit (string-append "v" version))))
193 (file-name (git-file-name name version))
194 (sha256
195 (base32 "14rb0fx14pzfgf7fsc6dy33n5njphck17nzng8hsja4jc5c3zqkw"))))
196 (build-system go-build-system)
197 (arguments
198 (list
199 #:install-source? #f
200 #:import-path "github.com/kisielk/godepgraph"))
201 (home-page "https://github.com/kisielk/godepgraph")
202 (synopsis "Go dependency graph visualization tool")
203 (description
204 "@command{godepgraph} is a program for generating a dependency graph of
205Go packages, supporting output in Graphviz and Mermaid formats.")
206 (license license:expat)))
207
208(define-public godoc
209 (package
210 (name "godoc")
211 (version "0.1.0-deprecated")
212 (source
213 (origin
214 (method git-fetch)
215 (uri (git-reference
216 (url "https://go.googlesource.com/tools")
217 (commit (go-version->git-ref version #:subdir "cmd/godoc"))))
218 (file-name (git-file-name name version))
219 (sha256
220 (base32 "0c1rxbj3v3m0fqb8q96xlbawxm9scyx6vvr8pddkiwp7zkx4ajym"))
221 (modules '((guix build utils)))
222 (snippet
223 #~(begin
224 (delete-all-but "cmd" "godoc")
225 (delete-all-but "." "cmd")))))
226 (build-system go-build-system)
227 (arguments
228 (list
229 #:install-source? #f
230 #:import-path "golang.org/x/tools/cmd/godoc"
231 #:unpack-path "golang.org/x/tools"))
232 (native-inputs
233 (list go-golang-org-x-tools
234 go-golang-org-x-tools-godoc))
235 (home-page "https://golang.org/x/tools")
236 (synopsis "Extracts and generates documentation for Go programs")
237 (description
238 "Godoc extracts and generates documentation for Go programs. It looks at
239the packages it finds via @code{$GOROOT} and @code{$GOPATH} (if set). This
240behavior can be altered by providing an alternative @code{$GOROOT} with the
241@code{-goroot} flag.")
242 (license license:bsd-3)))
243
244(define-public gomacro
245 (package
246 (name "gomacro")
247 (properties '((commit . "cf0d4bf32da393dbda97e3572f216731013ffa55")
248 (revision . "0")
249 (go-pseudo-version . "0.0.0-20260802094757-cf0d4bf32da3")))
250 (version (git-version "0.0.0"
251 (assoc-ref properties 'revision)
252 (assoc-ref properties 'commit)))
253 (source
254 (origin
255 (method git-fetch)
256 (uri (git-reference
257 (url "https://github.com/cosmos72/gomacro")
258 (commit (assoc-ref properties 'commit))))
259 (file-name (git-file-name name version))
260 (sha256
261 (base32 "1gn8r8jfmkrm67wzmd3v1iw5ng904ha549df43yv98dd5a3sfk23"))))
262 (build-system go-build-system)
263 (arguments
264 (list
265 #:install-source? #f
266 #:import-path "github.com/cosmos72/gomacro"
267 #:test-flags
268 ;; When -vet=on: conversion from int64 to string yields a string of one
269 ;; rune, not a string of digits.
270 #~(list "-vet=off"
271 ;; There are some unexplained test failures (see:
272 ;; https://github.com/cosmos72/gomacro/issues/164), and even
273 ;; after disabling the problematic tests, the test suite exits
274 ;; uncleanly with an exit status of 1.
275 "-skip" (string-join '("TestFiles/slow.input"
276 "TestFromReflect6")
277 "|"))
278 #:phases
279 #~(modify-phases %standard-phases
280 (add-after 'unpack 'delete-problematic-tests
281 (lambda _
282 ;; Some test module(s) under go/types fail to build with error:
283 ;; c.Type undefined (type Converter has no field or method
284 ;; Type).
285 (for-each delete-file
286 (find-files "src/github.com/cosmos72/gomacro/go/types"
287 "_test\\.go(\\.off)?$")))))))
288 (native-inputs
289 (list go-github-com-mattn-go-runewidth
290 go-github-com-peterh-liner
291 go-golang-org-x-tools))
292 (home-page "https://github.com/cosmos72/gomacro")
293 (synopsis
294 "Interactive Go interpreter and debugger with generics and macros")
295 (description
296 "@command{gomacro} is an almost complete Go interpreter, implemented in
297pure Go. It offers both an interactive REPL and a scripting mode, and does
298not require a Go toolchain at runtime (except in one very specific case:
299import of a 3rd party package at runtime).")
300 (license license:mpl2.0)))
301
302(define-public gopls
303 (package
304 (name "gopls")
305 ;; XXX: Starting from 0.14.0 gppls needs golang.org/x/telemetry, which
306 ;; needs to be discussed if it may be included in Guix.
307 (version "0.22.0")
308 (source
309 (origin
310 (method git-fetch)
311 (uri (git-reference
312 (url "https://go.googlesource.com/tools")
313 (commit (go-version->git-ref version #:subdir "gopls"))))
314 (file-name (git-file-name name version))
315 (sha256
316 (base32 "0n5ixvk6c8hww5z9lvf74dx6p4j573bq3ssvp77n6033l0fcbv94"))))
317 (build-system go-build-system)
318 (arguments
319 (list
320 #:go go-1.26
321 #:install-source? #f
322 #:import-path "golang.org/x/tools/gopls"
323 #:unpack-path "golang.org/x/tools"
324 ;; XXX: No tests in project's root, limit to some of subdris, try to
325 ;; enable more.
326 #:test-subdirs
327 #~(list "internal/protocol/..."
328 "internal/util/..."
329 "internal/vulncheck/...")
330 #:phases
331 #~(modify-phases %standard-phases
332 (add-before 'unpack 'override-tools
333 (lambda _
334 ;; XXX: Write a procedure deleting all but current module source
335 ;; to cover case with monorepo.
336 (delete-file-recursively "src/golang.org/x/tools")))
337 (add-before 'check 'set-env
338 (lambda _
339 ;; Required for fingerprint_test.TestMatches.
340 (setenv "GODEBUG" "gotypesalias=1"))))))
341 (native-inputs
342 (list go-github-com-fatih-gomodifytags
343 go-github-com-fsnotify-fsnotify
344 go-github-com-google-go-cmp
345 go-github-com-google-jsonschema-go
346 go-github-com-jba-templatecheck
347 go-github-com-modelcontextprotocol-go-sdk
348 go-golang-org-x-mod
349 go-golang-org-x-sync
350 go-golang-org-x-telemetry
351 go-golang-org-x-text
352 go-golang-org-x-tools
353 go-golang-org-x-vuln
354 go-gopkg-in-yaml-v3
355 go-honnef-co-go-tools
356 go-mvdan-cc-gofumpt
357 go-mvdan-cc-xurls-v2))
358 (home-page "https://golang.org/x/tools/gopls")
359 (synopsis "Official language server for the Go language")
360 (description
361 "Pronounced ``Go please'', this is the official Go language server
362developed by the Go team. It provides IDE features to any LSP-compatible
363editor.")
364 (license license:bsd-3)))
365
366(define-public gore
367 (package
368 (name "gore")
369 (version "0.7.0")
370 (source
371 (origin
372 (method git-fetch)
373 (uri (git-reference
374 (url "https://github.com/x-motemen/gore")
375 (commit (string-append "v" version))))
376 (file-name (git-file-name name version))
377 (sha256
378 (base32 "131hppvmqhz0mvnpf8fdwr7mi7sa73skdfcgaw8rl5m13nfqb7yh"))))
379 (build-system go-build-system)
380 (arguments
381 (list
382 #:install-source? #f
383 #:import-path "github.com/x-motemen/gore/cmd/gore"
384 #:unpack-path "github.com/x-motemen/gore"
385 #:test-flags
386 ;; Gore is configured for building modules with Go module
387 ;; support, which fails in the build environment for the tests
388 ;; making use of that. Skip them.
389 #~(list "-skip" (string-join
390 (list "TestAction_ArgumentRequired"
391 "TestAction_Clear"
392 "TestAction_CommandNotFound"
393 "TestAction_Doc"
394 "TestAction_Help"
395 "TestAction_Import"
396 "TestAction_ImportAlias"
397 "TestAction_Print"
398 "TestAction_Quit"
399 "TestAction_Type"
400 "TestAction_Verbose"
401 "TestSessionEval_AutoImport"
402 "TestSessionEval_CompileError"
403 "TestSessionEval_Const"
404 "TestSessionEval_Copy"
405 "TestSessionEval_Declarations"
406 "TestSessionEval_Func"
407 "TestSessionEval_Gomod"
408 "TestSessionEval_Gomod_AutoImport"
409 "TestSessionEval_Gomod_CompleteImport"
410 "TestSessionEval_Gomod_DeepDir"
411 "TestSessionEval_Gomod_Outside"
412 "TestSessionEval_MultipleValues"
413 "TestSessionEval_NotUsed"
414 "TestSessionEval_QuickFix_evaluated_but_not_used"
415 "TestSessionEval_QuickFix_no_new_variables"
416 "TestSessionEval_QuickFix_used_as_value"
417 "TestSessionEval_Struct"
418 "TestSessionEval_TokenError"
419 "TestSessionEval_import"
420 "TestSession_ExtraFiles"
421 "TestSession_IncludePackage"
422 "TestSession_completeWord")
423 "|"))
424 #:phases
425 #~(modify-phases %standard-phases
426 (add-after 'unpack 'patch-commands
427 (lambda* (#:key inputs #:allow-other-keys)
428 (with-directory-excursion "src/github.com/x-motemen/gore"
429 (substitute* "gopls.go"
430 (("\"gopls\"")
431 (format #f "~s" (search-input-file inputs "bin/gopls"))))))))))
432 (native-inputs
433 (list go-github-com-motemen-go-quickfix
434 go-github-com-peterh-liner
435 go-github-com-stretchr-testify
436 go-go-lsp-dev-jsonrpc2
437 go-go-lsp-dev-protocol
438 go-go-lsp-dev-uri
439 go-golang-org-x-text
440 go-golang-org-x-tools))
441 (inputs
442 (list gopls))
443 (home-page "https://github.com/x-motemen/gore")
444 (synopsis "Go REPL with line editing and completion capabilities")
445 (description
446 "Gore is a Go @acronym{REPL, read-eval-print loop} that offers line
447editing and auto-completion. Some of its features include:
448@itemize
449@item Line editing with history
450@item Multi-line input
451@item Package importing with completion
452@item Evaluates any expressions, statements and function declarations
453@item No ``evaluated but not used'' errors
454@item Code completion
455@item Showing documents
456@item Auto-importing (gore -autoimport)
457@end itemize")
458 (license license:expat)))
459
460(define-public mnc
461 (package
462 (name "mnc")
463 (version "0.5")
464 (source
465 (origin
466 (method git-fetch)
467 (uri (git-reference
468 (url "https://git.sr.ht/~anjan/mnc")
469 (commit version)))
470 (file-name (git-file-name name version))
471 (sha256
472 (base32 "04vcv8540s07rsdfzmxg63cpckacgfiiqchyvfimsg7ic71gna3q"))))
473 (build-system go-build-system)
474 (arguments
475 (list
476 #:tests? #f ; There are no tests.
477 #:install-source? #f
478 #:import-path "git.sr.ht/~anjan/mnc"))
479 (inputs (list go-github-com-influxdata-cron))
480 (home-page "https://git.sr.ht/~anjan/mnc")
481 (synopsis "Find seconds to next cron job")
482 (description "mnc (my next cron) opens the user's crontab and echos the
483time when the next cronjob will be ran.")
484 (license license:unlicense)))