From cc916a824a550b91b2d597ef80cf3b75090076e7 Mon Sep 17 00:00:00 2001 From: Sharlatan Hellseher Date: Wed, 22 Oct 2025 18:49:37 +0100 Subject: [PATCH] gnu: Add go-github-com-knqyf263-go-plugin. * gnu/packages/golang-web.scm (go-github-com-knqyf263-go-plugin) (protoc-gen-go-plugin): New variables. Change-Id: If1ffb54435996a4676da8b1e83db6755f86e2daa Reviewed-by: Arthur Rodrigues --- gnu/packages/golang-web.scm | 79 +++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) diff --git a/gnu/packages/golang-web.scm b/gnu/packages/golang-web.scm index 6d73d2df9426a85b697eb84f174a8377c78208af..6adb1176a2c356cd7487b21d9fe90b2c1b37e70c 100644 --- a/gnu/packages/golang-web.scm +++ b/gnu/packages/golang-web.scm @@ -6277,6 +6277,65 @@ router.") "Package alice provides a convenient way to chain HTTP handlers.") (license license:expat))) +(define-public go-github-com-knqyf263-go-plugin + (package + (name "go-github-com-knqyf263-go-plugin") + (version "0.9.0") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/knqyf263/go-plugin") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 "1c81xa5zcwzbi5r1lf1phh53vpzgc1hq0lymwa741xn9qmj9g0ac")))) + (build-system go-build-system) + (arguments + (list + #:skip-build? #t + #:build-flags + #~(list (string-append "-ldflags=-X" + " github.com/knqyf263/go-plugin/version.Version=" + #$version)) + #:test-flags + ;; TODO: Figure out how to generate wasm files: + ;; open plugin/plugin.wasm: no such file or directory + #~(list "-skip" (string-join + (list "TestEmpty" + "TestEmptyRequest" + "TestErrorResponse" + "TestFields" + "TestHostFunctions" + "TestImport" + "TestStd" + "TestWellKnownTypes") + "|")) + #:import-path "github.com/knqyf263/go-plugin" + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'remove-examples + (lambda* (#:key tests? import-path #:allow-other-keys) + (with-directory-excursion (string-append "src/" import-path) + (delete-file-recursively "examples"))))))) + (native-inputs + (list go-github-com-stretchr-testify)) + (propagated-inputs + (list go-github-com-planetscale-vtprotobuf + go-github-com-tetratelabs-wazero + go-google-golang-org-protobuf)) + (home-page "https://github.com/knqyf263/go-plugin") + (synopsis "Golang Plugin System over WebAssembly") + (description + "This package provides a plugin system over @code{WebAssembly}. As a + plugin is compiled to Wasm, it can be size-efficient, memory-safe, sandboxed +and portable. The plugin system auto-generates Go SDK for plugins from +@url{https://developers.google.com/protocol-buffers/docs/overview, Protocol +Buffers} files. While it is powered by Wasm, plugin authors/users don't have +to be aware of the Wasm specification since the raw Wasm APIs are capsulated +by the SDK.") + (license license:expat))) + (define-public go-github-com-kolo-xmlrpc (package (name "go-github-com-kolo-xmlrpc") @@ -14574,6 +14633,26 @@ carries no encryption keys and cannot decode the traffic that it proxies."))) (propagated-inputs '()) (inputs '()))) +(define-public protoc-gen-go-plugin + (package/inherit go-github-com-knqyf263-go-plugin + (name "protoc-gen-go-plugin") + (arguments + (substitute-keyword-arguments + (package-arguments go-github-com-knqyf263-go-plugin) + ((#:install-source? _ #t) #f) + ((#:skip-build? _ #t) #f) + ((#:tests? _ #t) #f) + ((#:import-path _) + "github.com/knqyf263/go-plugin/cmd/protoc-gen-go-plugin") + ((#:unpack-path _ "") "github.com/knqyf263/go-plugin") + ((#:phases %standard-phases) + #~(modify-phases %standard-phases + (delete 'remove-examples))))) + (native-inputs (package-propagated-inputs + go-github-com-knqyf263-go-plugin)) + (propagated-inputs '()) + (inputs '()))) + (define-public protoc-gen-go-vtproto (package/inherit go-github-com-planetscale-vtprotobuf (name "protoc-gen-go-vtproto")