summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSv. Lockal <lockalsash@gmail.com>2024-07-13 14:40:56 +0000
committerSam James <sam@gentoo.org>2024-11-23 16:54:04 +0000
commit035bae314b847add8934886e11a4df62b9c7f16d (patch)
tree3fabd805b64bbffcd243b420157450171a30966a /games-board
parentnet-misc/tinyssh: small style tweaks (diff)
downloadgentoo-035bae314b847add8934886e11a4df62b9c7f16d.tar.gz
gentoo-035bae314b847add8934886e11a4df62b9c7f16d.tar.bz2
gentoo-035bae314b847add8934886e11a4df62b9c7f16d.zip
games-board/stockfish: fix clang build failure
COMP should be a fixed string like clang/gcc to set tools for PGO. Possible values are described in https://disservin.github.io/stockfish-docs/stockfish-wiki/Compiling-from-source.html#compilers Note that even though COMP points to C compiler, stockfish calls only C++ compile provided in COMPILER parameter. Closes: https://bugs.gentoo.org/919781 Signed-off-by: Sv. Lockal <lockalsash@gmail.com> Closes: https://github.com/gentoo/gentoo/pull/37542 Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'games-board')
-rw-r--r--games-board/stockfish/stockfish-16-r1.ebuild13
-rw-r--r--games-board/stockfish/stockfish-16.1.ebuild13
-rw-r--r--games-board/stockfish/stockfish-16.ebuild13
-rw-r--r--games-board/stockfish/stockfish-17.ebuild13
4 files changed, 48 insertions, 4 deletions
diff --git a/games-board/stockfish/stockfish-16-r1.ebuild b/games-board/stockfish/stockfish-16-r1.ebuild
index 87fef36d749c..ff7e0ac8d26a 100644
--- a/games-board/stockfish/stockfish-16-r1.ebuild
+++ b/games-board/stockfish/stockfish-16-r1.ebuild
@@ -22,6 +22,12 @@ DEPEND="|| ( app-arch/unzip app-arch/zip )"
S="${WORKDIR}/Stockfish-sf_${PV}/src"
+pkg_setup() {
+ if ! tc-is-clang && ! tc-is-gcc; then
+ die "Unsupported compiler: $(tc-getCC)"
+ fi
+}
+
src_prepare() {
default
@@ -66,11 +72,16 @@ src_compile() {
use ppc && my_arch=ppc
use ppc64 && my_arch=ppc64
+ # Bug 919781: COMP is a fixed string like clang/gcc to set tools for PGO
+ local comp
+ tc-is-gcc && comp="gcc"
+ tc-is-clang && comp="clang"
+
# There's a nice hack in the Makefile that overrides the value of CXX with
# COMPILER to support Travis CI and we abuse it to make sure that we
# build with our compiler of choice.
emake profile-build ARCH="${my_arch}" \
- COMP="$(tc-getCXX)" \
+ COMP="${comp}" \
COMPILER="$(tc-getCXX)" \
debug=$(usex debug "yes" "no") \
optimize=$(usex optimize "yes" "no")
diff --git a/games-board/stockfish/stockfish-16.1.ebuild b/games-board/stockfish/stockfish-16.1.ebuild
index 8d66d9cfa7cf..4cc6280b6b5d 100644
--- a/games-board/stockfish/stockfish-16.1.ebuild
+++ b/games-board/stockfish/stockfish-16.1.ebuild
@@ -26,6 +26,12 @@ DEPEND="|| ( app-arch/unzip app-arch/zip )"
S="${WORKDIR}/Stockfish-sf_${PV}/src"
+pkg_setup() {
+ if ! tc-is-clang && ! tc-is-gcc; then
+ die "Unsupported compiler: $(tc-getCC)"
+ fi
+}
+
src_prepare() {
default
@@ -72,11 +78,16 @@ src_compile() {
use ppc && my_arch=ppc
use ppc64 && my_arch=ppc64
+ # Bug 919781: COMP is a fixed string like clang/gcc to set tools for PGO
+ local comp
+ tc-is-gcc && comp="gcc"
+ tc-is-clang && comp="clang"
+
# There's a nice hack in the Makefile that overrides the value of CXX with
# COMPILER to support Travis CI and we abuse it to make sure that we
# build with our compiler of choice.
emake profile-build ARCH="${my_arch}" \
- COMP="$(tc-getCXX)" \
+ COMP="${comp}" \
COMPILER="$(tc-getCXX)" \
debug=$(usex debug "yes" "no") \
optimize=$(usex optimize "yes" "no")
diff --git a/games-board/stockfish/stockfish-16.ebuild b/games-board/stockfish/stockfish-16.ebuild
index 4cabca417965..9103928f0daa 100644
--- a/games-board/stockfish/stockfish-16.ebuild
+++ b/games-board/stockfish/stockfish-16.ebuild
@@ -22,6 +22,12 @@ DEPEND="|| ( app-arch/unzip app-arch/zip )"
S="${WORKDIR}/Stockfish-sf_${PV}/src"
+pkg_setup() {
+ if ! tc-is-clang && ! tc-is-gcc; then
+ die "Unsupported compiler: $(tc-getCC)"
+ fi
+}
+
src_prepare() {
default
@@ -61,11 +67,16 @@ src_compile() {
use ppc && my_arch=ppc
use ppc64 && my_arch=ppc64
+ # Bug 919781: COMP is a fixed string like clang/gcc to set tools for PGO
+ local comp
+ tc-is-gcc && comp="gcc"
+ tc-is-clang && comp="clang"
+
# There's a nice hack in the Makefile that overrides the value of CXX with
# COMPILER to support Travis CI and we abuse it to make sure that we
# build with our compiler of choice.
emake profile-build ARCH="${my_arch}" \
- COMP="$(tc-getCXX)" \
+ COMP="${comp}" \
COMPILER="$(tc-getCXX)" \
debug=$(usex debug "yes" "no") \
optimize=$(usex optimize "yes" "no")
diff --git a/games-board/stockfish/stockfish-17.ebuild b/games-board/stockfish/stockfish-17.ebuild
index bbc0c90cbf73..b535bb5e9f54 100644
--- a/games-board/stockfish/stockfish-17.ebuild
+++ b/games-board/stockfish/stockfish-17.ebuild
@@ -26,6 +26,12 @@ DEPEND="|| ( app-arch/unzip app-arch/zip )"
S="${WORKDIR}/Stockfish-sf_${PV}/src"
+pkg_setup() {
+ if ! tc-is-clang && ! tc-is-gcc; then
+ die "Unsupported compiler: $(tc-getCC)"
+ fi
+}
+
src_prepare() {
default
@@ -72,11 +78,16 @@ src_compile() {
use ppc && my_arch=ppc
use ppc64 && my_arch=ppc64
+ # Bug 919781: COMP is a fixed string like clang/gcc to set tools for PGO
+ local comp
+ tc-is-gcc && comp="gcc"
+ tc-is-clang && comp="clang"
+
# There's a nice hack in the Makefile that overrides the value of CXX with
# COMPILER to support Travis CI and we abuse it to make sure that we
# build with our compiler of choice.
emake profile-build ARCH="${my_arch}" \
- COMP="$(tc-getCXX)" \
+ COMP="${comp}" \
COMPILER="$(tc-getCXX)" \
debug=$(usex debug "yes" "no") \
optimize=$(usex optimize "yes" "no")