new Go support function 'buildGoPackage'

add a setupHook to the Go compiler that builds a GOPATH
new buildGoPackage function that overides the phases of stdenv
This commit is contained in:
Emery Hemingway
2015-01-31 10:51:20 -05:00
committed by Luca Bruno
parent 2d19af84de
commit faa5dccab8
8 changed files with 375 additions and 0 deletions

View File

@@ -81,6 +81,7 @@ stdenv.mkDerivation {
installPhase = ''
export CC=cc
mkdir -p "$out/bin"
unset GOPATH
export GOROOT="$(pwd)/"
export GOBIN="$out/bin"
export PATH="$GOBIN:$PATH"
@@ -99,6 +100,8 @@ stdenv.mkDerivation {
cp ./misc/emacs/* $out/share/emacs/site-lisp/
'';
setupHook = ./setup-hook.sh;
meta = {
homepage = http://golang.org/;
description = "The Go Programming language";

View File

@@ -95,6 +95,8 @@ stdenv.mkDerivation {
go test -v $TOOL_ROOT/cover $TOOL_ROOT/vet # $TOOL_ROOT/godoc
'';
setupHook = ./setup-hook.sh;
meta = {
homepage = http://golang.org/;
description = "The Go Programming language";

View File

@@ -0,0 +1,5 @@
addToGoPath() {
addToSearchPath GOPATH $1/share/go
}
envHooks=(${envHooks[@]} addToGoPath)