feat(nix/buildGo): expose gopkg attribute on buildGo.package
This makes the derivations more uniform, since both third-party packages generated by buildGo.external and native buildGo.package expose their libraries as gopkg attributes now. Change-Id: I547f9860082f36e3300139bf67613eb4fc600d24 Reviewed-on: https://cl.tvl.fyi/c/depot/+/1623 Tested-by: BuildkiteCI Reviewed-by: tazjin <mail@tazj.in>
This commit is contained in:
parent
cf35ad4fa9
commit
c3546c5f9c
1 changed files with 13 additions and 7 deletions
|
@ -82,13 +82,19 @@ let
|
||||||
asmPack = ifAsm ''
|
asmPack = ifAsm ''
|
||||||
${go}/bin/go tool pack r $out/${path}.a ./asm.o
|
${go}/bin/go tool pack r $out/${path}.a ./asm.o
|
||||||
'';
|
'';
|
||||||
in (runCommand "golib-${name}" {} ''
|
|
||||||
mkdir -p $out/${path}
|
gopkg = (runCommand "golib-${name}" {} ''
|
||||||
${srcList path (map (s: "${s}") srcs)}
|
mkdir -p $out/${path}
|
||||||
${asmBuild}
|
${srcList path (map (s: "${s}") srcs)}
|
||||||
${go}/bin/go tool compile -pack ${asmLink} -o $out/${path}.a -trimpath=$PWD -trimpath=${go} -p ${path} ${includeSources uniqueDeps} ${spaceOut srcs}
|
${asmBuild}
|
||||||
${asmPack}
|
${go}/bin/go tool compile -pack ${asmLink} -o $out/${path}.a -trimpath=$PWD -trimpath=${go} -p ${path} ${includeSources uniqueDeps} ${spaceOut srcs}
|
||||||
'') // { goDeps = uniqueDeps; goImportPath = path; };
|
${asmPack}
|
||||||
|
'') // {
|
||||||
|
inherit gopkg;
|
||||||
|
goDeps = uniqueDeps;
|
||||||
|
goImportPath = path;
|
||||||
|
};
|
||||||
|
in gopkg;
|
||||||
|
|
||||||
# Build a tree of Go libraries out of an external Go source
|
# Build a tree of Go libraries out of an external Go source
|
||||||
# directory that follows the standard Go layout and was not built
|
# directory that follows the standard Go layout and was not built
|
||||||
|
|
Loading…
Reference in a new issue