@@ -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";
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -1,49 +1,23 @@
|
||||
{ stdenv, lib, go_1_3, fetchFromGitHub }:
|
||||
{ lib, goPackages, fetchFromGitHub }:
|
||||
|
||||
let
|
||||
goDeps = [
|
||||
{
|
||||
root = "github.com/mitchellh/gox";
|
||||
src = fetchFromGitHub {
|
||||
owner = "mitchellh";
|
||||
repo = "gox";
|
||||
rev = "c7329055e2aeb253a947e5cc876586ff4ca19199";
|
||||
sha256 = "0zhb88jjxqn3sdc4bpzvajqvgi9igp5gk03q12gaksaxhy2wl4jy";
|
||||
};
|
||||
}
|
||||
{
|
||||
root = "github.com/mitchellh/iochan";
|
||||
src = fetchFromGitHub {
|
||||
owner = "mitchellh";
|
||||
repo = "iochan";
|
||||
rev = "b584a329b193e206025682ae6c10cdbe03b0cd77";
|
||||
sha256 = "1fcwdhfci41ibpng2j4c1bqfng578cwzb3c00yw1lnbwwhaq9r6b";
|
||||
};
|
||||
}
|
||||
];
|
||||
sources = stdenv.mkDerivation rec {
|
||||
name = "go-deps";
|
||||
buildCommand =
|
||||
lib.concatStrings
|
||||
(map (dep: ''
|
||||
mkdir -p $out/src/`dirname ${dep.root}`
|
||||
ln -s ${dep.src} $out/src/${dep.root}
|
||||
'') goDeps);
|
||||
with goPackages;
|
||||
|
||||
buildGoPackage rec {
|
||||
rev = "c7329055e2aeb253a947e5cc876586ff4ca19199";
|
||||
name = "gox-${lib.strings.substring 0 7 rev}";
|
||||
goPackagePath = "github.com/mitchellh/gox";
|
||||
src = fetchFromGitHub {
|
||||
inherit rev;
|
||||
owner = "mitchellh";
|
||||
repo = "gox";
|
||||
sha256 = "0zhb88jjxqn3sdc4bpzvajqvgi9igp5gk03q12gaksaxhy2wl4jy";
|
||||
};
|
||||
in
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
name = "gox";
|
||||
buildInputs = [ iochan ];
|
||||
|
||||
src = sources;
|
||||
propagatedBuildInputs = [ go ];
|
||||
|
||||
propagatedBuildInputs = [ go_1_3 ];
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/bin
|
||||
export GOPATH=$src
|
||||
go build -v -o $out/bin/gox github.com/mitchellh/gox
|
||||
'';
|
||||
dontInstallSrc = true;
|
||||
|
||||
meta = with lib; {
|
||||
description = "A simple, no-frills tool for Go cross compilation that behaves a lot like standard go build";
|
||||
|
||||
5
pkgs/development/compilers/go/setup-hook.sh
Normal file
5
pkgs/development/compilers/go/setup-hook.sh
Normal file
@@ -0,0 +1,5 @@
|
||||
addToGoPath() {
|
||||
addToSearchPath GOPATH $1/share/go
|
||||
}
|
||||
|
||||
envHooks=(${envHooks[@]} addToGoPath)
|
||||
Reference in New Issue
Block a user