aboutsummaryrefslogtreecommitdiff
path: root/gnu/packages
diff options
context:
space:
mode:
authorLeo Nikkilä <hello@lnikki.la>2024-08-24 22:41:57 +0100
committerSharlatan Hellseher <sharlatanus@gmail.com>2024-08-25 20:46:48 +0100
commit6d508ef6905a17d269fe53532dd5009fff77ffb6 (patch)
tree8343c6804eed6362c7e80051c7e7b3659b0b5459 /gnu/packages
parente7bdf27d9843c233dc124a25a5e2438f72469a52 (diff)
downloadguix-6d508ef6905a17d269fe53532dd5009fff77ffb6.tar.gz
guix-6d508ef6905a17d269fe53532dd5009fff77ffb6.zip
gnu: Add go-github-com-go-openapi-validate.
* gnu/packages/golang-web.scm (go-github-com-go-openapi-validate): New variable. Co-authored-by: Sharlatan Hellseher <sharlatanus@gmail.com> Signed-off-by: Sharlatan Hellseher <sharlatanus@gmail.com> Change-Id: I775c1d2acdfa58f42a3898ced33f24a0a0fb2ee9
Diffstat (limited to 'gnu/packages')
-rw-r--r--gnu/packages/golang-web.scm80
1 files changed, 80 insertions, 0 deletions
diff --git a/gnu/packages/golang-web.scm b/gnu/packages/golang-web.scm
index 0383becf75..b36a618e56 100644
--- a/gnu/packages/golang-web.scm
+++ b/gnu/packages/golang-web.scm
@@ -1660,6 +1660,86 @@ specifications knows how to deal with those.")
projects.")
(license license:asl2.0)))
+(define-public go-github-com-go-openapi-validate
+ (package
+ (name "go-github-com-go-openapi-validate")
+ (version "0.24.0")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/go-openapi/validate")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "04inl03ha8sqqn1ccslbsl68shzf53qqk4yi88kvis0qdhcpl9fk"))))
+ (build-system go-build-system)
+ (arguments
+ (list
+ #:import-path "github.com/go-openapi/validate"
+ #:phases
+ #~(modify-phases %standard-phases
+ (add-after 'unpack 'remove-failing-tests
+ (lambda* (#:key import-path #:allow-other-keys)
+ (with-directory-excursion (string-append "src/" import-path)
+ ;; Tests requiring network access.
+ (for-each delete-file
+ (list "benchmark_test.go"
+ "example_validator_test.go"
+ "doc_test.go")))))
+ ;; 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: <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-loads")
+ "/src/github.com")
+ "vendor/github.com")
+ (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-davecgh-go-spew
+ go-github-com-go-openapi-analysis
+ go-github-com-go-openapi-errors
+ go-github-com-go-openapi-jsonpointer
+ go-github-com-go-openapi-loads
+ go-github-com-go-openapi-spec
+ go-github-com-go-openapi-strfmt
+ go-github-com-go-openapi-swag
+ go-gopkg-in-yaml-v3))
+ (home-page "https://github.com/go-openapi/validate")
+ (synopsis "OpenAPI toolkit validation helpers")
+ (description
+ "This package provides helpers to validate Swagger 2.0 specification (aka
+OpenAPI 2.0).")
+ (license license:asl2.0)))
+
(define-public go-github-com-go-webauthn-webauthn
(package
(name "go-github-com-go-webauthn-webauthn")