aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSharlatan Hellseher <sharlatanus@gmail.com>2024-09-13 23:27:36 +0100
committerSharlatan Hellseher <sharlatanus@gmail.com>2024-11-09 21:33:42 +0000
commit90a82e1624d03076d4f0cb174dda41016b7b3a1e (patch)
tree0752dd33d000fa8ddba50b76c577b93166e3b57d
parent449fa18bf60907a7625ff6eeb037ecbb3a00be77 (diff)
downloadguix-90a82e1624d03076d4f0cb174dda41016b7b3a1e.tar.gz
guix-90a82e1624d03076d4f0cb174dda41016b7b3a1e.zip
gnu: go-github-com-prometheus-statsd-exporter: Fix build.
* gnu/packages/prometheus.scm (go-github-com-prometheus-statsd-exporter): Fix build [arguments]: <#:phases>: Rework 'copy-input-to-vendor-directory and 'remove-vendor-directory by consolidating and simplifying them into 'fix-embed-files. Change-Id: I5c255ea17dc9926bf9e2ea9a0a0e662afe9c2e5d
-rw-r--r--gnu/packages/prometheus.scm33
1 files changed, 15 insertions, 18 deletions
diff --git a/gnu/packages/prometheus.scm b/gnu/packages/prometheus.scm
index c3267a234b..9786cf7007 100644
--- a/gnu/packages/prometheus.scm
+++ b/gnu/packages/prometheus.scm
@@ -516,30 +516,27 @@ kernel, and process metrics from the @file{/proc} pseudo file system.")
#:import-path "github.com/prometheus/statsd_exporter"
#:phases
#~(modify-phases %standard-phases
- ;; FIXME: pattern landing_page.css: cannot embed irregular file
- ;; landing_page.css
+ ;; TODO: Implement it in go-build-system.
;;
;; This happens due to Golang can't determine the valid directory of
- ;; the module which is sourced during setup environment phase, but
- ;; easy resolved after coping to expected directory "vendor" within
- ;; the current package, see details in Golang source:
+ ;; 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-before 'build 'copy-input-to-vendor-directory
- (lambda* (#:key import-path #:allow-other-keys)
- (with-directory-excursion (string-append "src/" import-path)
- (mkdir "vendor")
- (copy-recursively
- (string-append
- #$(this-package-input "go-github-com-prometheus-exporter-toolkit")
- "/src/github.com")
- "vendor/github.com"))))
- (add-before 'install 'remove-vendor-directory
- (lambda* (#:key import-path #:allow-other-keys)
- (with-directory-excursion (string-append "src/" import-path)
- (delete-file-recursively "vendor")))))))
+ (add-before 'build 'fix-embed-files
+ (lambda _
+ (for-each (lambda (file)
+ (let ((file-store-path (readlink file)))
+ (delete-file file)
+ (copy-recursively file-store-path file)))
+ (find-files "src" (string-append
+ ".*(editions_defaults.binpb"
+ "|landing_page.css"
+ "|landing_page.html)$"))))))))
(native-inputs
(list go-github-com-stvp-go-udp-testing))
(propagated-inputs