lol
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

go-1.5: fix build on darwin, set to default version for all platforms

+29 -7
+2
pkgs/development/compilers/go/1.4.nix
··· 72 sed -i '/TestResolveTCPAddr/areturn' src/net/tcp_test.go 73 sed -i '/TestResolveUDPAddr/areturn' src/net/udp_test.go 74 75 touch $TMPDIR/group $TMPDIR/hosts $TMPDIR/passwd 76 ''; 77
··· 72 sed -i '/TestResolveTCPAddr/areturn' src/net/tcp_test.go 73 sed -i '/TestResolveUDPAddr/areturn' src/net/udp_test.go 74 75 + sed -i '/TestCgoExternalThreadSIGPROF/areturn' src/runtime/crash_cgo_test.go 76 + 77 touch $TMPDIR/group $TMPDIR/hosts $TMPDIR/passwd 78 ''; 79
+13 -3
pkgs/development/compilers/go/1.5.nix
··· 1 { stdenv, lib, fetchurl, tzdata, iana_etc, go_1_4, runCommand 2 , perl, which, pkgconfig, patch 3 , pcre 4 - , Security }: 5 6 let 7 goBootstrap = runCommand "go-bootstrap" {} '' ··· 25 # perl is used for testing go vet 26 nativeBuildInputs = [ perl which pkgconfig patch ]; 27 buildInputs = [ pcre ]; 28 - propagatedBuildInputs = lib.optional stdenv.isDarwin Security; 29 30 # I'm not sure what go wants from its 'src', but the go installation manual 31 # describes an installation keeping the src. ··· 67 '' + lib.optionalString stdenv.isLinux '' 68 sed -i 's,/usr/share/zoneinfo/,${tzdata}/share/zoneinfo/,' src/time/zoneinfo_unix.go 69 '' + lib.optionalString stdenv.isDarwin '' 70 sed -i 's,"/etc","'"$TMPDIR"'",' src/os/os_test.go 71 sed -i 's,/_go_os_test,'"$TMPDIR"'/_go_os_test,' src/os/path_test.go 72 sed -i '/TestRead0/areturn' src/os/os_test.go 73 sed -i '/TestSystemRoots/areturn' src/crypto/x509/root_darwin_test.go 74 75 touch $TMPDIR/group $TMPDIR/hosts $TMPDIR/passwd 76 ''; ··· 78 patches = [ 79 ./cacert-1.5.patch 80 ./remove-tools-1.5.patch 81 - ]; 82 83 GOOS = if stdenv.isDarwin then "darwin" else "linux"; 84 GOARCH = if stdenv.isDarwin then "amd64"
··· 1 { stdenv, lib, fetchurl, tzdata, iana_etc, go_1_4, runCommand 2 , perl, which, pkgconfig, patch 3 , pcre 4 + , Security, Foundation }: 5 6 let 7 goBootstrap = runCommand "go-bootstrap" {} '' ··· 25 # perl is used for testing go vet 26 nativeBuildInputs = [ perl which pkgconfig patch ]; 27 buildInputs = [ pcre ]; 28 + propagatedBuildInputs = lib.optionals stdenv.isDarwin [ 29 + Security Foundation 30 + ]; 31 32 # I'm not sure what go wants from its 'src', but the go installation manual 33 # describes an installation keeping the src. ··· 69 '' + lib.optionalString stdenv.isLinux '' 70 sed -i 's,/usr/share/zoneinfo/,${tzdata}/share/zoneinfo/,' src/time/zoneinfo_unix.go 71 '' + lib.optionalString stdenv.isDarwin '' 72 + substituteInPlace src/race.bash --replace \ 73 + "sysctl machdep.cpu.extfeatures | grep -qv EM64T" true 74 + sed -i 's,strings.Contains(.*sysctl.*,true {,' src/cmd/dist/util.go 75 sed -i 's,"/etc","'"$TMPDIR"'",' src/os/os_test.go 76 sed -i 's,/_go_os_test,'"$TMPDIR"'/_go_os_test,' src/os/path_test.go 77 sed -i '/TestRead0/areturn' src/os/os_test.go 78 sed -i '/TestSystemRoots/areturn' src/crypto/x509/root_darwin_test.go 79 + 80 + sed -i '/TestDisasmExtld/areturn' src/cmd/objdump/objdump_test.go 81 82 touch $TMPDIR/group $TMPDIR/hosts $TMPDIR/passwd 83 ''; ··· 85 patches = [ 86 ./cacert-1.5.patch 87 ./remove-tools-1.5.patch 88 + ] 89 + # -ldflags=-s is required to compile on Darwin, see 90 + # https://github.com/golang/go/issues/11994 91 + ++ stdenv.lib.optional stdenv.isDarwin ./strip.patch; 92 93 GOOS = if stdenv.isDarwin then "darwin" else "linux"; 94 GOARCH = if stdenv.isDarwin then "amd64"
+12
pkgs/development/compilers/go/strip.patch
···
··· 1 + diff --git a/src/cmd/go/build.go b/src/cmd/go/build.go 2 + index 0b14725..a7608ce 100644 3 + --- a/src/cmd/go/build.go 4 + +++ b/src/cmd/go/build.go 5 + @@ -2310,6 +2310,7 @@ func (gcToolchain) ld(b *builder, root *action, out string, allactions []*action 6 + } 7 + } 8 + var ldflags []string 9 + + ldflags = append(ldflags, "-s") 10 + if buildContext.InstallSuffix != "" { 11 + ldflags = append(ldflags, "-installsuffix", buildContext.InstallSuffix) 12 + }
+2 -4
pkgs/top-level/all-packages.nix
··· 4053 }; 4054 4055 go_1_5 = callPackage ../development/compilers/go/1.5.nix { 4056 - inherit (darwin.apple_sdk.frameworks) Security; 4057 }; 4058 4059 - go = if stdenv.isDarwin 4060 - then go_1_4 # missing DWARF files during go-1.5 build 4061 - else go_1_5; 4062 4063 go-repo-root = goPackages.go-repo-root.bin // { outputs = [ "bin" ]; }; 4064
··· 4053 }; 4054 4055 go_1_5 = callPackage ../development/compilers/go/1.5.nix { 4056 + inherit (darwin.apple_sdk.frameworks) Security Foundation; 4057 }; 4058 4059 + go = go_1_5; 4060 4061 go-repo-root = goPackages.go-repo-root.bin // { outputs = [ "bin" ]; }; 4062