dev-db/mongodb: Add USE flags cpu_flags_x86_sse4_2 and cpu_flags_x86_ssse3

Update snappy build configuration based on cpu flags.

Closes: https://bugs.gentoo.org/982138
Signed-off-by: Aaron Sears-Aldridge <geodelic@gmail.com>
Part-of: https://github.com/gentoo/gentoo/pull/46787
Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
Aaron Sears-Aldridge
2026-09-16 17:20:18 +01:00
committed by Sam James
parent 8cf0e32270
commit bf17fe669d
2 changed files with 16 additions and 2 deletions
+8 -1
View File
@@ -63,7 +63,7 @@ S="${WORKDIR}/mongo-${MY_PV}"
LICENSE="Apache-2.0 SSPL-1"
SLOT="0"
KEYWORDS="~amd64 ~arm64"
IUSE="debug ssl"
IUSE="debug ssl cpu_flags_x86_sse4_2 cpu_flags_x86_ssse3"
# https://github.com/mongodb/mongo/wiki/Test-The-Mongodb-Server
# resmoke needs python packages not yet present in Gentoo
@@ -160,6 +160,13 @@ src_prepare() {
find "${S}" -name '*.b*z*l' -exec perl -0 -p -i \
-e 's#load\("\@poetry//.+?"\)\s*##gm;' \
-e 's#dependency\(.*?\),?##gs;' {} \; || die
# bug 982138
# fix snappy configuration for cpu features
use cpu_flags_x86_sse4_2 || sed -i 's/SNAPPY_HAVE_X86_CRC32 1/SNAPPY_HAVE_X86_CRC32 0/' \
src/third_party/snappy/platform/build_linux_x86_64/config.h
use cpu_flags_x86_ssse3 || sed -i 's/SNAPPY_HAVE_SSSE3 1/SNAPPY_HAVE_SSSE3 0/' \
src/third_party/snappy/platform/build_linux_x86_64/config.h
}
src_configure() {
+8 -1
View File
@@ -83,7 +83,7 @@ S="${WORKDIR}/mongo-${MY_PV}"
LICENSE="Apache-2.0 SSPL-1"
SLOT="0"
KEYWORDS="~amd64 ~arm64"
IUSE="debug ssl"
IUSE="debug ssl cpu_flags_x86_sse4_2 cpu_flags_x86_ssse3"
# https://github.com/mongodb/mongo/wiki/Test-The-Mongodb-Server
# resmoke needs python packages not yet present in Gentoo
@@ -194,6 +194,13 @@ src_prepare() {
# run auto_header.py
edob ${PYTHON} "${FILESDIR}"/auto_header.py "${S}"
# bug 982138
# fix snappy configuration for cpu features
use cpu_flags_x86_sse4_2 || sed -i 's/SNAPPY_HAVE_X86_CRC32 1/SNAPPY_HAVE_X86_CRC32 0/' \
src/third_party/snappy/platform/build_linux_x86_64/config.h
use cpu_flags_x86_ssse3 || sed -i 's/SNAPPY_HAVE_SSSE3 1/SNAPPY_HAVE_SSSE3 0/' \
src/third_party/snappy/platform/build_linux_x86_64/config.h
}
src_configure() {