commit: 8a0b80a318c74dd0765d2f0b630140863d8c2fd2
Author: Patrick McLean <chutzpah <AT> gentoo <DOT> org>
AuthorDate: Thu Apr 27 21:57:09 2023 +0000
Commit: Patrick McLean <chutzpah <AT> gentoo <DOT> org>
CommitDate: Thu Apr 27 22:01:26 2023 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8a0b80a3
dev-libs/simdjson: Add all-impls USE flag, and enable by default
By default upstream only compiles and enables the "optimial" implementation for
the current system. This is nice for some cases, however for a distro package
this is not ideal.
Signed-off-by: Patrick McLean <chutzpah <AT> gentoo.org>
dev-libs/simdjson/metadata.xml | 1 +
...djson-3.1.7.ebuild => simdjson-3.1.7-r1.ebuild} | 33 ++++++++++++++++------
2 files changed, 25 insertions(+), 9 deletions(-)
diff --git a/dev-libs/simdjson/metadata.xml b/dev-libs/simdjson/metadata.xml
index 0bd99c992917..d541fa2ee4a1 100644
--- a/dev-libs/simdjson/metadata.xml
+++ b/dev-libs/simdjson/metadata.xml
@@ -7,5 +7,6 @@
</maintainer>
<use>
<flag name="tools">Build and install extra command line
tools</flag>
+ <flag name="all-impls">Enable all implementations rather than
only onem</flag>
</use>
</pkgmetadata>
diff --git a/dev-libs/simdjson/simdjson-3.1.7.ebuild
b/dev-libs/simdjson/simdjson-3.1.7-r1.ebuild
similarity index 73%
rename from dev-libs/simdjson/simdjson-3.1.7.ebuild
rename to dev-libs/simdjson/simdjson-3.1.7-r1.ebuild
index 433f9a71935e..7900f6af3b7b 100644
--- a/dev-libs/simdjson/simdjson-3.1.7.ebuild
+++ b/dev-libs/simdjson/simdjson-3.1.7-r1.ebuild
@@ -19,7 +19,7 @@ SRC_URI="
LICENSE="Apache-2.0 Boost-1.0 BSD MIT"
SLOT="0/15"
KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~x86"
-IUSE="test tools"
+IUSE="+all-impls test tools"
BDEPEND="
sys-apps/file
@@ -63,23 +63,38 @@ src_prepare() {
src_configure() {
local mycmakeargs=(
- -DSIMDJSON_ENABLE_THREADS=ON
+ -DSIMDJSON_ENABLE_THREADS:BOOL=ON
)
use test && mycmakeargs+=(
- -DSIMDJSON_TESTS=ON
+ -DSIMDJSON_TESTS:BOOL=ON
)
if use tools; then
mycmakeargs+=(
- -DSIMDJSON_DEVELOPER_MODE=ON
- -DSIMDJSON_ALLOW_DOWNLOADS=OFF
- -DSIMDJSON_GOOGLE_BENCHMARKS=OFF
- -DSIMDJSON_COMPETITION=OFF
- -DSIMDJSON_TOOLS=ON
+ -DSIMDJSON_DEVELOPER_MODE:BOOL=ON
+ -DSIMDJSON_ALLOW_DOWNLOADS:BOOL=OFF
+ -DSIMDJSON_GOOGLE_BENCHMARKS:BOOL=OFF
+ -DSIMDJSON_COMPETITION:BOOL=OFF
+ -DSIMDJSON_TOOLS:BOOL=ON
)
elif ! use test; then
mycmakeargs+=(
- -DSIMDJSON_DEVELOPER_MODE=OFF
+ -DSIMDJSON_DEVELOPER_MODELBOOL=OFF
+ )
+ fi
+
+ if use all-impls; then
+ local -a impls=("fallback")
+ if use amd64 || use x86; then
+ impls+=("westmere" "haswell" "icelake")
+ elif use arm64; then
+ impls+=("arm64")
+ elif use ppc64; then
+ impls+=("ppc64")
+ fi
+
+ mycmakeargs+=(
+ -DSIMDJSON_IMPLEMENTATION:STRING=$(printf '%s;'
"${impls[@]}")
)
fi