diff --git a/pkgs/development/compilers/go/default.nix b/pkgs/development/compilers/go/default.nix new file mode 100644 index 000000000000..862e69fae015 --- /dev/null +++ b/pkgs/development/compilers/go/default.nix @@ -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 ]; + }; +} diff --git a/pkgs/development/compilers/go/disable-system-dependent-tests.patch b/pkgs/development/compilers/go/disable-system-dependent-tests.patch new file mode 100644 index 000000000000..7d24b02a214f --- /dev/null +++ b/pkgs/development/compilers/go/disable-system-dependent-tests.patch @@ -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 $? +- diff --git a/pkgs/development/compilers/go/pkg-log-test-accept-period-in-file-path.patch b/pkgs/development/compilers/go/pkg-log-test-accept-period-in-file-path.patch new file mode 100644 index 000000000000..9cfe8f68ae01 --- /dev/null +++ b/pkgs/development/compilers/go/pkg-log-test-accept-period-in-file-path.patch @@ -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 { diff --git a/pkgs/lib/maintainers.nix b/pkgs/lib/maintainers.nix index 892b3e210445..9127c8c73089 100644 --- a/pkgs/lib/maintainers.nix +++ b/pkgs/lib/maintainers.nix @@ -8,6 +8,7 @@ eelco = "Eelco Dolstra "; ludo = "Ludovic Courtès "; marcweber = "Marc Weber "; + pierron = "Nicolas B. Pierron "; raskin = "Michael Raskin <7c6f434c@mail.ru>"; sander = "Sander van der Burg "; viric = "Lluís Batlle i Rossell "; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index df7f82a7e068..c85804ac79dd 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -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; };