summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorNicolas Pierron <nicolas.b.pierron@gmail.com>2009-11-16 18:42:43 +0000
committerNicolas Pierron <nicolas.b.pierron@gmail.com>2009-11-16 18:42:43 +0000
commit29384d43f2d1d1ae86865405c00fdc1e196de246 (patch)
treeb89ac59ab1b676bce9a52915df0b9951faad02fd /pkgs
parentede54260709c8265a7d1ee41796702c4ba2fb7e9 (diff)
downloadnixpkgs-29384d43f2d1d1ae86865405c00fdc1e196de246.tar
nixpkgs-29384d43f2d1d1ae86865405c00fdc1e196de246.tar.gz
nixpkgs-29384d43f2d1d1ae86865405c00fdc1e196de246.tar.bz2
nixpkgs-29384d43f2d1d1ae86865405c00fdc1e196de246.tar.lz
nixpkgs-29384d43f2d1d1ae86865405c00fdc1e196de246.tar.xz
nixpkgs-29384d43f2d1d1ae86865405c00fdc1e196de246.tar.zst
nixpkgs-29384d43f2d1d1ae86865405c00fdc1e196de246.zip
* Update Go's version. Make 8g & 8l commands working with no need of
  extra argument to locate the Go's libraries.

svn path=/nixpkgs/trunk/; revision=18376
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/development/compilers/go/default.nix32
-rw-r--r--pkgs/development/compilers/go/disable-system-dependent-tests.patch19
-rw-r--r--pkgs/development/compilers/go/pkg-log-test-accept-period-in-file-path.patch14
-rw-r--r--pkgs/top-level/all-packages.nix2
4 files changed, 36 insertions, 31 deletions
diff --git a/pkgs/development/compilers/go/default.nix b/pkgs/development/compilers/go/default.nix
index ebec69535e1..d5314a976a2 100644
--- a/pkgs/development/compilers/go/default.nix
+++ b/pkgs/development/compilers/go/default.nix
@@ -1,7 +1,7 @@
-{stdenv, fetchhg, bison, glibc, ed, which, bash, ...}:
+{stdenv, fetchhg, bison, glibc, ed, which, bash, makeWrapper, ...}:
 
 let
-  version = "2009-11-10.1";
+  version = "2009-11-12";
   md5 = "66e5803c8dc2855b339151918b6b0de5";
 in
 
@@ -15,11 +15,10 @@ stdenv.mkDerivation {
     inherit md5;
   };
 
-  buildInputs = [ bison glibc ed which bash ];
+  buildInputs = [ bison glibc ed which bash makeWrapper ];
 
   patches = [
     ./disable-system-dependent-tests.patch
-    ./pkg-log-test-accept-period-in-file-path.patch
     ./cgo-set-local-to-match-gcc-error-messages.patch
   ];
 
@@ -35,7 +34,6 @@ stdenv.mkDerivation {
   GOARCH = "386";
 
   installPhase = ''
-    ensureDir "$out"
     ensureDir "$out/bin"
     export GOROOT="$(pwd)/"
     export GOBIN="$out/bin"
@@ -43,6 +41,30 @@ stdenv.mkDerivation {
     cd ./src
     ./all.bash
     cd -
+
+    # Handle Libraries and make them availabale under /share/go.
+    export GOLIB="pkg/"$GOOS"_"$GOARCH
+    ensureDir "$out/lib/go/$GOLIB"
+    cp -r ./$GOLIB $out/lib/go/pkg/
+
+    # this line set $AS $CC $GC $LD
+    source ./src/Make.$GOARCH
+
+    # Wrap the compiler and the linker to define the location of the
+    # libraries.
+    wrapProgram "$out/bin/$GC" \
+      --add-flags "-I" \
+      --add-flags "$out/lib/go/$GOLIB"
+
+    wrapProgram "$out/bin/$LD" \
+      --set "GOROOT" "$out/lib/go/" \
+      --set "GOOS" "$GOOS" \
+      --set "GOARCH" "$GOARCH"
+
+    # Copy the emacs configuration for Go files.
+    ensureDir "$out/share/emacs/site-lisp"
+    cp ./misc/emacs/* $out/share/emacs/site-lisp/ # */
+
   '';
 
   meta = {
diff --git a/pkgs/development/compilers/go/disable-system-dependent-tests.patch b/pkgs/development/compilers/go/disable-system-dependent-tests.patch
index 550d1a4ac25..d9e7fa48c1f 100644
--- a/pkgs/development/compilers/go/disable-system-dependent-tests.patch
+++ b/pkgs/development/compilers/go/disable-system-dependent-tests.patch
@@ -1,7 +1,7 @@
-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,18 @@
+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\
@@ -11,18 +11,15 @@ diff -r b51fd2d6c160 src/pkg/Makefile
  	go/token\
  	hash\
  	image\
++	log\
  	malloc\
 +	os\
  	rand\
  	runtime\
  	syscall\
- 	testing/iotest\
- 
- 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
+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 $?
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
deleted file mode 100644
index 9cfe8f68ae0..00000000000
--- a/pkgs/development/compilers/go/pkg-log-test-accept-period-in-file-path.patch
+++ /dev/null
@@ -1,14 +0,0 @@
-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/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index c85804ac79d..272f39c9400 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -2066,7 +2066,7 @@ let
   };
 
   go = import ../development/compilers/go {
-    inherit stdenv fetchhg glibc bison ed which bash;
+    inherit stdenv fetchhg glibc bison ed which bash makeWrapper;
   };
 
   gprolog = import ../development/compilers/gprolog {