summary refs log tree commit diff
path: root/pkgs/development/compilers/go/1.4.nix
diff options
context:
space:
mode:
authorJude Taylor <me@jude.bio>2015-07-11 16:04:47 -0700
committerJude Taylor <me@jude.bio>2015-07-11 16:05:04 -0700
commit2767e93843ac8e0d216d7eb566e0d0d86ed73068 (patch)
tree03fab9bcc9c1ee818e35a272473465f6e69d7426 /pkgs/development/compilers/go/1.4.nix
parent682dc3ee70c7a24b0eac93189bf66a2eb331f0a0 (diff)
downloadnixlib-2767e93843ac8e0d216d7eb566e0d0d86ed73068.tar
nixlib-2767e93843ac8e0d216d7eb566e0d0d86ed73068.tar.gz
nixlib-2767e93843ac8e0d216d7eb566e0d0d86ed73068.tar.bz2
nixlib-2767e93843ac8e0d216d7eb566e0d0d86ed73068.tar.lz
nixlib-2767e93843ac8e0d216d7eb566e0d0d86ed73068.tar.xz
nixlib-2767e93843ac8e0d216d7eb566e0d0d86ed73068.tar.zst
nixlib-2767e93843ac8e0d216d7eb566e0d0d86ed73068.zip
darwin purity: go-1.4
Diffstat (limited to 'pkgs/development/compilers/go/1.4.nix')
-rw-r--r--pkgs/development/compilers/go/1.4.nix16
1 files changed, 13 insertions, 3 deletions
diff --git a/pkgs/development/compilers/go/1.4.nix b/pkgs/development/compilers/go/1.4.nix
index 12642eeace58..d42873ab975d 100644
--- a/pkgs/development/compilers/go/1.4.nix
+++ b/pkgs/development/compilers/go/1.4.nix
@@ -1,4 +1,6 @@
-{ stdenv, lib, fetchurl, bison, glibc, bash, coreutils, makeWrapper, tzdata, iana_etc, perl, Security, goPackages }:
+{ stdenv, lib, fetchurl, bison, glibc, bash, coreutils, makeWrapper, tzdata, iana_etc, perl, goPackages
+
+, Security }:
 
 let
   loader386 = "${glibc}/lib/ld-linux.so.2";
@@ -17,8 +19,9 @@ stdenv.mkDerivation rec {
 
   # perl is used for testing go vet
   buildInputs = [ bison bash makeWrapper perl ]
-             ++ lib.optionals stdenv.isLinux [ glibc ]
-             ++ lib.optionals stdenv.isDarwin [ Security ];
+             ++ lib.optionals stdenv.isLinux [ glibc ];
+
+  propagatedBuildInputs = lib.optional stdenv.isDarwin Security;
 
   # I'm not sure what go wants from its 'src', but the go installation manual
   # describes an installation keeping the src.
@@ -56,6 +59,13 @@ stdenv.mkDerivation rec {
     sed -i 's,/lib/ld-linux.so.3,${loaderArm},' src/cmd/5l/asm.c
     sed -i 's,/lib64/ld-linux-x86-64.so.2,${loaderAmd64},' src/cmd/6l/asm.c
     sed -i 's,/lib/ld-linux.so.2,${loader386},' src/cmd/8l/asm.c
+  '' + lib.optionalString stdenv.isDarwin ''
+    sed -i 's,"/etc","'"$TMPDIR"'",' src/os/os_test.go
+    sed -i 's,/_go_os_test,'"$TMPDIR"'/_go_os_test,' src/os/path_test.go
+    sed -i '/TestRead0/areturn' src/os/os_test.go
+    sed -i '/TestSystemRoots/areturn' src/crypto/x509/root_darwin_test.go
+
+    touch $TMPDIR/group $TMPDIR/hosts $TMPDIR/passwd
   '';
 
   patches = [