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
This commit is contained in:
Sharlatan Hellseher 2025-03-28 22:03:36 +00:00
parent 9d6f820875
commit 8e038cec79
No known key found for this signature in database
GPG key ID: 76D727BFF62CD2B5

View file

@ -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