Updating go, and making the go expression work in both i686-linux and x86_64-linux.

svn path=/nixpkgs/trunk/; revision=22230
This commit is contained in:
Lluís Batlle i Rossell 2010-06-12 11:21:20 +00:00
parent 9ffa9fc87f
commit 0530f43655
5 changed files with 32 additions and 62 deletions

View File

@ -1,17 +1,17 @@
{stdenv, mercurial, nix}: {url, tag ? null, md5}:
{stdenv, mercurial, nix}: {name ? null, url, tag ? null, md5 ? null, sha256 ? null}:
# TODO: statically check if mercurial as the https support if the url starts woth https.
stdenv.mkDerivation {
name = "fetchhg";
name = "fetchhg" + (if (name != null) then "-${name}" else "");
builder = ./builder.sh;
buildInputs = [mercurial nix];
# Nix <= 0.7 compatibility.
id = md5;
outputHashAlgo = "md5";
outputHashAlgo = if (md5 != null) then "md5" else "sha256";
outputHashMode = "recursive";
outputHash = md5;
outputHash = if (md5 != null) then md5 else sha256;
inherit url tag;
}

View File

@ -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.

View File

@ -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;
};
}

View File

@ -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 $?
-

View File

@ -2437,7 +2437,7 @@ let
};
go = import ../development/compilers/go {
inherit stdenv fetchhg glibc bison ed which bash makeWrapper;
inherit stdenv fetchhg glibc bison ed which bash makeWrapper perl;
};
gprolog = import ../development/compilers/gprolog {