From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 99F031386F1 for ; Mon, 10 Aug 2015 14:29:43 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id EE34A142AA; Mon, 10 Aug 2015 14:29:37 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 80F8B142AA for ; Mon, 10 Aug 2015 14:29:37 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id F2E8233D3CF for ; Mon, 10 Aug 2015 14:29:31 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 1E80E12A for ; Mon, 10 Aug 2015 14:29:30 +0000 (UTC) From: "William Hubbs" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "William Hubbs" Message-ID: <1439216873.fbfc50c70e13f14050ad9cf1893a111f4c98bf18.williamh@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: eclass/ X-VCS-Repository: repo/gentoo X-VCS-Files: eclass/golang-build.eclass X-VCS-Directories: eclass/ X-VCS-Committer: williamh X-VCS-Committer-Name: William Hubbs X-VCS-Revision: fbfc50c70e13f14050ad9cf1893a111f4c98bf18 X-VCS-Branch: master Date: Mon, 10 Aug 2015 14:29:30 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: bb3460ce-aa16-4643-8432-7e72ba570dfb X-Archives-Hash: c81cd4ec67dd07635b60c2828ce80ceb commit: fbfc50c70e13f14050ad9cf1893a111f4c98bf18 Author: William Hubbs gentoo org> AuthorDate: Sun Aug 9 16:50:25 2015 +0000 Commit: William Hubbs gentoo org> CommitDate: Mon Aug 10 14:27:53 2015 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fbfc50c7 golang-build.eclass: add support for EGO_BUILD_FLAGS eclass/golang-build.eclass | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/eclass/golang-build.eclass b/eclass/golang-build.eclass index 6f5a157..7a7e567 100644 --- a/eclass/golang-build.eclass +++ b/eclass/golang-build.eclass @@ -26,6 +26,19 @@ if [[ -z ${_GOLANG_BUILD} ]]; then _GOLANG_BUILD=1 +# @ECLASS-VARIABLE: EGO_BUILD_FLAGS +# @DEFAULT_UNSET +# @DESCRIPTION: +# This allows you to pass build flags to the Go compiler. These flags +# are common to the "go build" and "go install" commands used below. +# Please emerge dev-lang/go and run "go help build" for the +# documentation for these flags. +# +# Example: +# @CODE +# EGO_BUILD_FLAGS="-ldflags \"-X main.version ${PV}\"" +# @CODE + # @ECLASS-VARIABLE: EGO_PN # @REQUIRED # @DESCRIPTION: @@ -42,7 +55,7 @@ golang-build_src_compile() { ego_pn_check set -- env GOPATH="${WORKDIR}/${P}:$(get_golibdir_gopath)" \ - go build -v -work -x "${EGO_PN}" + go build -v -work -x ${EGO_BUILD_FLAGS} "${EGO_PN}" echo "$@" "$@" || die } @@ -52,7 +65,7 @@ golang-build_src_install() { ego_pn_check set -- env GOPATH="${WORKDIR}/${P}:$(get_golibdir_gopath)" \ - go install -v -work -x "${EGO_PN}" + go install -v -work -x ${EGO_BUILD_FLAGS} "${EGO_PN}" echo "$@" "$@" || die golang_install_pkgs