From e5bf4de6b650a3a3a39a6a646391a223aec7da9f Mon Sep 17 00:00:00 2001 From: Lluis Batlle Date: Sun, 26 Aug 2012 23:15:02 +0200 Subject: [PATCH] go: improving the expression so it works if overriden by hg src Users might want to override the 'src' and 'name' of go from 'hg'. I make the expression compatible with that. Aside, I also set GOARM in the wrapper for it to build programs fine on armv5tel by default. --- pkgs/development/compilers/go/default.nix | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pkgs/development/compilers/go/default.nix b/pkgs/development/compilers/go/default.nix index 0ced1da95d4..1d9765539bf 100644 --- a/pkgs/development/compilers/go/default.nix +++ b/pkgs/development/compilers/go/default.nix @@ -24,6 +24,12 @@ stdenv.mkDerivation { ''; prePatch = '' + cd .. + if [ ! -d go ]; then + mv * go + fi + cd go + patchShebangs ./ # replace /bin/bash # !!! substituteInPlace does not seems to be effective. sed -i 's,/lib/ld-linux.so.2,${loader386},' src/cmd/8l/asm.c @@ -67,7 +73,8 @@ stdenv.mkDerivation { # libraries. for a in go gofmt godoc; do wrapProgram "$out/bin/$a" \ - --set "GOROOT" "$out/share/go/" + --set "GOROOT" $out/share/go \ + ${if (stdenv.system == "armv5tel-linux") then "--set GOARM $GOARM" else ""} done # Copy the emacs configuration for Go files.