dev-lang/go: add patch for darwin by yegle in bug #558368
authorFabian Groffen <grobian@gentoo.org>
Mon, 2 Nov 2015 19:26:28 +0000 (20:26 +0100)
committerFabian Groffen <grobian@gentoo.org>
Mon, 2 Nov 2015 19:37:00 +0000 (20:37 +0100)
Package-Manager: portage-2.2.20-prefix

dev-lang/go/files/go-1.5.1-darwin-sysctl.patch [new file with mode: 0644]
dev-lang/go/go-1.5.1.ebuild

diff --git a/dev-lang/go/files/go-1.5.1-darwin-sysctl.patch b/dev-lang/go/files/go-1.5.1-darwin-sysctl.patch
new file mode 100644 (file)
index 0000000..5cec4b6
--- /dev/null
@@ -0,0 +1,11 @@
+--- src/cmd/dist/util.go.
++++ src/cmd/dist/util.go
+@@ -404,7 +404,7 @@
+       switch gohostos {
+       case "darwin":
+               // Even on 64-bit platform, darwin uname -m prints i386.
+-              if strings.Contains(run("", CheckExit, "sysctl", "machdep.cpu.extfeatures"), "EM64T") {
++              if strings.Contains(run("", CheckExit, "/usr/sbin/sysctl", "machdep.cpu.extfeatures"), "EM64T") {
+                       gohostarch = "amd64"
+               }
+       case "solaris":
index 8d4c7158d828dbc8198dd24d2efe7f15eaca35e9..139b35042ebe2adf67e01ea64b9a3b4b45cbbe44 100644 (file)
@@ -54,6 +54,7 @@ go_arch()
        local portage_arch=$(tc-arch $@)
        case "${portage_arch}" in
                x86)    echo 386;;
+               x64-*)  echo amd64;;
                *)              echo "${portage_arch}";;
        esac
 }
@@ -112,6 +113,7 @@ src_prepare()
                sed -i -e 's/"-Werror",//g' src/cmd/dist/build.go ||
                        die 'sed failed'
        fi
+       epatch "${FILESDIR}"/${P}-darwin-sysctl.patch
        epatch_user
 }