about summary refs log tree commit diff
path: root/pkgs/development/compilers/go
diff options
context:
space:
mode:
authorLluís Batlle i Rossell <viric@vicerveza.homeunix.net>2010-06-12 11:21:20 +0000
committerLluís Batlle i Rossell <viric@vicerveza.homeunix.net>2010-06-12 11:21:20 +0000
commit0530f43655c5c48abe279df6c8c5dd32ea1e795a (patch)
tree6f98f31dfa4faee726f2e1f78d0d3485dd14e8f9 /pkgs/development/compilers/go
parent9ffa9fc87fd72dac188a085a154284b1de41c1b2 (diff)
Updating go, and making the go expression work in both i686-linux and x86_64-linux.
svn path=/nixpkgs/trunk/; revision=22230
Diffstat (limited to 'pkgs/development/compilers/go')
-rw-r--r--pkgs/development/compilers/go/cgo-set-local-to-match-gcc-error-messages.patch13
-rw-r--r--pkgs/development/compilers/go/default.nix41
-rw-r--r--pkgs/development/compilers/go/disable-system-dependent-tests.patch30
3 files changed, 27 insertions, 57 deletions
diff --git a/pkgs/development/compilers/go/cgo-set-local-to-match-gcc-error-messages.patch b/pkgs/development/compilers/go/cgo-set-local-to-match-gcc-error-messages.patch
deleted file mode 100644
index c0da4541a67de..0000000000000
--- a/pkgs/development/compilers/go/cgo-set-local-to-match-gcc-error-messages.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff -r 21cae7efdcc6 src/cmd/cgo/main.go
---- a/src/cmd/cgo/main.go	Sat Nov 14 12:23:24 2009 -0800
-+++ b/src/cmd/cgo/main.go	Sun Nov 15 00:00:09 2009 +0100
-@@ -52,6 +52,9 @@
- 		fatal("unknown architecture %s", arch)
- 	}
- 
-+	// Define the language of gcc error messages.
-+	os.Setenv("LC_ALL", "C");
-+
- 	p := openProg(input);
- 	for _, cref := range p.Crefs {
- 		// Convert C.ulong to C.unsigned long, etc.
diff --git a/pkgs/development/compilers/go/default.nix b/pkgs/development/compilers/go/default.nix
index d5314a976a23f..7ea6632719379 100644
--- a/pkgs/development/compilers/go/default.nix
+++ b/pkgs/development/compilers/go/default.nix
@@ -1,37 +1,50 @@
-{stdenv, fetchhg, bison, glibc, ed, which, bash, makeWrapper, ...}:
+{stdenv, fetchhg, bison, glibc, ed, which, bash, makeWrapper, perl, ...}:
 
 let
-  version = "2009-11-12";
-  md5 = "66e5803c8dc2855b339151918b6b0de5";
+  version = "2010-06-09";
+  sha256 = "b607879b333ef100466c726a13cc69ed143566a3c1af59f6d33a6e90b9d0c917";
+
+  loader386 = "${glibc}/lib/ld-linux.so.2";
+  loaderAmd64 = "${glibc}/lib/ld-linux-x86-64.so.2";
 in
 
 stdenv.mkDerivation {
-  name = "Go-" + version;
+  name = "go-" + version;
 
   # No tarball yet.
   src = fetchhg {
     url = https://go.googlecode.com/hg/;
     tag = "release." + version;
-    inherit md5;
+    inherit sha256;
   };
 
   buildInputs = [ bison glibc ed which bash makeWrapper ];
 
-  patches = [
-    ./disable-system-dependent-tests.patch
-    ./cgo-set-local-to-match-gcc-error-messages.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
+    sed -i 's,/lib/ld-linux.so.2,${loader386},' src/cmd/8l/asm.c
+    sed -i 's,/lib64/ld-linux-x86-64.so.2,${loaderAmd64},' src/cmd/6l/asm.c
     sed -i 's,/usr/share/zoneinfo/,${glibc}/share/zoneinfo/,' src/pkg/time/zoneinfo.go
+    sed -i 's,/bin/ed,${ed}/bin/ed,' src/cmd/6l/mkenam
+
+    sed -i -e 's,/bin/cat,${stdenv.coreutils}/bin/cat,' \
+      -e 's,/bin/echo,${stdenv.coreutils}/bin/echo,' \
+      src/pkg/exec/exec_test.go
+
+    # Disabling the 'os' test (it wants to call hostname, and I don't
+    # know if we have that ready in chroot builds)
+    sed -i -e '/^NOTEST=/a\\tos\\' src/pkg/Makefile
+
+    sed -i -e 's,/bin:/usr/bin:/usr/local/bin,'$PATH, test/run
+    sed -i -e 's,/usr/bin/perl,${perl}/bin/perl,' test/errchk
   '';
 
   GOOS = "linux";
-  GOARCH = "386";
+  GOARCH = if (stdenv.system == "i686-linux") then "386"
+          else if (stdenv.system == "x86_64-linux") then "amd64"
+          else throw "Unsupported system";
 
   installPhase = ''
     ensureDir "$out/bin"
@@ -64,13 +77,13 @@ stdenv.mkDerivation {
     # Copy the emacs configuration for Go files.
     ensureDir "$out/share/emacs/site-lisp"
     cp ./misc/emacs/* $out/share/emacs/site-lisp/ # */
-
   '';
 
   meta = {
     homepage = http://golang.org/;
     description = "The Go Programming language";
     license = "BSD";
-    maintainers = with stdenv.lib.maintainers; [ pierron ];
+    maintainers = with stdenv.lib.maintainers; [ pierron viric ];
+    platforms = stdenv.lib.platforms.linux;
   };
 }
diff --git a/pkgs/development/compilers/go/disable-system-dependent-tests.patch b/pkgs/development/compilers/go/disable-system-dependent-tests.patch
deleted file mode 100644
index d9e7fa48c1fa1..0000000000000
--- a/pkgs/development/compilers/go/disable-system-dependent-tests.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-diff -r cb140bac9ab0 src/pkg/Makefile
---- a/src/pkg/Makefile	Thu Nov 12 14:55:26 2009 -0800
-+++ b/src/pkg/Makefile	Mon Nov 16 11:50:34 2009 +0100
-@@ -100,12 +100,15 @@
- 
- NOTEST=\
- 	debug/proc\
-+	exec\
- 	go/ast\
- 	go/doc\
- 	go/token\
- 	hash\
- 	image\
-+	log\
- 	malloc\
-+	os\
- 	rand\
- 	runtime\
- 	syscall\
-diff -r cb140bac9ab0 src/run.bash
---- a/src/run.bash	Thu Nov 12 14:55:26 2009 -0800
-+++ b/src/run.bash	Mon Nov 16 11:50:34 2009 +0100
-@@ -69,7 +69,3 @@
- ./timing.sh -test
- ) || exit $?
- 
--(xcd ../test
--./run
--) || exit $?
--