[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: |
Tue, 5 Nov 2024 16:05:05 -0500 (EST) |
sharlatan pushed a commit to branch go-team
in repository guix.
commit 36527156f338309055e6be48547c051b56d121d0
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
- 77/172: gnu: go-github-com-xeipuuv-gojsonschema: Fix indentation., (continued)
- 77/172: gnu: go-github-com-xeipuuv-gojsonschema: Fix indentation., guix-commits, 2024/11/05
- 81/172: gnu: go-github-com-go-git-go-git-fixtures: Rename variable., guix-commits, 2024/11/05
- 86/172: gnu: go-github-com-go-git-go-billy: Rename variable., guix-commits, 2024/11/05
- 91/172: gnu: Add go-github-com-rs-xid., guix-commits, 2024/11/05
- 98/172: gnu: Add go-github-com-go-openapi-runtime., guix-commits, 2024/11/05
- 105/172: gnu: Add go-github-com-circonus-labs-circonus-gometrics., guix-commits, 2024/11/05
- 110/172: gnu: Add go-github-com-xlab-treeprint., guix-commits, 2024/11/05
- 114/172: gnu: Add go-github-com-philhofer-fwd., guix-commits, 2024/11/05
- 113/172: gnu: Add go-github-com-pquerna-ffjson., guix-commits, 2024/11/05
- 112/172: gnu: Add go-github-com-dgryski-go-ddmin., guix-commits, 2024/11/05
- 118/172: gnu: go-github-com-prometheus-common-sigv4: Update to 0.1.0, fix build.,
guix-commits <=
- 119/172: gnu: soju: Fix build., guix-commits, 2024/11/05
- 125/172: build/go: Replace symlinks with a copy of the file., guix-commits, 2024/11/05
- 129/172: gnu: Add go-github-com-workiva-go-datastructures., guix-commits, 2024/11/05
- 131/172: gnu: go-github-com-aead-chacha20: Update to 0.0.0-20180709150244-8b13a72661da., guix-commits, 2024/11/05
- 133/172: gnu: go-github-com-shadowsocks-go-shadowsocks2: Update to 0.1.5., guix-commits, 2024/11/05
- 139/172: gnu: Add go-github-com-smarty-assertions., guix-commits, 2024/11/05
- 05/172: gnu: go-github-com-gogs-chardet: Move to golang-xyz., guix-commits, 2024/11/05
- 10/172: gnu: go-github-com-operatorfoundation-monolith-go: Update to 1.0.10., guix-commits, 2024/11/05
- 14/172: gnu: Remove go-github-com-rylans-getlang., guix-commits, 2024/11/05
- 07/172: gnu: go-github-com-jaytaylor-html2text: Enable tests., guix-commits, 2024/11/05