| 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 | (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
|
| 79 | programming languages. It takes source code and other structured text and
|
| 80 | converts it into syntax highlighted HTML, ANSI-coloured text, etc. Chroma is
|
| 81 | based heavily on @url{http://pygments.org/, Pygments}, and includes
|
| 82 | translators 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
|
| 112 | special case for no-op or fake fxevent.Loggers, it ignores implementations
|
| 113 | that 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/,
|
| 144 | Jsonnet} data templating language in Go. It is a feature-complete,
|
| 145 | production-ready implementation, compatible with the original Jsonnet
|
| 146 | C++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 | |
| 169 | |
| 170 | #:test-flags #~(list "-skip" "TestGoDef/GOPATH|TestGoDef/Modules")))
|
| 171 | (native-inputs
|
| 172 | |
| 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
|
| 180 | definitions 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
|
| 205 | Go 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
|
| 239 | the packages it finds via @code{$GOROOT} and @code{$GOPATH} (if set). This
|
| 240 | behavior 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 | |
| 269 | |
| 270 | #~(list "-vet=off"
|
| 271 | |
| 272 | |
| 273 | |
| 274 | |
| 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 | |
| 283 | |
| 284 | |
| 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
|
| 297 | pure Go. It offers both an interactive REPL and a scripting mode, and does
|
| 298 | not require a Go toolchain at runtime (except in one very specific case:
|
| 299 | import of a 3rd party package at runtime).")
|
| 300 | (license license:mpl2.0)))
|
| 301 |
|
| 302 | (define-public gopls
|
| 303 | (package
|
| 304 | (name "gopls")
|
| 305 | |
| 306 | |
| 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 | |
| 325 | |
| 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 | |
| 335 | |
| 336 | (delete-file-recursively "src/golang.org/x/tools")))
|
| 337 | (add-before 'check 'set-env
|
| 338 | (lambda _
|
| 339 | |
| 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
|
| 362 | developed by the Go team. It provides IDE features to any LSP-compatible
|
| 363 | editor.")
|
| 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 | |
| 387 | |
| 388 | |
| 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
|
| 447 | editing 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 |
| 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
|
| 483 | time when the next cronjob will be ran.")
|
| 484 | (license license:unlicense)))
|