* Add the Go Programming Language compiler.

svn path=/nixpkgs/trunk/; revision=18348
This commit is contained in:
Nicolas Pierron 2009-11-14 20:14:28 +00:00
parent c8cb5210fb
commit da1311b893
5 changed files with 108 additions and 0 deletions

View file

@ -0,0 +1,55 @@
{stdenv, fetchhg, bison, glibc, ed, which, bash, ...}:
let
version = "2009-11-10.1";
md5 = "66e5803c8dc2855b339151918b6b0de5";
in
stdenv.mkDerivation {
name = "Go-" + version;
# No tarball yet.
src = fetchhg {
url = https://go.googlecode.com/hg/;
tag = "release." + version;
inherit md5;
};
buildInputs = [ bison glibc ed which bash ];
patches = [
./disable-system-dependent-tests.patch
./pkg-log-test-accept-period-in-file-path.patch
];
prePatch = ''
patchShebangs ./ # replace /bin/bash
# only for 386 build
# !!! substituteInPlace does not seems to be effective.
sed -i 's,/lib/ld-linux.so.2,${glibc}/lib/ld-linux.so.2,' src/cmd/8l/asm.c
'';
GOOS = "linux";
GOARCH = "386";
# The go-c interface depends on the error output of GCC.
LC_ALL = "C";
installPhase = ''
ensureDir "$out"
ensureDir "$out/bin"
export GOROOT="$(pwd)/"
export GOBIN="$out/bin"
export PATH="$GOBIN:$PATH"
cd ./src
./all.bash
cd -
'';
meta = {
homepage = http://golang.org/;
description = "The Go Programming language";
license = "BSD";
maintainers = with stdenv.lib.maintainers; [ pierron ];
};
}

View file

@ -0,0 +1,34 @@
diff -r b51fd2d6c160 src/pkg/Makefile
--- a/src/pkg/Makefile Tue Nov 10 20:05:24 2009 -0800
+++ b/src/pkg/Makefile Sat Nov 14 19:42:42 2009 +0100
@@ -100,16 +100,19 @@
NOTEST=\
debug/proc\
+ exec\
go/ast\
go/doc\
go/token\
hash\
image\
malloc\
+ os\
rand\
runtime\
syscall\
testing/iotest\
+ time\
TEST=\
$(filter-out $(NOTEST),$(DIRS))
diff -r b51fd2d6c160 src/run.bash
--- a/src/run.bash Tue Nov 10 20:05:24 2009 -0800
+++ b/src/run.bash Sat Nov 14 19:42:42 2009 +0100
@@ -69,7 +69,3 @@
./timing.sh -test
) || exit $?
-(xcd ../test
-./run
-) || exit $?
-

View file

@ -0,0 +1,14 @@
diff -r b51fd2d6c160 src/pkg/log/log_test.go
--- a/src/pkg/log/log_test.go Tue Nov 10 20:05:24 2009 -0800
+++ b/src/pkg/log/log_test.go Sat Nov 14 20:45:04 2009 +0100
@@ -18,8 +18,8 @@
Rtime = `[0-9][0-9]:[0-9][0-9]:[0-9][0-9]`;
Rmicroseconds = `\.[0-9][0-9][0-9][0-9][0-9][0-9]`;
Rline = `[0-9]+:`;
- Rlongfile = `/[A-Za-z0-9_/\-]+\.go:` + Rline;
- Rshortfile = `[A-Za-z0-9_\-]+\.go:` + Rline;
+ Rlongfile = `/[A-Za-z0-9_./\-]+\.go:` + Rline;
+ Rshortfile = `[A-Za-z0-9_.\-]+\.go:` + Rline;
)
type tester struct {

View file

@ -8,6 +8,7 @@
eelco = "Eelco Dolstra <e.dolstra@tudelft.nl>";
ludo = "Ludovic Courtès <ludo@gnu.org>";
marcweber = "Marc Weber <marco-oweber@gmx.de>";
pierron = "Nicolas B. Pierron <nixos@nbp.name>";
raskin = "Michael Raskin <7c6f434c@mail.ru>";
sander = "Sander van der Burg <s.vanderburg@tudelft.nl>";
viric = "Lluís Batlle i Rossell <viriketo@gmail.com>";

View file

@ -2065,6 +2065,10 @@ let
inherit cmake;
};
go = import ../development/compilers/go {
inherit stdenv fetchhg glibc bison ed which bash;
};
gprolog = import ../development/compilers/gprolog {
inherit fetchurl stdenv;
};