From e7bdf27d9843c233dc124a25a5e2438f72469a52 Mon Sep 17 00:00:00 2001 From: Leo Nikkilä Date: Sat, 24 Aug 2024 22:28:19 +0100 Subject: gnu: Add go-github-com-go-openapi-loads. * gnu/packages/golang-web.scm (go-github-com-go-openapi-loads): New variable. Co-authored-by: Sharlatan Hellseher Signed-off-by: Sharlatan Hellseher Change-Id: If5c3d479064ae04e01035c7c7ff1b61acb406749 --- gnu/packages/golang-web.scm | 63 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) (limited to 'gnu/packages/golang-web.scm') diff --git a/gnu/packages/golang-web.scm b/gnu/packages/golang-web.scm index 91b3291b53..0383becf75 100644 --- a/gnu/packages/golang-web.scm +++ b/gnu/packages/golang-web.scm @@ -1502,6 +1502,69 @@ (define-public go-github-com-go-openapi-jsonreference prototyped in @url{https://github.com/xeipuuv/gojsonreference}.") (license license:asl2.0))) +(define-public go-github-com-go-openapi-loads + (package + (name "go-github-com-go-openapi-loads") + (version "0.22.0") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/go-openapi/loads") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 "0qlcpdlm4y4v9r2r533aqvrc86b67nj31gsz29x9ilr7smr5299d")))) + (build-system go-build-system) + (arguments + (list + #: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 + ;; + ;; 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: + ;; + ;; - URL: + ;; - 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"))))))) + (native-inputs + (list go-github-com-stretchr-testify)) + (propagated-inputs + (list go-github-com-go-openapi-analysis + go-github-com-go-openapi-spec + go-github-com-go-openapi-swag + go-gopkg-in-yaml-v3)) + (home-page "https://github.com/go-openapi/loads") + (synopsis "Load OAI specification documents") + (description + "This package implements functionality of loading of @acronym{OpenAPI +Initiative,OAI} specification documents from local or remote locations. +Supports JSON and YAML documents.") + (license license:asl2.0))) + (define-public go-github-com-go-openapi-spec (package (name "go-github-com-go-openapi-spec") -- cgit v1.2.3