summaryrefslogtreecommitdiff
path: root/dev-cpp/xtensor
diff options
context:
space:
mode:
Diffstat (limited to 'dev-cpp/xtensor')
-rw-r--r--dev-cpp/xtensor/Manifest1
-rw-r--r--dev-cpp/xtensor/metadata.xml16
-rw-r--r--dev-cpp/xtensor/xtensor-0.26.0.ebuild87
3 files changed, 104 insertions, 0 deletions
diff --git a/dev-cpp/xtensor/Manifest b/dev-cpp/xtensor/Manifest
new file mode 100644
index 000000000000..1ace9bb56902
--- /dev/null
+++ b/dev-cpp/xtensor/Manifest
@@ -0,0 +1 @@
+DIST xtensor-0.26.0.tar.gz 1216657 BLAKE2B 6127426b7f581414e3d92847b4962a4a7808b0a82640157067aceaae3226b6d65d5b6f6090590604c6f76cc7b7e8e6fe45cadbfcf1350f6a115167379b4d5f73 SHA512 9fe07376ef05d9822ffedba2804ef8af402e6560ca1424624bbfb220ef954b4f721d09c22dc045a76134a5856eccf97bfbe08450e5e70c58128583c9352afb5e
diff --git a/dev-cpp/xtensor/metadata.xml b/dev-cpp/xtensor/metadata.xml
new file mode 100644
index 000000000000..c2d96d8dcd73
--- /dev/null
+++ b/dev-cpp/xtensor/metadata.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>gentoo.kamal@tgf.pw</email>
+ <name>Kamal Abdellatif</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="github">xtensor-stack/xtensor</remote-id>
+ <doc>https://xtensor.readthedocs.io/en/latest/</doc>
+ </upstream>
+ <use>
+ <flag name="openmp">Enable parallel assignment loop using OpenMP</flag>
+ <flag name="tbb">Enable parallel assignment loop using dev-cpp/tbb</flag>
+ </use>
+</pkgmetadata>
diff --git a/dev-cpp/xtensor/xtensor-0.26.0.ebuild b/dev-cpp/xtensor/xtensor-0.26.0.ebuild
new file mode 100644
index 000000000000..f84eb66e94d8
--- /dev/null
+++ b/dev-cpp/xtensor/xtensor-0.26.0.ebuild
@@ -0,0 +1,87 @@
+# Copyright 2023-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{13..14} )
+
+inherit cmake python-any-r1 optfeature toolchain-funcs
+
+DESCRIPTION="header-only C++ library for numerical analysis with multi-dimensional arrays"
+HOMEPAGE="https://github.com/xtensor-stack/xtensor"
+SRC_URI="https://codeload.github.com/xtensor-stack/${PN}/tar.gz/refs/tags/${PV} -> ${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64"
+
+IUSE="doc openmp tbb test"
+
+DEPEND="
+ >=dev-cpp/xtl-0.8.0
+ tbb? ( dev-cpp/tbb )
+"
+RDEPEND="${DEPEND}"
+BDEPEND="
+ doc? (
+ app-text/doxygen
+ $(python_gen_any_dep '
+ dev-python/breathe[${PYTHON_USEDEP}]
+ dev-python/sphinx[${PYTHON_USEDEP}]
+ dev-python/sphinx-rtd-theme[${PYTHON_USEDEP}]
+ ')
+ )
+ test? ( dev-cpp/doctest )
+"
+
+RESTRICT="!test? ( test )"
+REQUIRED_USE="?? ( tbb openmp )"
+
+python_check_deps() {
+ python_has_version \
+ "dev-python/breathe[${PYTHON_USEDEP}]" \
+ "dev-python/sphinx[${PYTHON_USEDEP}]" \
+ "dev-python/sphinx-rtd-theme[${PYTHON_USEDEP}]"
+}
+
+pkg_pretend() {
+ use openmp && tc-check-openmp
+}
+
+pkg_setup() {
+ use openmp && tc-check-openmp
+ use doc && python-any-r1_pkg_setup
+}
+
+src_prepare() {
+ # Skipping test due to https://github.com/xtensor-stack/xtensor/issues/2653
+ sed -i -e '/test_xoptional\.cpp/d' test/CMakeLists.txt || die
+
+ cmake_src_prepare
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DBUILD_TESTS=$(usex test)
+ -DXTENSOR_USE_OPENMP=$(usex openmp)
+ -DXTENSOR_USE_TBB=$(usex tbb)
+ # A specific verions of dev-cpp/xsimd is needed, so it requires ongoing maintenance.
+ -DXTENSOR_USE_XSIMD=OFF
+ )
+
+ cmake_src_configure
+}
+
+src_compile() {
+ cmake_src_compile
+ use doc && emake -C docs html
+}
+
+src_install() {
+ use doc && HTML_DOCS=( docs/build/html/* )
+ cmake_src_install
+}
+
+pkg_postinst() {
+ optfeature "JSON support" dev-cpp/nlohmann_json
+}