@@ -1,95 +0,0 @@
1−{ stdenv, fetchurl, bison, glibc, bash, coreutils, makeWrapper, tzdata}:
2−
3−let
4− loader386 = "${glibc.out}/lib/ld-linux.so.2";
5− loaderAmd64 = "${glibc.out}/lib/ld-linux-x86-64.so.2";
6− loaderArm = "${glibc.out}/lib/ld-linux.so.3";
7−in
8−
9−stdenv.mkDerivation {
10− name = "go-1.0.3";
11−
12− src = fetchurl {
13− url = http://go.googlecode.com/files/go1.0.3.src.tar.gz;
14− sha256 = "1pz31az3icwqfqfy3avms05jnqr0qrbrx9yqsclkdwbjs4rkbfkz";
15− };
16−
17− buildInputs = [ bison glibc bash makeWrapper ];
18−
19− # I'm not sure what go wants from its 'src', but the go installation manual
20− # describes an installation keeping the src.
21− preUnpack = ''
22− mkdir -p $out/share
23− cd $out/share
24− '';
25−
26− prePatch = ''
27− cd ..
28− if [ ! -d go ]; then
29− mv * go
30− fi
31− cd go
32−
33− patchShebangs ./ # replace /bin/bash
34− # !!! substituteInPlace does not seems to be effective.
35− sed -i 's,/lib/ld-linux.so.2,${loader386},' src/cmd/8l/asm.c
36− sed -i 's,/lib64/ld-linux-x86-64.so.2,${loaderAmd64},' src/cmd/6l/asm.c
37− sed -i 's,/lib64/ld-linux-x86-64.so.3,${loaderArm},' src/cmd/5l/asm.c
38− sed -i 's,/usr/share/zoneinfo/,${tzdata}/share/zoneinfo/,' src/pkg/time/zoneinfo_unix.go
39−
40− #sed -i -e 's,/bin/cat,${coreutils}/bin/cat,' \
41− # -e 's,/bin/echo,${coreutils}/bin/echo,' \
42− # src/pkg/exec/exec_test.go
43−
44− # Disabling the 'os/http/net' tests (they want files not available in
45− # chroot builds)
46− rm src/pkg/net/{multicast_test.go,parse_test.go,port_test.go}
47− # The os test wants to read files in an existing path. Just it don't be /usr/bin.
48− sed -i 's,/usr/bin,'"`pwd`", src/pkg/os/os_test.go
49− sed -i 's,/bin/pwd,'"`type -P pwd`", src/pkg/os/os_test.go
50− # Disable the hostname test
51− sed -i '/TestHostname/areturn' src/pkg/os/os_test.go
52− '';
53−
54− patches = [ ./cacert.patch ./1_0-opt-error.patch ./1_0-gcc-bug.patch ];
55−
56− GOOS = "linux";
57− GOARCH = if stdenv.system == "i686-linux" then "386"
58− else if stdenv.system == "x86_64-linux" then "amd64"
59− else if stdenv.system == "armv5tel-linux" then "arm"
60− else throw "Unsupported system";
61− GOARM = stdenv.lib.optionalString (stdenv.system == "armv5tel-linux") "5";
62−
63− NIX_CFLAGS_COMPILE = "-Wno-error=cpp";
64−
65− installPhase = ''
66− mkdir -p "$out/bin"
67− export GOROOT="$(pwd)/"
68− export GOBIN="$out/bin"
69− export PATH="$GOBIN:$PATH"
70− cd ./src
71− ./all.bash
72− cd -
73−
74− # Wrap the tools to define the location of the
75− # libraries.
76− for a in go gofmt godoc; do
77− wrapProgram "$out/bin/$a" \
78− --set "GOROOT" $out/share/go \
79− ${if stdenv.system == "armv5tel-linux" then "--set GOARM $GOARM" else ""}
80− done
81−
82− # Copy the emacs configuration for Go files.
83− mkdir -p "$out/share/emacs/site-lisp"
84− cp ./misc/emacs/* $out/share/emacs/site-lisp/
85− '';
86−
87− meta = {
88− branch = "1.0";
89− homepage = http://golang.org/;
90− description = "The Go Programming language";
91− license = "BSD";
92− maintainers = with stdenv.lib.maintainers; [ pierron viric ];
93− platforms = stdenv.lib.platforms.linux;
94− };
95−}