*: adapt to new Go structure

This commit is contained in:
steveej 2016-06-28 11:39:21 -07:00
parent 6d18af2826
commit b18db5be1a
4 changed files with 49 additions and 40 deletions

View file

@ -4,32 +4,30 @@ name ? "generic",
version,
extraBuildInputs ? [] }:
let
goPackages = builtins.getAttr "go${version}Packages" pkgs;
goBuildInputs = { goPackages }: [
goPackages.go
goPackages.tools
goPackages.tools.bin
goPackages.gocode
goPackages.gocode.bin
goPackages.godef
goPackages.godef.bin
goPackages.godep
goPackages.godep.bin
goPackages.gox.bin
goPackages.ginkgo
goPackages.ginkgo.bin
goPackages.gomega
go = builtins.getAttr "go_${version}" pkgs;
goBuildInputs = with pkgs; [
go
gotools
#gotools.bin
gocode
gocode.bin
#godef godef.bin
godep
#godep.bin
gox.bin
#ginkgo ginkgo.bin
#gomega
];
goShellHook = { goPackages, name }: ''
goname=${goPackages.go.version}_$name
goShellHook = { go, name }: ''
goname=${go.version}_$name
setPS1 $goname
export GOROOT=${goPackages.go}/share/go
export GOROOT=${go}/share/go
export GOPATH="$HOME/.gopath_$goname"
export PATH="$HOME/.gopath_$goname/bin:$PATH"
unset name
'';
in pkgs.stdenv.mkDerivation {
inherit name;
buildInputs = extraBuildInputs ++ (goBuildInputs){ inherit goPackages; };
shellHook = (goShellHook) { inherit name; inherit goPackages; };
buildInputs = extraBuildInputs ++ goBuildInputs;
shellHook = (goShellHook) { inherit name; inherit go; };
}