[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
118/172: gnu: go-github-com-prometheus-common-sigv4: Update to 0.1.0, fi
From: |
guix-commits |
Subject: |
118/172: gnu: go-github-com-prometheus-common-sigv4: Update to 0.1.0, fix build. |
Date: |
Sat, 9 Nov 2024 16:45:05 -0500 (EST) |
sharlatan pushed a commit to branch master
in repository guix.
commit 45f74470378daca81d007fc6726053290e2e1ac2
Author: Sharlatan Hellseher <sharlatanus@gmail.com>
AuthorDate: Mon Sep 16 10:46:00 2024 +0100
gnu: go-github-com-prometheus-common-sigv4: Update to 0.1.0, fix build.
Fix the build as seen in <https://ci.guix.gnu.org/build/5804380/log/raw>.
* gnu/packages/prometheus.scm (go-github-com-prometheus-common-sigv4):
Update to 0.1.0.
[source]: Remove all submodules and keep the sources just for
<github.com/prometheus/common/sigv4>.
[origin]: Apply new style for "go-version->git-ref" using <#:subdir> key
parameter.
[arguments]: <#:phases>: Remove 'override-prometheus-common; add
'fix-embed-files.
Change-Id: I69a37690baafbfca1a2e33ebdea957456a96b0e8
---
gnu/packages/prometheus.scm | 48 ++++++++++++++++++++++++++++++++++++++++-----
1 file changed, 43 insertions(+), 5 deletions(-)
diff --git a/gnu/packages/prometheus.scm b/gnu/packages/prometheus.scm
index 9786cf7007..533a922d0b 100644
--- a/gnu/packages/prometheus.scm
+++ b/gnu/packages/prometheus.scm
@@ -351,16 +351,39 @@ metrics.")
(define-public go-github-com-prometheus-common-sigv4
(package
(name "go-github-com-prometheus-common-sigv4")
- (version "0.55.0")
+ (version "0.1.0")
(source
(origin
(method git-fetch)
(uri (git-reference
(url "https://github.com/prometheus/common")
- (commit (string-append "v" version))))
+ (commit (go-version->git-ref version
+ #:subdir "sigv4"))))
(file-name (git-file-name name version))
(sha256
- (base32 "0bsbxil7qz8rhckhv0844nmn38g7i7347cjv5m6na47hbdpi0rqh"))))
+ (base32 "08sdhxryl1jpy829qki8k2jy773xhrbr9wsk997pxhbbvl634gvb"))
+ (modules '((guix build utils)
+ (ice-9 ftw)
+ (srfi srfi-26)))
+ (snippet
+ #~(begin
+ ;; XXX: 'delete-all-but' is copied from the turbovnc package.
+ ;; Consider to implement it as re-usable procedure in
+ ;; guix/build/utils or guix/build-system/go.
+ (define (delete-all-but directory . preserve)
+ (define (directory? x)
+ (and=> (stat x #f)
+ (compose (cut eq? 'directory <>) stat:type)))
+ (with-directory-excursion directory
+ (let* ((pred
+ (negate (cut member <> (append '("." "..") preserve))))
+ (items (scandir "." pred)))
+ (for-each (lambda (item)
+ (if (directory? item)
+ (delete-file-recursively item)
+ (delete-file item)))
+ items))))
+ (delete-all-but "." "sigv4")))))
(build-system go-build-system)
(arguments
(list
@@ -368,9 +391,24 @@ metrics.")
#:unpack-path "github.com/prometheus/common"
#:phases
#~(modify-phases %standard-phases
- (add-before 'unpack 'override-prometheus-common
+ ;; TODO: Implement it in go-build-system.
+ ;;
+ ;; This happens due to Golang can't determine the valid directory of
+ ;; the module of embed file which is symlinked during setup
+ ;; environment phase, but easy resolved after coping file from the
+ ;; store to the build directory of the current package, see details
+ ;; in Golang source:
+ ;;
+ ;; - URL: <https://github.com/golang/go/blob/>
+ ;; - commit: 82c14346d89ec0eeca114f9ca0e88516b2cda454
+ ;; - file: src/cmd/go/internal/load/pkg.go#L2059
+ (add-after 'unpack 'fix-embed-files
(lambda _
- (delete-file-recursively "src/github.com/prometheus/common"))))))
+ (for-each (lambda (file)
+ (let ((file-store-path (readlink file)))
+ (delete-file file)
+ (copy-recursively file-store-path file)))
+ (find-files "src" ".*(editions_defaults.binpb)$")))))))
(native-inputs
(list go-github-com-stretchr-testify))
(propagated-inputs
- 100/172: gnu: Add go-github-com-datadog-datadog-go., (continued)
- 100/172: gnu: Add go-github-com-datadog-datadog-go., guix-commits, 2024/11/09
- 104/172: gnu: Add go-github-com-hashicorp-go-retryablehttp., guix-commits, 2024/11/09
- 117/172: guix: Add copyright records., guix-commits, 2024/11/09
- 97/172: gnu: go-github-com-go-openapi-loads: Simplify phases., guix-commits, 2024/11/09
- 99/172: gnu: Add go-github-com-gofrs-uuid., guix-commits, 2024/11/09
- 123/172: gnu: nebula: Fix build., guix-commits, 2024/11/09
- 115/172: gnu: Add go-github-com-tinylib-msgp., guix-commits, 2024/11/09
- 109/172: gnu: Add go-github-com-pascaldekloe-goe., guix-commits, 2024/11/09
- 112/172: gnu: Add go-github-com-dgryski-go-ddmin., guix-commits, 2024/11/09
- 133/172: gnu: go-github-com-shadowsocks-go-shadowsocks2: Update to 0.1.5., guix-commits, 2024/11/09
- 118/172: gnu: go-github-com-prometheus-common-sigv4: Update to 0.1.0, fix build.,
guix-commits <=
- 121/172: gnu: restic-rest-server: Fix build., guix-commits, 2024/11/09
- 142/172: gnu: Remove go-github-com-smartystreets-assertions., guix-commits, 2024/11/09
- 168/172: gnu: go-github-com-subosito-gotenv: Move to golang-xyz., guix-commits, 2024/11/09
- 152/172: gnu: Remove go-github-com-emersion-go-textwrapper., guix-commits, 2024/11/09
- 160/172: gnu: go-github-com-fsnotify-fsnotify: Move to golang-xyz., guix-commits, 2024/11/09
- 147/172: gnu: go-gopkg-in-natefinch-lumberjack.v2: Rename variable., guix-commits, 2024/11/09
- 158/172: gnu: go-github-com-dustin-go-humanize: Update to 1.0.1., guix-commits, 2024/11/09
- 167/172: gnu: go-github-com-subosito-gotenv: Update to 1.6.0., guix-commits, 2024/11/09
- 137/172: gnu: go-github.com-smartystreets-assertions: Rename variable., guix-commits, 2024/11/09
- 09/172: gnu: Add go-html2text., guix-commits, 2024/11/09