mirror of
https://github.com/ivabus/pantry
synced 2024-11-10 02:25:18 +03:00
+protoc-gen-go
This commit is contained in:
parent
ef4baf2db5
commit
14d255e784
47
projects/google.com/protobuf-go/package.yml
Normal file
47
projects/google.com/protobuf-go/package.yml
Normal file
|
@ -0,0 +1,47 @@
|
||||||
|
distributable:
|
||||||
|
url: https://github.com/protocolbuffers/protobuf-go/archive/refs/tags/{{version.tag}}.tar.gz
|
||||||
|
strip-components: 1
|
||||||
|
|
||||||
|
versions:
|
||||||
|
github: protocolbuffers/protobuf-go
|
||||||
|
|
||||||
|
provides:
|
||||||
|
- bin/protoc-gen-go
|
||||||
|
|
||||||
|
companions:
|
||||||
|
protobuf.dev: '*'
|
||||||
|
|
||||||
|
build:
|
||||||
|
dependencies:
|
||||||
|
go.dev: ^1.17
|
||||||
|
script:
|
||||||
|
- go mod download
|
||||||
|
- go build -v -trimpath -ldflags="$GO_LDFLAGS" -o $BUILDLOC ./cmd/protoc-gen-go
|
||||||
|
env:
|
||||||
|
BUILDLOC: '{{prefix}}/bin/protoc-gen-go'
|
||||||
|
GO_LDFLAGS:
|
||||||
|
- -s
|
||||||
|
- -w
|
||||||
|
linux:
|
||||||
|
# or segmentation fault
|
||||||
|
# fix found here https://github.com/docker-library/protocolbuffers/issues/402#issuecomment-982204575
|
||||||
|
GO_LDFLAGS:
|
||||||
|
- -buildmode=pie
|
||||||
|
|
||||||
|
test:
|
||||||
|
dependencies:
|
||||||
|
go.dev: '*'
|
||||||
|
script:
|
||||||
|
- run: cp $FIXTURE test.proto
|
||||||
|
fixture: |
|
||||||
|
syntax = "proto3";
|
||||||
|
package test;
|
||||||
|
option go_package = "./test";
|
||||||
|
message TestCase {
|
||||||
|
string name = 4;
|
||||||
|
}
|
||||||
|
message Test {
|
||||||
|
repeated TestCase case = 1;
|
||||||
|
}
|
||||||
|
- protoc test.proto --go_out=.
|
||||||
|
- grep 'package test' test/test.pb.go
|
Loading…
Reference in a new issue