diff options
author | Sharlatan Hellseher <[email protected]> | 2024-09-15 11:02:48 +0100 |
---|---|---|
committer | Sharlatan Hellseher <[email protected]> | 2024-11-09 21:33:48 +0000 |
commit | 30ca67ccd5285b0f4646a790eb10cd7c2ecb44a3 (patch) | |
tree | d5fdb7de36b77b277beda5c2458cb6eb3d24797d /gnu/packages/golang-web.scm | |
parent | 42683cbe4d33d75d57183b528560d7e295576475 (diff) |
gnu: go-github-com-go-openapi-loads: Simplify phases.
* gnu/packages/golang-web.scm (go-github-com-go-openapi-loads)
[arguments]: <#phases>: Swap 'copy-input-to-vendor-directory and
'remove-vendor-directory to generalized 'fix-embed-files phase.
Change-Id: Id025bdf03b6c2795183d6f6d80d4689b653425d6
Diffstat (limited to 'gnu/packages/golang-web.scm')
-rw-r--r-- | gnu/packages/golang-web.scm | 36 |
1 files changed, 13 insertions, 23 deletions
diff --git a/gnu/packages/golang-web.scm b/gnu/packages/golang-web.scm index 8477c2a841..cc5196450a 100644 --- a/gnu/packages/golang-web.scm +++ b/gnu/packages/golang-web.scm @@ -1601,35 +1601,25 @@ prototyped in @url{https://github.com/xeipuuv/gojsonreference}.") #:import-path "github.com/go-openapi/loads" #:phases #~(modify-phases %standard-phases - ;; FIXME: pattern schemas/*.json: cannot embed irregular file - ;; schemas/jsonschema-draft-04.json + ;; 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-go-openapi-spec") - "/src/github.com") - "vendor/github.com") - (copy-recursively - (string-append - #$(this-package-input "go-github-com-go-openapi-analysis") - "/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-after 'unpack '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" + "^(jsonschema-draft-04|schema)\\.json$"))))))) (native-inputs (list go-github-com-stretchr-testify)) (propagated-inputs |