From b93d338be3763362ac8382744d9b91d440f9066a Mon Sep 17 00:00:00 2001 From: Sharlatan Hellseher Date: Sun, 1 Sep 2024 22:28:48 +0100 Subject: gnu: Add go-github-com-rs-cors. * gnu/packages/golang-web.scm (go-github-com-rs-cors): New variable. Change-Id: I992bfd6b4cd343226899b9488c8b70f13baabbe5 --- gnu/packages/golang-web.scm | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/gnu/packages/golang-web.scm b/gnu/packages/golang-web.scm index 14b93cd9ae..2c34d8053f 100644 --- a/gnu/packages/golang-web.scm +++ b/gnu/packages/golang-web.scm @@ -4448,6 +4448,48 @@ on @@url{https://github.com/quic-go/quic-go,quic-go}. It currently implements of the specification.") (license license:expat))) +(define-public go-github-com-rs-cors + (package + (name "go-github-com-rs-cors") + (version "1.11.1") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/rs/cors") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 "0qbzxk1aabn8k2smrkpz3h59mwr6s2zvg4faj6kjsp78hyi172xn")) + (modules '((guix build utils))) + (snippet + #~(begin + ;; Submodule(s) with their own go.mod files and packed as + ;; separated packages: + ;; + ;; - github.com/rs/cors/wrapper/gin + (for-each delete-file-recursively + (list "wrapper/gin")))))) + (build-system go-build-system) + (arguments + (list + #:import-path "github.com/rs/cors" + #:phases + #~(modify-phases %standard-phases + ;; Examples requires additional dependencies and comes with their + ;; own go.mod, consider to pack it as separate package if required. + (add-after 'unpack 'remove-examples + (lambda* (#:key import-path #:allow-other-keys) + (delete-file-recursively + (string-append "src/" import-path "/examples"))))))) + (home-page "https://github.com/rs/cors") + (synopsis "Golang @code{net/http} configurable handler for CORS requests") + (description + "Package cors is @code{net/http} handler to handle @acronym{Cross-origin +resource sharing,CORS} related requests as defined by +@url{http://www.w3.org/TR/cors/,http://www.w3.org/TR/cors/}.") + (license license:expat))) + (define-public go-github-com-sherclockholmes-webpush-go (package (name "go-github-com-sherclockholmes-webpush-go") -- cgit v1.2.3