summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOndřej Surý <ondrej@sury.org>2011-02-16 14:55:56 +0100
committerOndřej Surý <ondrej@sury.org>2011-02-18 11:34:57 +0100
commitf30cf701e9d48fcb537314f4f338b3476e7b002f (patch)
tree85e071c648c934ed29908fe0b9f28c58cb0f1703
parent86b89c887566fdf6c87bd6c377786d345fbfd039 (diff)
downloadgolang-f30cf701e9d48fcb537314f4f338b3476e7b002f.tar.gz
Correctly export GOROOT_FINAL to the subprocess environment
-rw-r--r--debian/patches/002-use_GOROOT_FINAL_in_generated_binaries.patch21
-rw-r--r--debian/patches/003-set_correct_runpath.patch11
-rw-r--r--debian/patches/series2
-rwxr-xr-xdebian/rules2
4 files changed, 35 insertions, 1 deletions
diff --git a/debian/patches/002-use_GOROOT_FINAL_in_generated_binaries.patch b/debian/patches/002-use_GOROOT_FINAL_in_generated_binaries.patch
new file mode 100644
index 000000000..77f9bccc7
--- /dev/null
+++ b/debian/patches/002-use_GOROOT_FINAL_in_generated_binaries.patch
@@ -0,0 +1,21 @@
+--- a/src/pkg/runtime/Makefile
++++ b/src/pkg/runtime/Makefile
+@@ -129,7 +129,7 @@ mkversion: mkversion.c
+ quietgcc -o $@ -I "$(GOROOT)/include" $< "$(GOROOT)/lib/lib9.a"
+
+ version.go: mkversion
+- ./mkversion >version.go
++ GOROOT=$(QUOTED_GOROOT_FINAL) ./mkversion >version.go
+
+ version_$(GOARCH).go:
+ (echo 'package runtime'; echo 'const theGoarch = "$(GOARCH)"') >$@
+--- a/src/Make.inc
++++ b/src/Make.inc
+@@ -82,6 +82,7 @@ export GOARCH GOOS GOHOSTARCH GOHOSTOS
+ nullstring :=
+ space := $(nullstring) # a space at the end
+ QUOTED_GOROOT:=$(subst $(space),\ ,$(GOROOT))
++QUOTED_GOROOT_FINAL:=$(subst $(space),\ ,$(GOROOT_FINAL))
+
+ # default GOBIN
+ ifndef GOBIN
diff --git a/debian/patches/003-set_correct_runpath.patch b/debian/patches/003-set_correct_runpath.patch
new file mode 100644
index 000000000..c7d2f5fc2
--- /dev/null
+++ b/debian/patches/003-set_correct_runpath.patch
@@ -0,0 +1,11 @@
+--- a/src/Make.cmd
++++ b/src/Make.cmd
+@@ -13,7 +13,7 @@ include $(QUOTED_GOROOT)/src/Make.common
+ PREREQ+=$(patsubst %,%.make,$(DEPS))
+
+ $(TARG): _go_.$O
+- $(LD) -o $@ _go_.$O
++ $(LD) -o $@ -r $(QUOTED_GOROOT_FINAL)/pkg/$(GOOS)_$(GOARCH) _go_.$O
+
+ _go_.$O: $(GOFILES) $(PREREQ)
+ $(GC) -o $@ $(GOFILES)
diff --git a/debian/patches/series b/debian/patches/series
index 36ee79f8d..144de93e9 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,3 @@
001-allow_IPv4_on_IPv6_sockets.patch
+002-use_GOROOT_FINAL_in_generated_binaries.patch
+003-set_correct_runpath.patch
diff --git a/debian/rules b/debian/rules
index 6d5e7a5f6..032ffe80c 100755
--- a/debian/rules
+++ b/debian/rules
@@ -113,7 +113,7 @@ else
GOARCH := $(DEB_HOST_ARCH_CPU)
endif
-export GOROOT GOOS GOARCH GOARM GOBIN GOHOSTARCH GOHOSTOS
+export GOROOT GOROOT_FINAL GOOS GOARCH GOARM GOBIN GOHOSTARCH GOHOSTOS
REPO = https://go.googlecode.com/hg/
REV = release