golang: Avoid wrong hardcoded pkg-config path

Avoid having the value of the PKG_CONFIG environment variable at
build time being built into the go compiler. Fixes #3505.
This commit is contained in:
Fredrik Fornwall 2019-03-13 21:43:09 +01:00
parent 4d096a10fe
commit a971f1a1c6

View File

@ -2,6 +2,7 @@ TERMUX_PKG_HOMEPAGE=https://golang.org/
TERMUX_PKG_DESCRIPTION="Go programming language compiler"
TERMUX_PKG_LICENSE="BSD 3-Clause"
local _MAJOR_VERSION=1.12
TERMUX_PKG_REVISION=1
TERMUX_PKG_SHA256=09c43d3336743866f2985f566db0520b36f4992aea2b4b2fd9f52f17049e88f2
# Use the ~ deb versioning construct in the future:
TERMUX_PKG_VERSION=2:${_MAJOR_VERSION}
@ -18,12 +19,15 @@ termux_step_make_install() {
mkdir -p $TERMUX_GODIR/{src,doc,lib,pkg/tool/$TERMUX_GOLANG_DIRNAME,pkg/include,pkg/${TERMUX_GOLANG_DIRNAME}}
cd $TERMUX_PKG_SRCDIR/src
# Unset PKG_CONFIG to avoid the path being hardcoded into src/cmd/cgo/zdefaultcc.go,
# see https://github.com/termux/termux-packages/issues/3505.
env CC_FOR_TARGET=$CC \
CXX_FOR_TARGET=$CXX \
CC=gcc \
GO_LDFLAGS="-extldflags=-pie" \
GOROOT_BOOTSTRAP=$GOROOT \
GOROOT_FINAL=$TERMUX_GODIR \
PKG_CONFIG= \
./make.bash
cd ..