Message ID | fd53c7f9f6f5f22e25ca8f73f6e45bbaceee1144.1691046969.git.hako@ultrarare.space |
---|---|
State | New |
Headers | show |
Series | gnu: go-google-golang-org-protobuf: Update to 1.31.0. | expand |
Hi Hilton, Hilton Chain <hako@ultrarare.space> writes: > * gnu/packages/golang.scm (go-google-golang-org-protobuf): Update to 1.31.0. > [arguments]: Build Go packages and run tests. > [propagated-inputs]: Remove go-github-com-golang-protobuf-proto. > --- > gnu/packages/golang.scm | 56 +++++++++++++++++++++++++++++++++++------ > 1 file changed, 48 insertions(+), 8 deletions(-) > > diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm > index ea6aadbe80..51bc717064 100644 > --- a/gnu/packages/golang.scm > +++ b/gnu/packages/golang.scm > @@ -8433,7 +8433,7 @@ (define-public go-github-com-golang-protobuf-proto > (define-public go-google-golang-org-protobuf > (package > (name "go-google-golang-org-protobuf") > - (version "1.28.0") > + (version "1.31.0") > (source (origin > (method git-fetch) > (uri (git-reference > @@ -8442,16 +8442,56 @@ (define-public go-google-golang-org-protobuf > (file-name (git-file-name name version)) > (sha256 > (base32 > - "1nzcc4qc00afi24nb7nlnwyzvvr6b8s8qdrn1sw085nygh2y2x8r")))) > + "1xf18kzz96hgfy1vlbnydrizzpxkqj2iamfdbj3dx5a1zz5mi8n0")))) > (build-system go-build-system) > (arguments > (list #:import-path "google.golang.org/protobuf" > - #:tests? #f ; source-only package > - #:phases #~(modify-phases %standard-phases > - ;; source-only package > - (delete 'build)))) > - (propagated-inputs (list go-github-com-google-go-cmp-cmp > - go-github-com-golang-protobuf-proto)) > + #:phases > + #~(let ((go-packages '("proto" > + "encoding/protojson" > + "encoding/prototext" > + "encoding/protowire" > + "reflect/protoreflect" > + "reflect/protoregistry" > + "reflect/protodesc" > + "reflect/protopath" > + "reflect/protorange" > + "testing/protocmp" > + "testing/protopack" > + "testing/prototest" > + "types/dynamicpb" > + "types/known/anypb" > + "types/known/timestamppb" > + "types/known/durationpb" > + "types/known/wrapperspb" > + "types/known/structpb" > + "types/known/fieldmaskpb" > + "types/known/apipb" > + "types/known/typepb" > + "types/known/sourcecontextpb" > + "types/known/emptypb" > + "types/descriptorpb" > + "types/pluginpb" > + "compiler/protogen" > + "cmd/protoc-gen-go"))) > + (modify-phases %standard-phases > + (replace 'build > + (lambda* (#:key import-path build-flags #:allow-other-keys) > + (for-each > + (lambda (pkg) > + ((assoc-ref %standard-phases 'build) > + #:import-path (format #f "~a/~a" import-path pkg) > + #:build-flags build-flags)) > + go-packages))) > + (replace 'check > + (lambda* (#:key tests? import-path #:allow-other-keys) > + (for-each > + (lambda (pkg) > + ((assoc-ref %standard-phases 'check) > + #:tests? tests? > + #:import-path (format #f "~a/~a" import-path pkg))) > + go-packages))))))) Is this a workaround for our lack of Go modules support? An explanatory comment is needed.
Hi Maxim, On Tue, 05 Sep 2023 21:49:18 +0800, Maxim Cournoyer wrote: > [...] > > (arguments > > (list #:import-path "google.golang.org/protobuf" > > - #:tests? #f ; source-only package > > - #:phases #~(modify-phases %standard-phases > > - ;; source-only package > > - (delete 'build)))) > > - (propagated-inputs (list go-github-com-google-go-cmp-cmp > > - go-github-com-golang-protobuf-proto)) > > + #:phases > > + #~(let ((go-packages '("proto" > > + "encoding/protojson" > > + "encoding/prototext" > > + "encoding/protowire" > > + "reflect/protoreflect" > > + "reflect/protoregistry" > > + "reflect/protodesc" > > + "reflect/protopath" > > + "reflect/protorange" > > + "testing/protocmp" > > + "testing/protopack" > > + "testing/prototest" > > + "types/dynamicpb" > > + "types/known/anypb" > > + "types/known/timestamppb" > > + "types/known/durationpb" > > + "types/known/wrapperspb" > > + "types/known/structpb" > > + "types/known/fieldmaskpb" > > + "types/known/apipb" > > + "types/known/typepb" > > + "types/known/sourcecontextpb" > > + "types/known/emptypb" > > + "types/descriptorpb" > > + "types/pluginpb" > > + "compiler/protogen" > > + "cmd/protoc-gen-go"))) > > + (modify-phases %standard-phases > > + (replace 'build > > + (lambda* (#:key import-path build-flags #:allow-other-keys) > > + (for-each > > + (lambda (pkg) > > + ((assoc-ref %standard-phases 'build) > > + #:import-path (format #f "~a/~a" import-path pkg) > > + #:build-flags build-flags)) > > + go-packages))) > > + (replace 'check > > + (lambda* (#:key tests? import-path #:allow-other-keys) > > + (for-each > > + (lambda (pkg) > > + ((assoc-ref %standard-phases 'check) > > + #:tests? tests? > > + #:import-path (format #f "~a/~a" import-path pkg))) > > + go-packages))))))) > > Is this a workaround for our lack of Go modules support? An explanatory > comment is needed. Yes, I'll add the comment and send V2, thank you!
diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm index ea6aadbe80..51bc717064 100644 --- a/gnu/packages/golang.scm +++ b/gnu/packages/golang.scm @@ -8433,7 +8433,7 @@ (define-public go-github-com-golang-protobuf-proto (define-public go-google-golang-org-protobuf (package (name "go-google-golang-org-protobuf") - (version "1.28.0") + (version "1.31.0") (source (origin (method git-fetch) (uri (git-reference @@ -8442,16 +8442,56 @@ (define-public go-google-golang-org-protobuf (file-name (git-file-name name version)) (sha256 (base32 - "1nzcc4qc00afi24nb7nlnwyzvvr6b8s8qdrn1sw085nygh2y2x8r")))) + "1xf18kzz96hgfy1vlbnydrizzpxkqj2iamfdbj3dx5a1zz5mi8n0")))) (build-system go-build-system) (arguments (list #:import-path "google.golang.org/protobuf" - #:tests? #f ; source-only package - #:phases #~(modify-phases %standard-phases - ;; source-only package - (delete 'build)))) - (propagated-inputs (list go-github-com-google-go-cmp-cmp - go-github-com-golang-protobuf-proto)) + #:phases + #~(let ((go-packages '("proto" + "encoding/protojson" + "encoding/prototext" + "encoding/protowire" + "reflect/protoreflect" + "reflect/protoregistry" + "reflect/protodesc" + "reflect/protopath" + "reflect/protorange" + "testing/protocmp" + "testing/protopack" + "testing/prototest" + "types/dynamicpb" + "types/known/anypb" + "types/known/timestamppb" + "types/known/durationpb" + "types/known/wrapperspb" + "types/known/structpb" + "types/known/fieldmaskpb" + "types/known/apipb" + "types/known/typepb" + "types/known/sourcecontextpb" + "types/known/emptypb" + "types/descriptorpb" + "types/pluginpb" + "compiler/protogen" + "cmd/protoc-gen-go"))) + (modify-phases %standard-phases + (replace 'build + (lambda* (#:key import-path build-flags #:allow-other-keys) + (for-each + (lambda (pkg) + ((assoc-ref %standard-phases 'build) + #:import-path (format #f "~a/~a" import-path pkg) + #:build-flags build-flags)) + go-packages))) + (replace 'check + (lambda* (#:key tests? import-path #:allow-other-keys) + (for-each + (lambda (pkg) + ((assoc-ref %standard-phases 'check) + #:tests? tests? + #:import-path (format #f "~a/~a" import-path pkg))) + go-packages))))))) + (propagated-inputs (list go-github-com-google-go-cmp-cmp)) (home-page "https://google.golang.org/protobuf") (synopsis "Go library for Protocol Buffers") (description