nixpkgs/pkgs/development/compilers/go/default.nix
Nicolas Pierron 66ef37d260 * Fix "cgo" binary be defining LC_ALL=C inside the binary.
svn path=/nixpkgs/trunk/; revision=18350
2009-11-14 23:39:53 +00:00

55 lines
1.2 KiB
Nix

{stdenv, fetchhg, bison, glibc, ed, which, bash, ...}:
let
version = "2009-11-10.1";
md5 = "66e5803c8dc2855b339151918b6b0de5";
in
stdenv.mkDerivation {
name = "Go-" + version;
# No tarball yet.
src = fetchhg {
url = https://go.googlecode.com/hg/;
tag = "release." + version;
inherit md5;
};
buildInputs = [ bison glibc ed which bash ];
patches = [
./disable-system-dependent-tests.patch
./pkg-log-test-accept-period-in-file-path.patch
./cgo-set-local-to-match-gcc-error-messages.patch
];
prePatch = ''
patchShebangs ./ # replace /bin/bash
# only for 386 build
# !!! substituteInPlace does not seems to be effective.
sed -i 's,/lib/ld-linux.so.2,${glibc}/lib/ld-linux.so.2,' src/cmd/8l/asm.c
sed -i 's,/usr/share/zoneinfo/,${glibc}/share/zoneinfo/,' src/pkg/time/zoneinfo.go
'';
GOOS = "linux";
GOARCH = "386";
installPhase = ''
ensureDir "$out"
ensureDir "$out/bin"
export GOROOT="$(pwd)/"
export GOBIN="$out/bin"
export PATH="$GOBIN:$PATH"
cd ./src
./all.bash
cd -
'';
meta = {
homepage = http://golang.org/;
description = "The Go Programming language";
license = "BSD";
maintainers = with stdenv.lib.maintainers; [ pierron ];
};
}