tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
0
fork
atom
lol
0
fork
atom
overview
issues
pulls
pipelines
go: remove unused expressions for 1.1, 1.2, 1.3
Franz Pletz
9 years ago
ed0eb59c
4f299fdd
-305
3 changed files
expand all
collapse all
unified
split
pkgs
development
compilers
go
1.1.nix
1.2.nix
1.3.nix
-101
pkgs/development/compilers/go/1.1.nix
reviewed
···
1
1
-
{ stdenv, fetchurl, bison, glibc, bash, coreutils, makeWrapper, tzdata, iana_etc
2
2
-
, removeGodocExternals ? false }:
3
3
-
4
4
-
let
5
5
-
loader386 = "${glibc.out}/lib/ld-linux.so.2";
6
6
-
loaderAmd64 = "${glibc.out}/lib/ld-linux-x86-64.so.2";
7
7
-
loaderArm = "${glibc.out}/lib/ld-linux.so.3";
8
8
-
in
9
9
-
10
10
-
stdenv.mkDerivation {
11
11
-
name = "go-1.1.2";
12
12
-
13
13
-
src = fetchurl {
14
14
-
url = http://go.googlecode.com/files/go1.1.2.src.tar.gz;
15
15
-
sha256 = "0w7bchhb4b053az3wjp6z342rs9lp9nxf4w2mnfd1b89d6sb7izz";
16
16
-
};
17
17
-
18
18
-
buildInputs = [ bison glibc bash makeWrapper ];
19
19
-
20
20
-
NIX_CFLAGS_COMPILE = "-Wno-error=cpp";
21
21
-
22
22
-
# I'm not sure what go wants from its 'src', but the go installation manual
23
23
-
# describes an installation keeping the src.
24
24
-
preUnpack = ''
25
25
-
mkdir -p $out/share
26
26
-
cd $out/share
27
27
-
'';
28
28
-
29
29
-
prePatch = ''
30
30
-
cd ..
31
31
-
if [ ! -d go ]; then
32
32
-
mv * go
33
33
-
fi
34
34
-
cd go
35
35
-
36
36
-
patchShebangs ./ # replace /bin/bash
37
37
-
# !!! substituteInPlace does not seems to be effective.
38
38
-
sed -i 's,/lib/ld-linux.so.2,${loader386},' src/cmd/8l/asm.c
39
39
-
sed -i 's,/lib64/ld-linux-x86-64.so.2,${loaderAmd64},' src/cmd/6l/asm.c
40
40
-
sed -i 's,/lib64/ld-linux-x86-64.so.3,${loaderArm},' src/cmd/5l/asm.c
41
41
-
sed -i 's,/usr/share/zoneinfo/,${tzdata}/share/zoneinfo/,' src/pkg/time/zoneinfo_unix.go
42
42
-
sed -i 's,/etc/protocols,${iana_etc}/etc/protocols,' src/pkg/net/lookup_unix.go
43
43
-
44
44
-
#sed -i -e 's,/bin/cat,${coreutils}/bin/cat,' \
45
45
-
# -e 's,/bin/echo,${coreutils}/bin/echo,' \
46
46
-
# src/pkg/exec/exec_test.go
47
47
-
48
48
-
# Disabling the 'os/http/net' tests (they want files not available in
49
49
-
# chroot builds)
50
50
-
rm src/pkg/net/{multicast_test.go,parse_test.go,port_test.go}
51
51
-
# The os test wants to read files in an existing path. Just it don't be /usr/bin.
52
52
-
sed -i 's,/usr/bin,'"`pwd`", src/pkg/os/os_test.go
53
53
-
sed -i 's,/bin/pwd,'"`type -P pwd`", src/pkg/os/os_test.go
54
54
-
# Disable the hostname test
55
55
-
sed -i '/TestHostname/areturn' src/pkg/os/os_test.go
56
56
-
# ParseInLocation fails the test
57
57
-
sed -i '/TestParseInSydney/areturn' src/pkg/time/time_test.go
58
58
-
'' + stdenv.lib.optionalString removeGodocExternals ''
59
59
-
sed -i -e '/googleapi/d' -e '/javascript">$/,+6d' lib/godoc/godoc.html
60
60
-
'';
61
61
-
62
62
-
patches = [ ./cacert.patch ];
63
63
-
64
64
-
GOOS = "linux";
65
65
-
GOARCH = if stdenv.system == "i686-linux" then "386"
66
66
-
else if stdenv.system == "x86_64-linux" then "amd64"
67
67
-
else if stdenv.system == "armv5tel-linux" then "arm"
68
68
-
else throw "Unsupported system";
69
69
-
GOARM = stdenv.lib.optionalString (stdenv.system == "armv5tel-linux") "5";
70
70
-
71
71
-
installPhase = ''
72
72
-
mkdir -p "$out/bin"
73
73
-
export GOROOT="$(pwd)/"
74
74
-
export GOBIN="$out/bin"
75
75
-
export PATH="$GOBIN:$PATH"
76
76
-
cd ./src
77
77
-
./all.bash
78
78
-
cd -
79
79
-
80
80
-
# Wrap the tools to define the location of the
81
81
-
# libraries.
82
82
-
for a in go gofmt godoc; do
83
83
-
wrapProgram "$out/bin/$a" \
84
84
-
--set "GOROOT" $out/share/go \
85
85
-
${if stdenv.system == "armv5tel-linux" then "--set GOARM $GOARM" else ""}
86
86
-
done
87
87
-
88
88
-
# Copy the emacs configuration for Go files.
89
89
-
mkdir -p "$out/share/emacs/site-lisp"
90
90
-
cp ./misc/emacs/* $out/share/emacs/site-lisp/
91
91
-
'';
92
92
-
93
93
-
meta = {
94
94
-
branch = "1.1";
95
95
-
homepage = http://golang.org/;
96
96
-
description = "The Go Programming language";
97
97
-
license = "BSD";
98
98
-
maintainers = with stdenv.lib.maintainers; [ pierron viric ];
99
99
-
platforms = stdenv.lib.platforms.linux;
100
100
-
};
101
101
-
}
-91
pkgs/development/compilers/go/1.2.nix
reviewed
···
1
1
-
{ stdenv, fetchurl, bison, glibc, bash, coreutils, makeWrapper, tzdata, iana_etc }:
2
2
-
3
3
-
let
4
4
-
loader386 = "${glibc.out}/lib/ld-linux.so.2";
5
5
-
loaderAmd64 = "${glibc.out}/lib/ld-linux-x86-64.so.2";
6
6
-
loaderArm = "${glibc.out}/lib/ld-linux.so.3";
7
7
-
in
8
8
-
9
9
-
stdenv.mkDerivation {
10
10
-
name = "go-1.2.2";
11
11
-
12
12
-
src = fetchurl {
13
13
-
url = https://storage.googleapis.com/golang/go1.2.2.src.tar.gz;
14
14
-
sha1 = "3ce0ac4db434fc1546fec074841ff40dc48c1167";
15
15
-
};
16
16
-
17
17
-
buildInputs = [ bison glibc bash makeWrapper ];
18
18
-
19
19
-
NIX_CFLAGS_COMPILE = "-Wno-error=cpp";
20
20
-
21
21
-
# I'm not sure what go wants from its 'src', but the go installation manual
22
22
-
# describes an installation keeping the src.
23
23
-
preUnpack = ''
24
24
-
mkdir -p $out/share
25
25
-
cd $out/share
26
26
-
'';
27
27
-
28
28
-
prePatch = ''
29
29
-
cd ..
30
30
-
if [ ! -d go ]; then
31
31
-
mv * go
32
32
-
fi
33
33
-
cd go
34
34
-
35
35
-
patchShebangs ./ # replace /bin/bash
36
36
-
# !!! substituteInPlace does not seems to be effective.
37
37
-
sed -i 's,/lib/ld-linux.so.2,${loader386},' src/cmd/8l/asm.c
38
38
-
sed -i 's,/lib64/ld-linux-x86-64.so.2,${loaderAmd64},' src/cmd/6l/asm.c
39
39
-
sed -i 's,/lib64/ld-linux-x86-64.so.3,${loaderArm},' src/cmd/5l/asm.c
40
40
-
sed -i 's,/usr/share/zoneinfo/,${tzdata}/share/zoneinfo/,' src/pkg/time/zoneinfo_unix.go
41
41
-
sed -i 's,/etc/protocols,${iana_etc}/etc/protocols,' src/pkg/net/lookup_unix.go
42
42
-
43
43
-
#sed -i -e 's,/bin/cat,${coreutils}/bin/cat,' \
44
44
-
# -e 's,/bin/echo,${coreutils}/bin/echo,' \
45
45
-
# src/pkg/exec/exec_test.go
46
46
-
47
47
-
# Disabling the 'os/http/net' tests (they want files not available in
48
48
-
# chroot builds)
49
49
-
rm src/pkg/net/{multicast_test.go,parse_test.go,port_test.go}
50
50
-
# The os test wants to read files in an existing path. Just it don't be /usr/bin.
51
51
-
sed -i 's,/usr/bin,'"`pwd`", src/pkg/os/os_test.go
52
52
-
sed -i 's,/bin/pwd,'"`type -P pwd`", src/pkg/os/os_test.go
53
53
-
# Disable the hostname test
54
54
-
sed -i '/TestHostname/areturn' src/pkg/os/os_test.go
55
55
-
# ParseInLocation fails the test
56
56
-
sed -i '/TestParseInSydney/areturn' src/pkg/time/time_test.go
57
57
-
'';
58
58
-
59
59
-
patches = [ ./cacert-1.2.patch ];
60
60
-
61
61
-
GOOS = "linux";
62
62
-
GOARCH = if stdenv.system == "i686-linux" then "386"
63
63
-
else if stdenv.system == "x86_64-linux" then "amd64"
64
64
-
else if stdenv.system == "armv5tel-linux" then "arm"
65
65
-
else throw "Unsupported system";
66
66
-
GOARM = stdenv.lib.optionalString (stdenv.system == "armv5tel-linux") "5";
67
67
-
GO386 = 387; # from Arch: don't assume sse2 on i686
68
68
-
69
69
-
installPhase = ''
70
70
-
mkdir -p "$out/bin"
71
71
-
export GOROOT="$(pwd)/"
72
72
-
export GOBIN="$out/bin"
73
73
-
export PATH="$GOBIN:$PATH"
74
74
-
cd ./src
75
75
-
./all.bash
76
76
-
cd -
77
77
-
78
78
-
# Copy the emacs configuration for Go files.
79
79
-
mkdir -p "$out/share/emacs/site-lisp"
80
80
-
cp ./misc/emacs/* $out/share/emacs/site-lisp/
81
81
-
'';
82
82
-
83
83
-
meta = {
84
84
-
branch = "1.2";
85
85
-
homepage = http://golang.org/;
86
86
-
description = "The Go Programming language";
87
87
-
license = "BSD";
88
88
-
maintainers = with stdenv.lib.maintainers; [ pierron viric ];
89
89
-
platforms = stdenv.lib.platforms.linux;
90
90
-
};
91
91
-
}
-113
pkgs/development/compilers/go/1.3.nix
reviewed
···
1
1
-
{ stdenv, lib, fetchurl, fetchhg, bison, glibc, bash, coreutils, makeWrapper, tzdata, iana_etc, perl }:
2
2
-
3
3
-
let
4
4
-
loader386 = "${glibc.out}/lib/ld-linux.so.2";
5
5
-
loaderAmd64 = "${glibc.out}/lib/ld-linux-x86-64.so.2";
6
6
-
loaderArm = "${glibc.out}/lib/ld-linux.so.3";
7
7
-
srcs = {
8
8
-
golang = fetchurl {
9
9
-
url = https://storage.googleapis.com/golang/go1.3.3.src.tar.gz;
10
10
-
sha1 = "b54b7deb7b7afe9f5d9a3f5dd830c7dede35393a";
11
11
-
};
12
12
-
tools = fetchhg {
13
13
-
url = https://code.google.com/p/go.tools/;
14
14
-
rev = "e1c276c4e679";
15
15
-
sha256 = "0x62njflwkd99i2ixbksg6mjppl1wfg86f0g3swn350l1h0xzp76";
16
16
-
};
17
17
-
};
18
18
-
in
19
19
-
20
20
-
stdenv.mkDerivation {
21
21
-
name = "go-1.3.3";
22
22
-
23
23
-
src = srcs.golang;
24
24
-
25
25
-
# perl is used for testing go vet
26
26
-
buildInputs = [ bison bash makeWrapper perl ] ++ lib.optionals stdenv.isLinux [ glibc ] ;
27
27
-
28
28
-
# I'm not sure what go wants from its 'src', but the go installation manual
29
29
-
# describes an installation keeping the src.
30
30
-
preUnpack = ''
31
31
-
mkdir -p $out/share
32
32
-
cd $out/share
33
33
-
'';
34
34
-
postUnpack = ''
35
35
-
mkdir -p $out/share/go/src/pkg/code.google.com/p/
36
36
-
cp -rv --no-preserve=mode,ownership ${srcs.tools} $out/share/go/src/pkg/code.google.com/p/go.tools
37
37
-
'';
38
38
-
39
39
-
prePatch = ''
40
40
-
# Ensure that the source directory is named go
41
41
-
cd ..
42
42
-
if [ ! -d go ]; then
43
43
-
mv * go
44
44
-
fi
45
45
-
cd go
46
46
-
patchShebangs ./ # replace /bin/bash
47
47
-
48
48
-
# Disabling the 'os/http/net' tests (they want files not available in
49
49
-
# chroot builds)
50
50
-
rm src/pkg/net/{multicast_test.go,parse_test.go,port_test.go}
51
51
-
# !!! substituteInPlace does not seems to be effective.
52
52
-
# The os test wants to read files in an existing path. Just don't let it be /usr/bin.
53
53
-
sed -i 's,/usr/bin,'"`pwd`", src/pkg/os/os_test.go
54
54
-
sed -i 's,/bin/pwd,'"`type -P pwd`", src/pkg/os/os_test.go
55
55
-
# Disable the unix socket test
56
56
-
sed -i '/TestShutdownUnix/areturn' src/pkg/net/net_test.go
57
57
-
# Disable the hostname test
58
58
-
sed -i '/TestHostname/areturn' src/pkg/os/os_test.go
59
59
-
sed -i 's,/etc/protocols,${iana_etc}/etc/protocols,' src/pkg/net/lookup_unix.go
60
60
-
# ParseInLocation fails the test
61
61
-
sed -i '/TestParseInSydney/areturn' src/pkg/time/format_test.go
62
62
-
'' + lib.optionalString stdenv.isLinux ''
63
63
-
sed -i 's,/usr/share/zoneinfo/,${tzdata}/share/zoneinfo/,' src/pkg/time/zoneinfo_unix.go
64
64
-
sed -i 's,/lib/ld-linux.so.3,${loaderArm},' src/cmd/5l/asm.c
65
65
-
sed -i 's,/lib64/ld-linux-x86-64.so.2,${loaderAmd64},' src/cmd/6l/asm.c
66
66
-
sed -i 's,/lib/ld-linux.so.2,${loader386},' src/cmd/8l/asm.c
67
67
-
'';
68
68
-
69
69
-
patches = [ ./cacert-1.2.patch ];
70
70
-
71
71
-
GOOS = if stdenv.isDarwin then "darwin" else "linux";
72
72
-
GOARCH = if stdenv.isDarwin then "amd64"
73
73
-
else if stdenv.system == "i686-linux" then "386"
74
74
-
else if stdenv.system == "x86_64-linux" then "amd64"
75
75
-
else if stdenv.system == "armv5tel-linux" then "arm"
76
76
-
else throw "Unsupported system";
77
77
-
GOARM = stdenv.lib.optionalString (stdenv.system == "armv5tel-linux") "5";
78
78
-
GO386 = 387; # from Arch: don't assume sse2 on i686
79
79
-
CGO_ENABLED = if stdenv.isDarwin then 0 else 1;
80
80
-
81
81
-
installPhase = ''
82
82
-
export CC=cc
83
83
-
mkdir -p "$out/bin"
84
84
-
unset GOPATH
85
85
-
export GOROOT="$(pwd)/"
86
86
-
export GOBIN="$out/bin"
87
87
-
export PATH="$GOBIN:$PATH"
88
88
-
cd ./src
89
89
-
./all.bash
90
90
-
cd -
91
91
-
92
92
-
# Build extra tooling
93
93
-
# TODO: Fix godoc tests
94
94
-
TOOL_ROOT=code.google.com/p/go.tools/cmd
95
95
-
go install -v $TOOL_ROOT/cover $TOOL_ROOT/vet $TOOL_ROOT/godoc
96
96
-
go test -v $TOOL_ROOT/cover $TOOL_ROOT/vet # $TOOL_ROOT/godoc
97
97
-
98
98
-
# Copy the emacs configuration for Go files.
99
99
-
mkdir -p "$out/share/emacs/site-lisp"
100
100
-
cp ./misc/emacs/* $out/share/emacs/site-lisp/
101
101
-
'';
102
102
-
103
103
-
setupHook = ./setup-hook.sh;
104
104
-
105
105
-
meta = {
106
106
-
branch = "1.3";
107
107
-
homepage = http://golang.org/;
108
108
-
description = "The Go Programming language";
109
109
-
license = "BSD";
110
110
-
maintainers = with stdenv.lib.maintainers; [ cstrahan ];
111
111
-
platforms = stdenv.lib.platforms.linux ++ stdenv.lib.platforms.darwin;
112
112
-
};
113
113
-
}