commit:     c10d98823936063e535edf7e28534314bb22a083
Author:     Yiyang Wu <xgreenlandforwyy <AT> gmail <DOT> com>
AuthorDate: Tue Mar  2 14:58:28 2021 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Mar  6 08:55:50 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c10d9882

dev-util/bazel: enable statically linked libstdc++ for gentoo prefix

Bug: https://bugs.gentoo.org/773982
Package-Manager: Portage-3.0.16, Repoman-3.0.2
Signed-off-by: Yiyang Wu <xgreenlandforwyy <AT> gmail.com>
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 dev-util/bazel/bazel-3.2.0.ebuild | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/dev-util/bazel/bazel-3.2.0.ebuild 
b/dev-util/bazel/bazel-3.2.0.ebuild
index 8963929994e..ac040b43670 100644
--- a/dev-util/bazel/bazel-3.2.0.ebuild
+++ b/dev-util/bazel/bazel-3.2.0.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2020 Gentoo Authors
+# Copyright 1999-2021 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=7
@@ -13,7 +13,8 @@ 
SRC_URI="https://github.com/bazelbuild/bazel/releases/download/${PV}/${P}-dist.z
 LICENSE="Apache-2.0"
 SLOT="0"
 KEYWORDS="~amd64"
-IUSE="examples tools"
+IUSE="examples tools prefix static-libs"
+REQUIRED_USE="prefix? ( static-libs )"
 # strip corrupts the bazel binary
 # test fails with network-sandbox: An error occurred during the fetch of 
repository 'io_bazel_skydoc' (bug 690794)
 RESTRICT="strip test"
@@ -67,6 +68,9 @@ src_prepare() {
 
 src_compile() {
        export EXTRA_BAZEL_ARGS="--jobs=$(makeopts_jobs) $(bazel-get-flags) 
--host_javabase=@local_jdk//:jdk"
+       if use static-libs; then
+               export BAZEL_LINKOPTS=-static-libs:-static-libgcc 
BAZEL_LINKLIBS=-l%:libstdc++.a:-lm
+       fi
        VERBOSE=yes ./compile.sh || die
 
        ./scripts/generate_bash_completion.sh \

Reply via email to