sharlatan pushed a commit to branch go-team
in repository guix.
commit 6e2e3e8bf2dd1ef6fd4e3a0d75f89dd83e3e34fe
Author: Sharlatan Hellseher <[email protected]>
AuthorDate: Fri Mar 28 22:03:36 2025 +0000
gnu: go-github-com-prometheus-common: Improve package style, simplify.
* gnu/packages/prometheus.scm (go-github-com-prometheus-common):
Simplify package by using go-build-system parameters.
[arguments] <skip-build?>: No go go files in project's root.
<test-subdirs>: Move them here from custom 'check phase.
<phases>: Do not delete 'build, skip it; use default 'check.
[synopsis]: Fix it according to project's About.
[description]: Add more context from the project's README.
Change-Id: I05cfd5e2635b95cd3308f5a3543f6745d6c9079a
---
gnu/packages/prometheus.scm | 63 ++++++++++++++++++++++++---------------------
1 file changed, 33 insertions(+), 30 deletions(-)
diff --git a/gnu/packages/prometheus.scm b/gnu/packages/prometheus.scm
index ada59b9b25..073c460251 100644
--- a/gnu/packages/prometheus.scm
+++ b/gnu/packages/prometheus.scm
@@ -280,35 +280,28 @@ Prometheus metrics.")
(build-system go-build-system)
(arguments
(list
+ #:skip-build? #t
#:import-path "github.com/prometheus/common"
- #:phases
- #~(modify-phases %standard-phases
- ;; XXX: Workaround for go-build-system's lack of Go modules support.
- (delete 'build)
- (replace 'check
- (lambda* (#:key tests? import-path #:allow-other-keys)
- (when tests?
- (with-directory-excursion (string-append "src/" import-path)
- (invoke "go" "test" "-v"
- ;; Skipp, as it requires
- ;; <github.com/prometheus/client_golang/prometheus>,
- ;; which introduces cycle.
- ;; "./config/..."
+ #:test-subdirs
+ #~(list
+ ;; Skipp, as it requires
+ ;; <github.com/prometheus/client_golang/prometheus>, which introduces
+ ;; cycle.
+ ;; "./config/..."
- ;; Some tests fail on non x86_64 architecture:
- ;; Cannot use 9223372036 (untyped int constant) as
int
- ;; value in ;; struct literal (overflows).
- ;; Cannot use math.MaxInt64
- ;; (untyped int constant 9223372036854775807) as int
value
- ;; in argument to HumanizeTimestamp (overflows)
- #$@(if (target-x86-64?)
- '("./helpers/...")
- '())
- "./expfmt/..."
- "./model/..."
- "./promlog/..."
- "./route/..."
- "./server/..."))))))))
+ ;; Some tests fail on non x86_64 architecture: Cannot use 9223372036
+ ;; (untyped int constant) as int value in ;; struct literal
+ ;; (overflows). Cannot use math.MaxInt64 (untyped int constant
+ ;; 9223372036854775807) as int value in argument to HumanizeTimestamp
+ ;; (overflows)
+ #$@(if (target-x86-64?)
+ '("./helpers/...")
+ '())
+ "./expfmt/..."
+ "./model/..."
+ "./promlog/..."
+ "./route/..."
+ "./server/...")))
(native-inputs
(list go-github-com-stretchr-testify))
(propagated-inputs
@@ -324,10 +317,20 @@ Prometheus metrics.")
go-google-golang-org-protobuf
go-gopkg-in-yaml-v2))
(home-page "https://github.com/prometheus/common")
- (synopsis "Prometheus metrics")
+ (synopsis "Shared Prometheus Golang components")
(description
- "This package provides tools for reading and writing Prometheus
-metrics.")
+ "This package provides Go libraries that are shared across Prometheus
+components.
+
+@itemize
+@item @code{config} - common configuration structures
+@item @code{expfmt} - decoding and encoding for the exposition format
+@item @code{model} - shared data structures
+@item @code{promslog} - a logging wrapper around log/slog
+@item @code{route} - a routing wrapper around httprouter using context.Context
+@item @code{server} - common servers
+@item @code{version} version information and metrics
+@end itemize")
(license license:asl2.0)))
(define-public go-github-com-prometheus-common-assets