fix(buildGo): Update buildGo.proto for compatibility with external
Changes in the structure of buildGo.external meant that the package layout for the protobuf library is now slightly different. `proto` has been amended to work with the new structure. Callers of buildGo.proto do not need to be updated (i.e. the example still works).
This commit is contained in:
parent
875628a097
commit
0dfa5d15fa
2 changed files with 4 additions and 8 deletions
|
@ -76,8 +76,8 @@ let
|
||||||
# directory that follows the standard Go layout and was not built
|
# directory that follows the standard Go layout and was not built
|
||||||
# with buildGo.nix.
|
# with buildGo.nix.
|
||||||
#
|
#
|
||||||
# The derivation for each actual dependency will reside in an
|
# The derivation for each actual package will reside in an attribute
|
||||||
# attribute named "gopkg".
|
# named "gopkg", and an attribute named "gobin" for binaries.
|
||||||
external = import ./external { inherit pkgs program package; };
|
external = import ./external { inherit pkgs program package; };
|
||||||
|
|
||||||
# Import support libraries needed for protobuf & gRPC support
|
# Import support libraries needed for protobuf & gRPC support
|
||||||
|
@ -88,10 +88,10 @@ let
|
||||||
# Build a Go library out of the specified protobuf definition.
|
# Build a Go library out of the specified protobuf definition.
|
||||||
proto = { name, proto, path ? name, extraDeps ? [] }: (makeOverridable package) {
|
proto = { name, proto, path ? name, extraDeps ? [] }: (makeOverridable package) {
|
||||||
inherit name path;
|
inherit name path;
|
||||||
deps = [ protoLibs'.protobuf ] ++ extraDeps;
|
deps = [ protoLibs.goProto.proto.gopkg ] ++ extraDeps;
|
||||||
srcs = lib.singleton (runCommand "goproto-${name}.pb.go" {} ''
|
srcs = lib.singleton (runCommand "goproto-${name}.pb.go" {} ''
|
||||||
cp ${proto} ${baseNameOf proto}
|
cp ${proto} ${baseNameOf proto}
|
||||||
${protobuf}/bin/protoc --plugin=${protoLibs.goProto}/bin/protoc-gen-go \
|
${protobuf}/bin/protoc --plugin=${protoLibs.goProto.protoc-gen-go.gopkg}/bin/protoc-gen-go \
|
||||||
--go_out=plugins=grpc,import_path=${baseNameOf path}:. ${baseNameOf proto}
|
--go_out=plugins=grpc,import_path=${baseNameOf path}:. ${baseNameOf proto}
|
||||||
mv *.pb.go $out
|
mv *.pb.go $out
|
||||||
'');
|
'');
|
||||||
|
|
|
@ -19,7 +19,6 @@ in rec {
|
||||||
|
|
||||||
xnet = external {
|
xnet = external {
|
||||||
path = "golang.org/x/net";
|
path = "golang.org/x/net";
|
||||||
srcOnly = true;
|
|
||||||
deps = [ xtext ];
|
deps = [ xtext ];
|
||||||
src = fetchGit {
|
src = fetchGit {
|
||||||
url = "https://go.googlesource.com/net";
|
url = "https://go.googlesource.com/net";
|
||||||
|
@ -29,7 +28,6 @@ in rec {
|
||||||
|
|
||||||
xsys = external {
|
xsys = external {
|
||||||
path = "golang.org/x/sys";
|
path = "golang.org/x/sys";
|
||||||
srcOnly = true;
|
|
||||||
src = fetchGit {
|
src = fetchGit {
|
||||||
url = "https://go.googlesource.com/sys";
|
url = "https://go.googlesource.com/sys";
|
||||||
rev = "bd437916bb0eb726b873ee8e9b2dcf212d32e2fd";
|
rev = "bd437916bb0eb726b873ee8e9b2dcf212d32e2fd";
|
||||||
|
@ -38,7 +36,6 @@ in rec {
|
||||||
|
|
||||||
xtext = external {
|
xtext = external {
|
||||||
path = "golang.org/x/text";
|
path = "golang.org/x/text";
|
||||||
srcOnly = true;
|
|
||||||
src = fetchGit {
|
src = fetchGit {
|
||||||
url = "https://go.googlesource.com/text";
|
url = "https://go.googlesource.com/text";
|
||||||
rev = "cbf43d21aaebfdfeb81d91a5f444d13a3046e686";
|
rev = "cbf43d21aaebfdfeb81d91a5f444d13a3046e686";
|
||||||
|
@ -47,7 +44,6 @@ in rec {
|
||||||
|
|
||||||
genproto = external {
|
genproto = external {
|
||||||
path = "google.golang.org/genproto";
|
path = "google.golang.org/genproto";
|
||||||
srcOnly = true;
|
|
||||||
src = fetchGit {
|
src = fetchGit {
|
||||||
url = "https://github.com/google/go-genproto";
|
url = "https://github.com/google/go-genproto";
|
||||||
rev = "83cc0476cb11ea0da33dacd4c6354ab192de6fe6";
|
rev = "83cc0476cb11ea0da33dacd4c6354ab192de6fe6";
|
||||||
|
|
Loading…
Reference in a new issue