[99766] trunk/dports/lang/go
cal at macports.org
cal at macports.org
Fri Nov 16 17:07:33 PST 2012
Revision: 99766
https://trac.macports.org/changeset/99766
Author: cal at macports.org
Date: 2012-11-16 17:07:33 -0800 (Fri, 16 Nov 2012)
Log Message:
-----------
go: ensure we're UsingTheRightCompiler, blacklist clang
Modified Paths:
--------------
trunk/dports/lang/go/Portfile
Added Paths:
-----------
trunk/dports/lang/go/files/
trunk/dports/lang/go/files/patch-src_cmd_go_build.go-use-correct-compiler.diff
trunk/dports/lang/go/files/patch-src_make.bash-use-correct-compiler.diff
Modified: trunk/dports/lang/go/Portfile
===================================================================
--- trunk/dports/lang/go/Portfile 2012-11-17 01:01:16 UTC (rev 99765)
+++ trunk/dports/lang/go/Portfile 2012-11-17 01:07:33 UTC (rev 99766)
@@ -1,3 +1,4 @@
+# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
# $Id$
PortSystem 1.0
@@ -5,7 +6,7 @@
name go
epoch 2
version 1.0.2
-revision 0
+revision 1
categories lang
platforms darwin freebsd linux
license BSD
@@ -65,8 +66,18 @@
}
}
+patchfiles patch-src_make.bash-use-correct-compiler.diff \
+ patch-src_cmd_go_build.go-use-correct-compiler.diff
+
+post-patch {
+ reinplace "s#@CC@#${configure.cc}#g" ${worksrcpath}/src/cmd/go/build.go
+}
+
use_configure no
+# attempting the build with clang fails on some go code
+compiler.blacklist clang
+
pre-build {
xinstall -m 755 -d ${GOROOT} ${GOBIN}
}
@@ -74,7 +85,11 @@
build.cmd ./make.bash
build.target
build.env GOROOT=${GOROOT} GOBIN=${GOBIN} GOARCH=${GOARCH} \
- GOROOT_FINAL=${prefix}
+ GOROOT_FINAL=${prefix} \
+ CC=${configure.cc} \
+ GCC=${configure.cc} \
+ GO_GCFLAGS=${configure.cflags} \
+ GO_LDFLAGS=${configure.ldflags}
use_parallel_build no
post-build {
# remove mercurial extras
Added: trunk/dports/lang/go/files/patch-src_cmd_go_build.go-use-correct-compiler.diff
===================================================================
--- trunk/dports/lang/go/files/patch-src_cmd_go_build.go-use-correct-compiler.diff (rev 0)
+++ trunk/dports/lang/go/files/patch-src_cmd_go_build.go-use-correct-compiler.diff 2012-11-17 01:07:33 UTC (rev 99766)
@@ -0,0 +1,11 @@
+--- src/cmd/go/build.go.orig 2012-11-17 01:37:21.000000000 +0100
++++ src/cmd/go/build.go 2012-11-17 01:37:33.000000000 +0100
+@@ -1387,7 +1387,7 @@
+ // strings returned are "gcc", "-I", objdir (and cuts them off).
+
+ // TODO: HOST_CC?
+- a := []string{"gcc", "-I", objdir, "-g", "-O2"}
++ a := []string{"@CC@", "-I", objdir, "-g", "-O2"}
+
+ // Definitely want -fPIC but on Windows gcc complains
+ // "-fPIC ignored for target (all code is position independent)"
Added: trunk/dports/lang/go/files/patch-src_make.bash-use-correct-compiler.diff
===================================================================
--- trunk/dports/lang/go/files/patch-src_make.bash-use-correct-compiler.diff (rev 0)
+++ trunk/dports/lang/go/files/patch-src_make.bash-use-correct-compiler.diff 2012-11-17 01:07:33 UTC (rev 99766)
@@ -0,0 +1,11 @@
+--- src/make.bash.orig 2012-11-17 01:19:20.000000000 +0100
++++ src/make.bash 2012-11-17 01:19:30.000000000 +0100
+@@ -93,7 +93,7 @@
+ 386) mflag=-m32;;
+ amd64) mflag=-m64;;
+ esac
+-gcc $mflag -O2 -Wall -Werror -ggdb -o cmd/dist/dist -Icmd/dist "$DEFGOROOT" cmd/dist/*.c
++$CC $mflag -O2 -Wall -Werror -ggdb -o cmd/dist/dist -Icmd/dist "$DEFGOROOT" cmd/dist/*.c
+
+ eval $(./cmd/dist/dist env -p)
+ echo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20121116/f70d7b06/attachment.html>
More information about the macports-changes
mailing list