mirror of
https://git.savannah.gnu.org/git/guix.git
synced 2025-01-31 14:56:54 +01:00
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
This commit is contained in:
parent
449fa18bf6
commit
90a82e1624
1 changed files with 15 additions and 18 deletions
|
@ -516,30 +516,27 @@ (define-public go-github-com-prometheus-statsd-exporter
|
|||
#: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
|
||||
|
|
Loading…
Reference in a new issue